var wysihtml5={version:"0.3.0",commands:{},dom:{},quirks:{},toolbar:{},lang:{},selection:{},views:{},INVISIBLE_SPACE:"\ufeff",EMPTY_FUNCTION:function(){},ELEMENT_NODE:1,TEXT_NODE:3,BACKSPACE_KEY:8,ENTER_KEY:13,ESCAPE_KEY:27,SPACE_KEY:32,DELETE_KEY:46};window.rangy=function(){function e(e,t){var n=typeof e[t];return n==c||!(n!=l||!e[t])||"unknown"==n}function t(e,t){return!(typeof e[t]!=l||!e[t])}function n(e,t){return typeof e[t]!=d}function o(e){return function(t,n){for(var o=n.length;o--;)if(!e(t,n[o]))return!1;return!0}}function i(e){return e&&p(e,m)&&y(e,f)}function r(e){window.alert("Rangy not supported in your browser. Reason: "+e),v.initialized=!0,v.supported=!1}function a(){if(!v.initialized){var n,o=!1,a=!1;for(e(document,"createRange")&&(n=document.createRange(),p(n,h)&&y(n,u)&&(o=!0),n.detach()),(n=t(document,"body")?document.body:document.getElementsByTagName("body")[0])&&e(n,"createTextRange")&&(n=n.createTextRange(),i(n)&&(a=!0)),!o&&!a&&r("Neither Range nor TextRange are implemented"),v.initialized=!0,v.features={implementsDomRange:o,implementsTextRange:a},o=b.concat(w),a=0,n=o.length;n>a;++a)try{o[a](v)}catch(s){t(window,"console")&&e(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",s)}}}function s(e){this.name=e,this.supported=this.initialized=!1}var l="object",c="function",d="undefined",u="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer START_TO_START START_TO_END END_TO_START END_TO_END".split(" "),h="setStart setStartBefore setStartAfter setEnd setEndBefore setEndAfter collapse selectNode selectNodeContents compareBoundaryPoints deleteContents extractContents cloneContents insertNode surroundContents cloneRange toString detach".split(" "),f="boundingHeight boundingLeft boundingTop boundingWidth htmlText text".split(" "),m="collapse compareEndPoints duplicate getBookmark moveToBookmark moveToElementText parentElement pasteHTML select setEndPoint getBoundingClientRect".split(" "),p=o(e),g=o(t),y=o(n),v={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:e,isHostObject:t,isHostProperty:n,areHostMethods:p,areHostObjects:g,areHostProperties:y,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};v.fail=r,v.warn=function(e){e="Rangy warning: "+e,v.config.alertOnWarn?window.alert(e):typeof window.console!=d&&typeof window.console.log!=d&&window.console.log(e)},{}.hasOwnProperty?v.util.extend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}:r("hasOwnProperty not supported");var w=[],b=[];v.init=a,v.addInitListener=function(e){v.initialized?e(v):w.push(e)};var C=[];v.addCreateMissingNativeApiListener=function(e){C.push(e)},v.createMissingNativeApi=function(e){e=e||window,a();for(var t=0,n=C.length;n>t;++t)C[t](e)},s.prototype.fail=function(e){throw this.initialized=!0,this.supported=!1,Error("Module '"+this.name+"' failed to load: "+e)},s.prototype.warn=function(e){v.warn("Module "+this.name+": "+e)},s.prototype.createError=function(e){return Error("Error in Rangy "+this.name+" module: "+e)},v.createModule=function(e,t){var n=new s(e);v.modules[e]=n,b.push(function(e){t(e,n),n.initialized=!0,n.supported=!0})},v.requireModules=function(e){for(var t,n,o=0,i=e.length;i>o;++o){if(n=e[o],t=v.modules[n],!(t&&t instanceof s))throw Error("Module '"+n+"' not found");if(!t.supported)throw Error("Module '"+n+"' not supported")}};var N=!1,g=function(){N||(N=!0,v.initialized||a())};if(typeof window==d)r("No window found");else{if(typeof document!=d)return e(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",g,!1),e(window,"addEventListener")?window.addEventListener("load",g,!1):e(window,"attachEvent")?window.attachEvent("onload",g):r("Window does not have required addEventListener or attachEvent method"),v;r("No document found")}}(),rangy.createModule("DomUtil",function(e,t){function n(e){for(var t=0;e=e.previousSibling;)t++;return t}function o(e,t){var n,o=[];for(n=e;n;n=n.parentNode)o.push(n);for(n=t;n;n=n.parentNode)if(p(o,n))return n;return null}function i(e,t,n){for(n=n?e:e.parentNode;n;){if(e=n.parentNode,e===t)return n;n=e}return null}function r(e){return e=e.nodeType,3==e||4==e||8==e}function a(e,t){var n=t.nextSibling,o=t.parentNode;return n?o.insertBefore(e,n):o.appendChild(e),e}function s(e){if(9==e.nodeType)return e;if(typeof e.ownerDocument!=h)return e.ownerDocument;if(typeof e.document!=h)return e.document;if(e.parentNode)return s(e.parentNode);throw Error("getDocument: no document found for node")}function l(e){return e?r(e)?'"'+e.data+'"':1==e.nodeType?"<"+e.nodeName+(e.id?' id="'+e.id+'"':"")+">["+e.childNodes.length+"]":e.nodeName:"[No node]"}function c(e){this._next=this.root=e}function d(e,t){this.node=e,this.offset=t}function u(e){this.code=this[e],this.codeName=e,this.message="DOMException: "+this.codeName}var h="undefined",f=e.util;f.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||t.fail("document missing a Node creation method"),f.isHostMethod(document,"getElementsByTagName")||t.fail("document missing getElementsByTagName method");var m=document.createElement("div");f.areHostMethods(m,["insertBefore","appendChild","cloneNode"])||t.fail("Incomplete Element implementation"),f.isHostProperty(m,"innerHTML")||t.fail("Element is missing innerHTML property"),m=document.createTextNode("test"),f.areHostMethods(m,["splitText","deleteData","insertData","appendData","cloneNode"])||t.fail("Incomplete Text Node implementation");var p=function(e,t){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1};c.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var e,t=this._current=this._next;if(this._current){if(e=t.firstChild,!e)for(e=null;t!==this.root&&!(e=t.nextSibling);)t=t.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},d.prototype={equals:function(e){return this.node===e.node&this.offset==e.offset},inspect:function(){return"[DomPosition("+l(this.node)+":"+this.offset+")]"}},u.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11},u.prototype.toString=function(){return this.message},e.dom={arrayContains:p,isHtmlNamespace:function(e){var t;return typeof e.namespaceURI==h||null===(t=e.namespaceURI)||"http://www.w3.org/1999/xhtml"==t},parentElement:function(e){return e=e.parentNode,1==e.nodeType?e:null},getNodeIndex:n,getNodeLength:function(e){var t;return r(e)?e.length:(t=e.childNodes)?t.length:0},getCommonAncestor:o,isAncestorOf:function(e,t,n){for(t=n?t:t.parentNode;t;){if(t===e)return!0;t=t.parentNode}return!1},getClosestAncestorIn:i,isCharacterDataNode:r,insertAfter:a,splitDataNode:function(e,t){var n=e.cloneNode(!1);return n.deleteData(0,t),e.deleteData(t,e.length-t),a(n,e),n},getDocument:s,getWindow:function(e){if(e=s(e),typeof e.defaultView!=h)return e.defaultView;if(typeof e.parentWindow!=h)return e.parentWindow;throw Error("Cannot get a window object for node")},getIframeWindow:function(e){if(typeof e.contentWindow!=h)return e.contentWindow;if(typeof e.contentDocument!=h)return e.contentDocument.defaultView;throw Error("getIframeWindow: No Window object found for iframe element")},getIframeDocument:function(e){if(typeof e.contentDocument!=h)return e.contentDocument;if(typeof e.contentWindow!=h)return e.contentWindow.document;throw Error("getIframeWindow: No Document object found for iframe element")},getBody:function(e){return f.isHostObject(e,"body")?e.body:e.getElementsByTagName("body")[0]},getRootContainer:function(e){for(var t;t=e.parentNode;)e=t;return e},comparePoints:function(e,t,r,a){var s;if(e==r)return t===a?0:a>t?-1:1;if(s=i(r,e,!0))return t<=n(s)?-1:1;if(s=i(e,r,!0))return n(s)<a?-1:1;if(t=o(e,r),e=e===t?t:i(e,t,!0),r=r===t?t:i(r,t,!0),e===r)throw Error("comparePoints got to case 4 and childA and childB are the same!");for(t=t.firstChild;t;){if(t===e)return-1;if(t===r)return 1;t=t.nextSibling}throw Error("Should not be here!")},inspectNode:l,fragmentFromNodeChildren:function(e){for(var t,n=s(e).createDocumentFragment();t=e.firstChild;)n.appendChild(t);return n},createIterator:function(e){return new c(e)},DomPosition:d},e.DOMException=u}),rangy.createModule("DomRange",function(e){function t(e,t){return 3!=e.nodeType&&(I.isAncestorOf(e,t.startContainer,!0)||I.isAncestorOf(e,t.endContainer,!0))}function n(e){return I.getDocument(e.startContainer)}function o(e,t,n){if(t=e._listeners[t])for(var o=0,i=t.length;i>o;++o)t[o].call(e,{target:e,args:n})}function i(e){return new k(e.parentNode,I.getNodeIndex(e))}function r(e){return new k(e.parentNode,I.getNodeIndex(e)+1)}function a(e,t,n){var o=11==e.nodeType?e.firstChild:e;return I.isCharacterDataNode(t)?n==t.length?I.insertAfter(e,t):t.parentNode.insertBefore(e,0==n?t:I.splitDataNode(t,n)):n>=t.childNodes.length?t.appendChild(e):t.insertBefore(e,t.childNodes[n]),o}function s(e){for(var t,o,i=n(e.range).createDocumentFragment();o=e.next();){if(t=e.isPartiallySelectedSubtree(),o=o.cloneNode(!t),t&&(t=e.getSubtreeIterator(),o.appendChild(s(t)),t.detach(!0)),10==o.nodeType)throw new P("HIERARCHY_REQUEST_ERR");i.appendChild(o)}return i}function l(e,t,n){for(var o,i,n=n||{stop:!1};o=e.next();)if(e.isPartiallySelectedSubtree()){if(!1===t(o)){n.stop=!0;break}if(o=e.getSubtreeIterator(),l(o,t,n),o.detach(!0),n.stop)break}else for(o=I.createIterator(o);i=o.next();)if(!1===t(i))return void(n.stop=!0)}function c(e){for(var t;e.next();)e.isPartiallySelectedSubtree()?(t=e.getSubtreeIterator(),c(t),t.detach(!0)):e.remove()}function d(e){for(var t,o,i=n(e.range).createDocumentFragment();t=e.next();){if(e.isPartiallySelectedSubtree()?(t=t.cloneNode(!1),o=e.getSubtreeIterator(),t.appendChild(d(o)),o.detach(!0)):e.remove(),10==t.nodeType)throw new P("HIERARCHY_REQUEST_ERR");i.appendChild(t)}return i}function u(e,t,n){var o,i=!(!t||!t.length),r=!!n;i&&(o=RegExp("^("+t.join("|")+")$"));var a=[];return l(new f(e,!1),function(e){(!i||o.test(e.nodeType))&&(!r||n(e))&&a.push(e)}),a}function h(e){return"["+("undefined"==typeof e.getName?"Range":e.getName())+"("+I.inspectNode(e.startContainer)+":"+e.startOffset+", "+I.inspectNode(e.endContainer)+":"+e.endOffset+")]"}function f(e,t){if(this.range=e,this.clonePartiallySelectedTextNodes=t,!e.collapsed){this.sc=e.startContainer,this.so=e.startOffset,this.ec=e.endContainer,this.eo=e.endOffset;var n=e.commonAncestorContainer;this.sc===this.ec&&I.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||I.isCharacterDataNode(this.sc)?I.getClosestAncestorIn(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||I.isCharacterDataNode(this.ec)?I.getClosestAncestorIn(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}function m(e){this.code=this[e],this.codeName=e,this.message="RangeException: "+this.codeName}function p(e,t,n){this.nodes=u(e,t,n),this._next=this.nodes[0],this._position=0}function g(e){return function(t,n){for(var o,i=n?t:t.parentNode;i;){if(o=i.nodeType,I.arrayContains(e,o))return i;i=i.parentNode}return null}}function y(e,t){if(j(e,t))throw new m("INVALID_NODE_TYPE_ERR")}function v(e){if(!e.startContainer)throw new P("INVALID_STATE_ERR")}function w(e,t){if(!I.arrayContains(t,e.nodeType))throw new m("INVALID_NODE_TYPE_ERR")}function b(e,t){if(0>t||t>(I.isCharacterDataNode(e)?e.length:e.childNodes.length))throw new P("INDEX_SIZE_ERR")}function C(e,t){if(W(e,!0)!==W(t,!0))throw new P("WRONG_DOCUMENT_ERR")}function N(e){if(q(e,!0))throw new P("NO_MODIFICATION_ALLOWED_ERR")}function E(e,t){if(!e)throw new P(t)}function x(e){if(v(e),!((I.arrayContains(M,e.startContainer.nodeType)||W(e.startContainer,!0))&&(I.arrayContains(M,e.endContainer.nodeType)||W(e.endContainer,!0))&&e.startOffset<=(I.isCharacterDataNode(e.startContainer)?e.startContainer.length:e.startContainer.childNodes.length)&&e.endOffset<=(I.isCharacterDataNode(e.endContainer)?e.endContainer.length:e.endContainer.childNodes.length)))throw Error("Range error: Range is no longer valid after DOM mutation ("+e.inspect()+")")}function S(){}function T(e){e.START_TO_START=G,e.START_TO_END=X,e.END_TO_END=Q,e.END_TO_START=$,e.NODE_BEFORE=Z,e.NODE_AFTER=J,e.NODE_BEFORE_AND_AFTER=ee,e.NODE_INSIDE=te}function R(e){T(e),T(e.prototype)}function _(e,t){return function(){x(this);var n=this.startContainer,o=this.startOffset,i=this.commonAncestorContainer,a=new f(this,!0);return n!==i&&(n=I.getClosestAncestorIn(n,i,!0),o=r(n),n=o.node,o=o.offset),l(a,N),a.reset(),i=e(a),a.detach(),t(this,n,o,n,o),i}}function O(n,o,a){function s(e,t){return function(n){v(this),w(n,H),w(z(n),M),n=(e?i:r)(n),(t?l:u)(this,n.node,n.offset)}}function l(e,t,n){var i=e.endContainer,r=e.endOffset;(t!==e.startContainer||n!==e.startOffset)&&((z(t)!=z(i)||1==I.comparePoints(t,n,i,r))&&(i=t,r=n),o(e,t,n,i,r))}function u(e,t,n){var i=e.startContainer,r=e.startOffset;(t!==e.endContainer||n!==e.endOffset)&&((z(t)!=z(i)||-1==I.comparePoints(t,n,i,r))&&(i=t,r=n),o(e,i,r,t,n))}n.prototype=new S,e.util.extend(n.prototype,{setStart:function(e,t){v(this),y(e,!0),b(e,t),l(this,e,t)},setEnd:function(e,t){v(this),y(e,!0),b(e,t),u(this,e,t)},setStartBefore:s(!0,!0),setStartAfter:s(!1,!0),setEndBefore:s(!0,!1),setEndAfter:s(!1,!1),collapse:function(e){x(this),e?o(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):o(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(e){v(this),y(e,!0),o(this,e,0,e,I.getNodeLength(e))},selectNode:function(e){v(this),y(e,!1),w(e,H);var t=i(e),e=r(e);o(this,t.node,t.offset,e.node,e.offset)},extractContents:_(d,o),deleteContents:_(c,o),canSurroundContents:function(){x(this),N(this.startContainer),N(this.endContainer);var e=new f(this,!0),n=e._first&&t(e._first,this)||e._last&&t(e._last,this);return e.detach(),!n},detach:function(){a(this)},splitBoundaries:function(){x(this);var e=this.startContainer,t=this.startOffset,n=this.endContainer,i=this.endOffset,r=e===n;I.isCharacterDataNode(n)&&i>0&&i<n.length&&I.splitDataNode(n,i),I.isCharacterDataNode(e)&&t>0&&t<e.length&&(e=I.splitDataNode(e,t),r?(i-=t,n=e):n==e.parentNode&&i>=I.getNodeIndex(e)&&i++,t=0),o(this,e,t,n,i)},normalizeBoundaries:function(){x(this);var e=this.startContainer,t=this.startOffset,n=this.endContainer,i=this.endOffset,r=function(e){var t=e.nextSibling;t&&t.nodeType==e.nodeType&&(n=e,i=e.length,e.appendData(t.data),t.parentNode.removeChild(t))},a=function(o){var r=o.previousSibling;if(r&&r.nodeType==o.nodeType){e=o;var a=o.length;t=r.length,o.insertData(0,r.data),r.parentNode.removeChild(r),e==n?(i+=t,n=e):n==o.parentNode&&(r=I.getNodeIndex(o),i==r?(n=o,i=a):i>r&&i--)}},s=!0;I.isCharacterDataNode(n)?n.length==i&&r(n):(i>0&&(s=n.childNodes[i-1])&&I.isCharacterDataNode(s)&&r(s),s=!this.collapsed),s?I.isCharacterDataNode(e)?0==t&&a(e):t<e.childNodes.length&&(r=e.childNodes[t])&&I.isCharacterDataNode(r)&&a(r):(e=n,t=i),o(this,e,t,n,i)},collapseToPoint:function(e,t){v(this),y(e,!0),b(e,t),(e!==this.startContainer||t!==this.startOffset||e!==this.endContainer||t!==this.endOffset)&&o(this,e,t,e,t)}}),R(n)}function A(e){e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset,e.commonAncestorContainer=e.collapsed?e.startContainer:I.getCommonAncestor(e.startContainer,e.endContainer)}function D(e,t,n,i,r){var a=e.startContainer!==t||e.startOffset!==n,s=e.endContainer!==i||e.endOffset!==r;e.startContainer=t,e.startOffset=n,e.endContainer=i,e.endOffset=r,A(e),o(e,"boundarychange",{startMoved:a,endMoved:s})}function L(e){this.startContainer=e,this.startOffset=0,this.endContainer=e,this.endOffset=0,this._listeners={boundarychange:[],detach:[]},A(this)}e.requireModules(["DomUtil"]);var I=e.dom,k=I.DomPosition,P=e.DOMException;f.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var e=this._current=this._next;return e&&(this._next=e!==this._last?e.nextSibling:null,I.isCharacterDataNode(e)&&this.clonePartiallySelectedTextNodes&&(e===this.ec&&(e=e.cloneNode(!0)).deleteData(this.eo,e.length-this.eo),this._current===this.sc&&(e=e.cloneNode(!0)).deleteData(0,this.so))),e},remove:function(){var e,t,n=this._current;!I.isCharacterDataNode(n)||n!==this.sc&&n!==this.ec?n.parentNode&&n.parentNode.removeChild(n):(e=n===this.sc?this.so:0,t=n===this.ec?this.eo:n.length,e!=t&&n.deleteData(e,t-e))},isPartiallySelectedSubtree:function(){return t(this._current,this.range)},getSubtreeIterator:function(){var e;if(this.isSingleCharacterDataNode)e=this.range.cloneRange(),e.collapse();else{e=new L(n(this.range));var t=this._current,o=t,i=0,r=t,a=I.getNodeLength(t);I.isAncestorOf(t,this.sc,!0)&&(o=this.sc,i=this.so),I.isAncestorOf(t,this.ec,!0)&&(r=this.ec,a=this.eo),D(e,o,i,r,a)}return new f(e,this.clonePartiallySelectedTextNodes)},detach:function(e){e&&this.range.detach(),this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}},m.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2},m.prototype.toString=function(){return this.message},p.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){return this._current=this._next,this._next=this.nodes[++this._position],this._current},detach:function(){this._current=this._next=this.nodes=null}};var H=[1,3,4,5,7,8,10],M=[2,9,11],B=[1,3,4,5,7,8,10,11],V=[1,3,4,5,7,8],z=I.getRootContainer,W=g([9,11]),q=g([5,6,10,12]),j=g([6,10,12]),U=document.createElement("style"),F=!1;try{U.innerHTML="<b>x</b>",F=3==U.firstChild.nodeType}catch(K){}e.features.htmlParsingConforms=F;var Y="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer".split(" "),G=0,X=1,Q=2,$=3,Z=0,J=1,ee=2,te=3;S.prototype={attachListener:function(e,t){this._listeners[e].push(t)},compareBoundaryPoints:function(e,t){x(this),C(this.startContainer,t.startContainer);var n=e==$||e==G?"start":"end",o=e==X||e==G?"start":"end";return I.comparePoints(this[n+"Container"],this[n+"Offset"],t[o+"Container"],t[o+"Offset"])},insertNode:function(e){if(x(this),w(e,B),N(this.startContainer),I.isAncestorOf(e,this.startContainer,!0))throw new P("HIERARCHY_REQUEST_ERR");this.setStartBefore(a(e,this.startContainer,this.startOffset))},cloneContents:function(){x(this);var e,t;return this.collapsed?n(this).createDocumentFragment():this.startContainer===this.endContainer&&I.isCharacterDataNode(this.startContainer)?(e=this.startContainer.cloneNode(!0),e.data=e.data.slice(this.startOffset,this.endOffset),t=n(this).createDocumentFragment(),t.appendChild(e),t):(t=new f(this,!0),e=s(t),t.detach(),e)},canSurroundContents:function(){x(this),N(this.startContainer),N(this.endContainer);var e=new f(this,!0),n=e._first&&t(e._first,this)||e._last&&t(e._last,this);return e.detach(),!n},surroundContents:function(e){if(w(e,V),!this.canSurroundContents())throw new m("BAD_BOUNDARYPOINTS_ERR");var t=this.extractContents();if(e.hasChildNodes())for(;e.lastChild;)e.removeChild(e.lastChild);a(e,this.startContainer,this.startOffset),e.appendChild(t),this.selectNode(e)},cloneRange:function(){x(this);for(var e,t=new L(n(this)),o=Y.length;o--;)e=Y[o],t[e]=this[e];return t},toString:function(){x(this);var e=this.startContainer;if(e===this.endContainer&&I.isCharacterDataNode(e))return 3==e.nodeType||4==e.nodeType?e.data.slice(this.startOffset,this.endOffset):"";var t=[],e=new f(this,!0);return l(e,function(e){(3==e.nodeType||4==e.nodeType)&&t.push(e.data)}),e.detach(),t.join("")},compareNode:function(e){x(this);var t=e.parentNode,n=I.getNodeIndex(e);if(!t)throw new P("NOT_FOUND_ERR");return e=this.comparePoint(t,n),t=this.comparePoint(t,n+1),0>e?t>0?ee:Z:t>0?J:te},comparePoint:function(e,t){return x(this),E(e,"HIERARCHY_REQUEST_ERR"),C(e,this.startContainer),0>I.comparePoints(e,t,this.startContainer,this.startOffset)?-1:0<I.comparePoints(e,t,this.endContainer,this.endOffset)?1:0},createContextualFragment:F?function(e){var t=this.startContainer,n=I.getDocument(t);if(!t)throw new P("INVALID_STATE_ERR");var o=null;return 1==t.nodeType?o=t:I.isCharacterDataNode(t)&&(o=I.parentElement(t)),o=null===o||"HTML"==o.nodeName&&I.isHtmlNamespace(I.getDocument(o).documentElement)&&I.isHtmlNamespace(o)?n.createElement("body"):o.cloneNode(!1),o.innerHTML=e,I.fragmentFromNodeChildren(o)}:function(e){v(this);var t=n(this).createElement("body");return t.innerHTML=e,I.fragmentFromNodeChildren(t)},toHtml:function(){x(this);var e=n(this).createElement("div");return e.appendChild(this.cloneContents()),e.innerHTML},intersectsNode:function(e,t){if(x(this),E(e,"NOT_FOUND_ERR"),I.getDocument(e)!==n(this))return!1;var o=e.parentNode,i=I.getNodeIndex(e);E(o,"NOT_FOUND_ERR");var r=I.comparePoints(o,i,this.endContainer,this.endOffset),o=I.comparePoints(o,i+1,this.startContainer,this.startOffset);return t?0>=r&&o>=0:0>r&&o>0},isPointInRange:function(e,t){return x(this),E(e,"HIERARCHY_REQUEST_ERR"),C(e,this.startContainer),0<=I.comparePoints(e,t,this.startContainer,this.startOffset)&&0>=I.comparePoints(e,t,this.endContainer,this.endOffset)},intersectsRange:function(e,t){if(x(this),n(e)!=n(this))throw new P("WRONG_DOCUMENT_ERR");var o=I.comparePoints(this.startContainer,this.startOffset,e.endContainer,e.endOffset),i=I.comparePoints(this.endContainer,this.endOffset,e.startContainer,e.startOffset);return t?0>=o&&i>=0:0>o&&i>0},intersection:function(e){if(this.intersectsRange(e)){var t=I.comparePoints(this.startContainer,this.startOffset,e.startContainer,e.startOffset),n=I.comparePoints(this.endContainer,this.endOffset,e.endContainer,e.endOffset),o=this.cloneRange();return-1==t&&o.setStart(e.startContainer,e.startOffset),1==n&&o.setEnd(e.endContainer,e.endOffset),o}return null},union:function(e){if(this.intersectsRange(e,!0)){var t=this.cloneRange();return-1==I.comparePoints(e.startContainer,e.startOffset,this.startContainer,this.startOffset)&&t.setStart(e.startContainer,e.startOffset),1==I.comparePoints(e.endContainer,e.endOffset,this.endContainer,this.endOffset)&&t.setEnd(e.endContainer,e.endOffset),t}throw new m("Ranges do not intersect")},containsNode:function(e,t){return t?this.intersectsNode(e,!1):this.compareNode(e)==te},containsNodeContents:function(e){return 0<=this.comparePoint(e,0)&&0>=this.comparePoint(e,I.getNodeLength(e))},containsRange:function(e){return this.intersection(e).equals(e)},containsNodeText:function(e){var t=this.cloneRange();t.selectNode(e);var n=t.getNodes([3]);return 0<n.length?(t.setStart(n[0],0),e=n.pop(),t.setEnd(e,e.length),e=this.containsRange(t),t.detach(),e):this.containsNodeContents(e)},createNodeIterator:function(e,t){return x(this),new p(this,e,t)},getNodes:function(e,t){return x(this),u(this,e,t)},getDocument:function(){return n(this)},collapseBefore:function(e){v(this),this.setEndBefore(e),this.collapse(!1)},collapseAfter:function(e){v(this),this.setStartAfter(e),this.collapse(!0)},getName:function(){return"DomRange"},equals:function(e){return L.rangesEqual(this,e)},inspect:function(){return h(this)}},O(L,D,function(e){v(e),e.startContainer=e.startOffset=e.endContainer=e.endOffset=null,e.collapsed=e.commonAncestorContainer=null,o(e,"detach",null),e._listeners=null}),e.rangePrototype=S.prototype,L.rangeProperties=Y,L.RangeIterator=f,L.copyComparisonConstants=R,L.createPrototypeRange=O,L.inspect=h,L.getRangeDocument=n,L.rangesEqual=function(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},e.DomRange=L,e.RangeException=m}),rangy.createModule("WrappedRange",function(e){function t(e,t,n,o){var a=e.duplicate();a.collapse(n);var s=a.parentElement();if(i.isAncestorOf(t,s,!0)||(s=t),!s.canHaveHTML)return new r(s.parentNode,i.getNodeIndex(s));var l,t=i.getDocument(s).createElement("span"),c=n?"StartToStart":"StartToEnd";do s.insertBefore(t,t.previousSibling),a.moveToElementText(t);while(0<(l=a.compareEndPoints(c,e))&&t.previousSibling);if(c=t.nextSibling,-1==l&&c&&i.isCharacterDataNode(c)){if(a.setEndPoint(n?"EndToStart":"EndToEnd",e),/[\r\n]/.test(c.data))for(s=a.duplicate(),n=s.text.replace(/\r\n/g,"\r").length,n=s.moveStart("character",n);-1==s.compareEndPoints("StartToEnd",s);)n++,s.moveStart("character",1);else n=a.text.length;s=new r(c,n)}else c=(o||!n)&&t.previousSibling,s=(n=(o||n)&&t.nextSibling)&&i.isCharacterDataNode(n)?new r(n,0):c&&i.isCharacterDataNode(c)?new r(c,c.length):new r(s,i.getNodeIndex(t));return t.parentNode.removeChild(t),s}function n(e,t){var n,o,r=e.offset,a=i.getDocument(e.node),s=a.body.createTextRange(),l=i.isCharacterDataNode(e.node);return l?(n=e.node,o=n.parentNode):(n=e.node.childNodes,n=r<n.length?n[r]:null,o=e.node),a=a.createElement("span"),a.innerHTML="&#feff;",n?o.insertBefore(a,n):o.appendChild(a),s.moveToElementText(a),s.collapse(!t),o.removeChild(a),l&&s[t?"moveStart":"moveEnd"]("character",r),s}e.requireModules(["DomUtil","DomRange"]);var o,i=e.dom,r=i.DomPosition,a=e.DomRange;if(!e.features.implementsDomRange||e.features.implementsTextRange&&e.config.preferTextRange){if(e.features.implementsTextRange){o=function(e){this.textRange=e,this.refresh()},o.prototype=new a(document),o.prototype.refresh=function(){var e,n,o=this.textRange;e=o.parentElement();var r=o.duplicate();r.collapse(!0),n=r.parentElement(),r=o.duplicate(),r.collapse(!1),o=r.parentElement(),n=n==o?n:i.getCommonAncestor(n,o),n=n==e?n:i.getCommonAncestor(e,n),0==this.textRange.compareEndPoints("StartToEnd",this.textRange)?n=e=t(this.textRange,n,!0,!0):(e=t(this.textRange,n,!0,!1),n=t(this.textRange,n,!1,!1)),this.setStart(e.node,e.offset),this.setEnd(n.node,n.offset)},a.copyComparisonConstants(o);var s=function(){return this}();"undefined"==typeof s.Range&&(s.Range=o),e.createNativeRange=function(e){return e=e||document,e.body.createTextRange()}}}else(function(){function t(e){for(var t,n=s.length;n--;)t=s[n],e[t]=e.nativeRange[t]}var n,r,s=a.rangeProperties;o=function(e){if(!e)throw Error("Range must be specified");this.nativeRange=e,t(this)},a.createPrototypeRange(o,function(e,t,n,o,i){var r=e.endContainer!==o||e.endOffset!=i;(e.startContainer!==t||e.startOffset!=n||r)&&(e.setEnd(o,i),e.setStart(t,n))},function(e){e.nativeRange.detach(),e.detached=!0;for(var t,n=s.length;n--;)t=s[n],e[t]=null}),n=o.prototype,n.selectNode=function(e){this.nativeRange.selectNode(e),t(this)},n.deleteContents=function(){this.nativeRange.deleteContents(),t(this)},n.extractContents=function(){var e=this.nativeRange.extractContents();return t(this),e},n.cloneContents=function(){return this.nativeRange.cloneContents()},n.surroundContents=function(e){this.nativeRange.surroundContents(e),t(this)},n.collapse=function(e){this.nativeRange.collapse(e),t(this)},n.cloneRange=function(){return new o(this.nativeRange.cloneRange())},n.refresh=function(){t(this)},n.toString=function(){return this.nativeRange.toString()};var l=document.createTextNode("test");i.getBody(document).appendChild(l);var c=document.createRange();c.setStart(l,0),c.setEnd(l,0);try{c.setStart(l,1),n.setStart=function(e,n){this.nativeRange.setStart(e,n),t(this)},n.setEnd=function(e,n){this.nativeRange.setEnd(e,n),t(this)},r=function(e){return function(n){this.nativeRange[e](n),t(this)}}}catch(d){n.setStart=function(e,n){try{this.nativeRange.setStart(e,n)}catch(o){this.nativeRange.setEnd(e,n),this.nativeRange.setStart(e,n)}t(this)},n.setEnd=function(e,n){try{this.nativeRange.setEnd(e,n)}catch(o){this.nativeRange.setStart(e,n),this.nativeRange.setEnd(e,n)}t(this)},r=function(e,n){return function(o){try{this.nativeRange[e](o)}catch(i){this.nativeRange[n](o),this.nativeRange[e](o)}t(this)}}}n.setStartBefore=r("setStartBefore","setEndBefore"),n.setStartAfter=r("setStartAfter","setEndAfter"),n.setEndBefore=r("setEndBefore","setStartBefore"),n.setEndAfter=r("setEndAfter","setStartAfter"),c.selectNodeContents(l),n.selectNodeContents=c.startContainer==l&&c.endContainer==l&&0==c.startOffset&&c.endOffset==l.length?function(e){this.nativeRange.selectNodeContents(e),t(this)}:function(e){this.setStart(e,0),this.setEnd(e,a.getEndOffset(e))},c.selectNodeContents(l),c.setEnd(l,3),r=document.createRange(),r.selectNodeContents(l),r.setEnd(l,4),r.setStart(l,2),n.compareBoundaryPoints=-1==c.compareBoundaryPoints(c.START_TO_END,r)&1==c.compareBoundaryPoints(c.END_TO_START,r)?function(e,t){return t=t.nativeRange||t,e==t.START_TO_END?e=t.END_TO_START:e==t.END_TO_START&&(e=t.START_TO_END),this.nativeRange.compareBoundaryPoints(e,t)}:function(e,t){return this.nativeRange.compareBoundaryPoints(e,t.nativeRange||t)},e.util.isHostMethod(c,"createContextualFragment")&&(n.createContextualFragment=function(e){return this.nativeRange.createContextualFragment(e)}),i.getBody(document).removeChild(l),c.detach(),r.detach()})(),e.createNativeRange=function(e){return e=e||document,e.createRange()};e.features.implementsTextRange&&(o.rangeToTextRange=function(e){if(e.collapsed)return n(new r(e.startContainer,e.startOffset),!0);var t=n(new r(e.startContainer,e.startOffset),!0),o=n(new r(e.endContainer,e.endOffset),!1),e=i.getDocument(e.startContainer).body.createTextRange();return e.setEndPoint("StartToStart",t),e.setEndPoint("EndToEnd",o),e}),o.prototype.getName=function(){return"WrappedRange"},e.WrappedRange=o,e.createRange=function(t){return t=t||document,new o(e.createNativeRange(t))},e.createRangyRange=function(e){return e=e||document,new a(e)},e.createIframeRange=function(t){return e.createRange(i.getIframeDocument(t))},e.createIframeRangyRange=function(t){return e.createRangyRange(i.getIframeDocument(t))},e.addCreateMissingNativeApiListener(function(t){t=t.document,"undefined"==typeof t.createRange&&(t.createRange=function(){return e.createRange(this)}),t=t=null})}),rangy.createModule("WrappedSelection",function(e,t){function n(e){return(e||window).getSelection()}function o(e){return(e||window).document.selection}function i(e,t,n){var o=n?"end":"start",n=n?"start":"end";e.anchorNode=t[o+"Container"],e.anchorOffset=t[o+"Offset"],e.focusNode=t[n+"Container"],e.focusOffset=t[n+"Offset"]}function r(e){e.anchorNode=e.focusNode=null,e.anchorOffset=e.focusOffset=0,e.rangeCount=0,e.isCollapsed=!0,e._ranges.length=0}function a(t){var n;return t instanceof w?(n=t._selectionNativeRange,n||(n=e.createNativeRange(y.getDocument(t.startContainer)),n.setEnd(t.endContainer,t.endOffset),n.setStart(t.startContainer,t.startOffset),t._selectionNativeRange=n,t.attachListener("detach",function(){this._selectionNativeRange=null}))):t instanceof b?n=t.nativeRange:e.features.implementsDomRange&&t instanceof y.getWindow(t.startContainer).Range&&(n=t),n}function s(e){var t,n=e.getNodes();e:if(n.length&&1==n[0].nodeType){t=1;for(var o=n.length;o>t;++t)if(!y.isAncestorOf(n[0],n[t])){t=!1;break e}t=!0}else t=!1;if(!t)throw Error("getSingleElementFromRange: range "+e.inspect()+" did not consist of a single element");return n[0]}function l(e,t){var n=new b(t);e._ranges=[n],i(e,n,!1),e.rangeCount=1,e.isCollapsed=n.collapsed}function c(t){if(t._ranges.length=0,"None"==t.docSelection.type)r(t);else{var n=t.docSelection.createRange();if(n&&"undefined"!=typeof n.text)l(t,n);else{t.rangeCount=n.length;for(var o,a=y.getDocument(n.item(0)),s=0;s<t.rangeCount;++s)o=e.createRange(a),o.selectNode(n.item(s)),t._ranges.push(o);t.isCollapsed=1==t.rangeCount&&t._ranges[0].collapsed,i(t,t._ranges[t.rangeCount-1],!1)}}}function d(e,t){for(var n=e.docSelection.createRange(),o=s(t),i=y.getDocument(n.item(0)),i=y.getBody(i).createControlRange(),r=0,a=n.length;a>r;++r)i.add(n.item(r));try{i.add(o)}catch(l){throw Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}i.select(),c(e)}function u(e,t,n){this.nativeSelection=e,this.docSelection=t,this._ranges=[],this.win=n,this.refresh()}function h(e,t){for(var n,o=y.getDocument(t[0].startContainer),o=y.getBody(o).createControlRange(),i=0;rangeCount>i;++i){
n=s(t[i]);try{o.add(n)}catch(r){throw Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}o.select(),c(e)}function f(e,t){if(e.anchorNode&&y.getDocument(e.anchorNode)!==y.getDocument(t))throw new C("WRONG_DOCUMENT_ERR")}function m(e){var t=[],n=new N(e.anchorNode,e.anchorOffset),o=new N(e.focusNode,e.focusOffset),i="function"==typeof e.getName?e.getName():"Selection";if("undefined"!=typeof e.rangeCount)for(var r=0,a=e.rangeCount;a>r;++r)t[r]=w.inspect(e.getRangeAt(r));return"["+i+"(Ranges: "+t.join(", ")+")(anchor: "+n.inspect()+", focus: "+o.inspect()+"]"}e.requireModules(["DomUtil","DomRange","WrappedRange"]),e.config.checkSelectionRanges=!0;var p,g,y=e.dom,v=e.util,w=e.DomRange,b=e.WrappedRange,C=e.DOMException,N=y.DomPosition,E=e.util.isHostMethod(window,"getSelection"),x=e.util.isHostObject(document,"selection"),S=x&&(!E||e.config.preferTextRange);S?(p=o,e.isSelectionValid=function(e){var e=(e||window).document,t=e.selection;return"None"!=t.type||y.getDocument(t.createRange().parentElement())==e}):E?(p=n,e.isSelectionValid=function(){return!0}):t.fail("Neither document.selection or window.getSelection() detected."),e.getNativeSelection=p;var E=p(),T=e.createNativeRange(document),R=y.getBody(document),_=v.areHostObjects(E,v.areHostProperties(E,["anchorOffset","focusOffset"]));e.features.selectionHasAnchorAndFocus=_;var O=v.isHostMethod(E,"extend");e.features.selectionHasExtend=O;var A="number"==typeof E.rangeCount;e.features.selectionHasRangeCount=A;var D=!1,L=!0;v.areHostMethods(E,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof E.rangeCount&&e.features.implementsDomRange&&function(){var e=document.createElement("iframe");R.appendChild(e);var t=y.getIframeDocument(e);t.open(),t.write("<html><head></head><body>12</body></html>"),t.close();var n=y.getIframeWindow(e).getSelection(),o=t.documentElement.lastChild.firstChild,t=t.createRange();t.setStart(o,1),t.collapse(!0),n.addRange(t),L=1==n.rangeCount,n.removeAllRanges();var i=t.cloneRange();t.setStart(o,0),i.setEnd(o,2),n.addRange(t),n.addRange(i),D=2==n.rangeCount,t.detach(),i.detach(),R.removeChild(e)}(),e.features.selectionSupportsMultipleRanges=D,e.features.collapsedNonEditableSelectionsSupported=L;var I,k=!1;R&&v.isHostMethod(R,"createControlRange")&&(I=R.createControlRange(),v.areHostProperties(I,["item","add"])&&(k=!0)),e.features.implementsControlRange=k,g=_?function(e){return e.anchorNode===e.focusNode&&e.anchorOffset===e.focusOffset}:function(e){return e.rangeCount?e.getRangeAt(e.rangeCount-1).collapsed:!1};var P;if(v.isHostMethod(E,"getRangeAt")?P=function(e,t){try{return e.getRangeAt(t)}catch(n){return null}}:_&&(P=function(t){var n=y.getDocument(t.anchorNode),n=e.createRange(n);return n.setStart(t.anchorNode,t.anchorOffset),n.setEnd(t.focusNode,t.focusOffset),n.collapsed!==this.isCollapsed&&(n.setStart(t.focusNode,t.focusOffset),n.setEnd(t.anchorNode,t.anchorOffset)),n}),e.getSelection=function(e){var e=e||window,t=e._rangySelection,n=p(e),i=x?o(e):null;return t?(t.nativeSelection=n,t.docSelection=i,t.refresh(e)):(t=new u(n,i,e),e._rangySelection=t),t},e.getIframeSelection=function(t){return e.getSelection(y.getIframeWindow(t))},I=u.prototype,!S&&_&&v.areHostMethods(E,["removeAllRanges","addRange"])){I.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),r(this)};var H=function(t,n){var o=w.getRangeDocument(n),o=e.createRange(o);o.collapseToPoint(n.endContainer,n.endOffset),t.nativeSelection.addRange(a(o)),t.nativeSelection.extend(n.startContainer,n.startOffset),t.refresh()};I.addRange=A?function(t,n){if(k&&x&&"Control"==this.docSelection.type)d(this,t);else if(n&&O)H(this,t);else{var o;D?o=this.rangeCount:(this.removeAllRanges(),o=0),this.nativeSelection.addRange(a(t)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1?(e.config.checkSelectionRanges&&(o=P(this.nativeSelection,this.rangeCount-1))&&!w.rangesEqual(o,t)&&(t=new b(o)),this._ranges[this.rangeCount-1]=t,i(this,t,V(this.nativeSelection)),this.isCollapsed=g(this)):this.refresh()}}:function(e,t){t&&O?H(this,e):(this.nativeSelection.addRange(a(e)),this.refresh())},I.setRanges=function(e){if(k&&e.length>1)h(this,e);else{this.removeAllRanges();for(var t=0,n=e.length;n>t;++t)this.addRange(e[t])}}}else{if(!(v.isHostMethod(E,"empty")&&v.isHostMethod(T,"select")&&k&&S))return t.fail("No means of selecting a Range or TextRange was found"),!1;I.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var e;if(this.anchorNode)e=y.getDocument(this.anchorNode);else if("Control"==this.docSelection.type){var t=this.docSelection.createRange();t.length&&(e=y.getDocument(t.item(0)).body.createTextRange())}e&&(e.body.createTextRange().select(),this.docSelection.empty())}}catch(n){}r(this)},I.addRange=function(e){"Control"==this.docSelection.type?d(this,e):(b.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,i(this,e,!1))},I.setRanges=function(e){this.removeAllRanges();var t=e.length;t>1?h(this,e):t&&this.addRange(e[0])}}I.getRangeAt=function(e){if(0>e||e>=this.rangeCount)throw new C("INDEX_SIZE_ERR");return this._ranges[e]};var M;if(S)M=function(t){var n;e.isSelectionValid(t.win)?n=t.docSelection.createRange():(n=y.getBody(t.win.document).createTextRange(),n.collapse(!0)),"Control"==t.docSelection.type?c(t):n&&"undefined"!=typeof n.text?l(t,n):r(t)};else if(v.isHostMethod(E,"getRangeAt")&&"number"==typeof E.rangeCount)M=function(t){if(k&&x&&"Control"==t.docSelection.type)c(t);else if(t._ranges.length=t.rangeCount=t.nativeSelection.rangeCount,t.rangeCount){for(var n=0,o=t.rangeCount;o>n;++n)t._ranges[n]=new e.WrappedRange(t.nativeSelection.getRangeAt(n));i(t,t._ranges[t.rangeCount-1],V(t.nativeSelection)),t.isCollapsed=g(t)}else r(t)};else{if(!_||"boolean"!=typeof E.isCollapsed||"boolean"!=typeof T.collapsed||!e.features.implementsDomRange)return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;M=function(e){var t;t=e.nativeSelection,t.anchorNode?(t=P(t,0),e._ranges=[t],e.rangeCount=1,t=e.nativeSelection,e.anchorNode=t.anchorNode,e.anchorOffset=t.anchorOffset,e.focusNode=t.focusNode,e.focusOffset=t.focusOffset,e.isCollapsed=g(e)):r(e)}}I.refresh=function(e){var t=e?this._ranges.slice(0):null;if(M(this),e){if(e=t.length,e!=this._ranges.length)return!1;for(;e--;)if(!w.rangesEqual(t[e],this._ranges[e]))return!1;return!0}};var B=function(e,t){var n=e.getAllRanges(),o=!1;e.removeAllRanges();for(var i=0,a=n.length;a>i;++i)o||t!==n[i]?e.addRange(n[i]):o=!0;e.rangeCount||r(e)};I.removeRange=k?function(e){if("Control"==this.docSelection.type){for(var t,n=this.docSelection.createRange(),e=s(e),o=y.getDocument(n.item(0)),o=y.getBody(o).createControlRange(),i=!1,r=0,a=n.length;a>r;++r)t=n.item(r),t!==e||i?o.add(n.item(r)):i=!0;o.select(),c(this)}else B(this,e)}:function(e){B(this,e)};var V;!S&&_&&e.features.implementsDomRange?(V=function(e){var t=!1;return e.anchorNode&&(t=1==y.comparePoints(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)),t},I.isBackwards=function(){return V(this)}):V=I.isBackwards=function(){return!1},I.toString=function(){for(var e=[],t=0,n=this.rangeCount;n>t;++t)e[t]=""+this._ranges[t];return e.join("")},I.collapse=function(t,n){f(this,t);var o=e.createRange(y.getDocument(t));o.collapseToPoint(t,n),this.removeAllRanges(),this.addRange(o),this.isCollapsed=!0},I.collapseToStart=function(){if(!this.rangeCount)throw new C("INVALID_STATE_ERR");var e=this._ranges[0];this.collapse(e.startContainer,e.startOffset)},I.collapseToEnd=function(){if(!this.rangeCount)throw new C("INVALID_STATE_ERR");var e=this._ranges[this.rangeCount-1];this.collapse(e.endContainer,e.endOffset)},I.selectAllChildren=function(t){f(this,t);var n=e.createRange(y.getDocument(t));n.selectNodeContents(t),this.removeAllRanges(),this.addRange(n)},I.deleteFromDocument=function(){if(k&&x&&"Control"==this.docSelection.type){for(var e,t=this.docSelection.createRange();t.length;)e=t.item(0),t.remove(e),e.parentNode.removeChild(e);this.refresh()}else if(this.rangeCount){t=this.getAllRanges(),this.removeAllRanges(),e=0;for(var n=t.length;n>e;++e)t[e].deleteContents();this.addRange(t[n-1])}},I.getAllRanges=function(){return this._ranges.slice(0)},I.setSingleRange=function(e){this.setRanges([e])},I.containsNode=function(e,t){for(var n=0,o=this._ranges.length;o>n;++n)if(this._ranges[n].containsNode(e,t))return!0;return!1},I.toHtml=function(){var e="";if(this.rangeCount){for(var e=w.getRangeDocument(this._ranges[0]).createElement("div"),t=0,n=this._ranges.length;n>t;++t)e.appendChild(this._ranges[t].cloneContents());e=e.innerHTML}return e},I.getName=function(){return"WrappedSelection"},I.inspect=function(){return m(this)},I.detach=function(){this.win=this.anchorNode=this.focusNode=this.win._rangySelection=null},u.inspect=m,e.Selection=u,e.selectionPrototype=I,e.addCreateMissingNativeApiListener(function(t){"undefined"==typeof t.getSelection&&(t.getSelection=function(){return e.getSelection(this)}),t=null})});var Base=function(){};Base.extend=function(e,t){var n=Base.prototype.extend;Base._prototyping=!0;var o=new this;n.call(o,e),o.base=function(){},delete Base._prototyping;var i=o.constructor,r=o.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==r)this._constructing=!0,i.apply(this,arguments),delete this._constructing;else if(null!=arguments[0])return(arguments[0].extend||n).call(arguments[0],o)};return r.ancestor=this,r.extend=this.extend,r.forEach=this.forEach,r.implement=this.implement,r.prototype=o,r.toString=this.toString,r.valueOf=function(e){return"object"==e?r:i.valueOf()},n.call(r,t),"function"==typeof r.init&&r.init(),r},Base.prototype={extend:function(e,t){if(1<arguments.length){var n=this[e];if(n&&"function"==typeof t&&(!n.valueOf||n.valueOf()!=t.valueOf())&&/\bbase\b/.test(t)){var o=t.valueOf(),t=function(){var e=this.base||Base.prototype.base;this.base=n;var t=o.apply(this,arguments);return this.base=e,t};t.valueOf=function(e){return"object"==e?t:o},t.toString=Base.toString}this[e]=t}else if(e){var i=Base.prototype.extend;!Base._prototyping&&"function"!=typeof this&&(i=this.extend||i);for(var r={toSource:null},a=["constructor","toString","valueOf"],s=Base._prototyping?0:1;l=a[s++];)e[l]!=r[l]&&i.call(this,l,e[l]);for(var l in e)r[l]||i.call(this,l,e[l])}return this}},Base=Base.extend({constructor:function(e){this.extend(e)}},{ancestor:Object,version:"1.1",forEach:function(e,t,n){for(var o in e)void 0===this.prototype[o]&&t.call(n,e[o],o,e)},implement:function(){for(var e=0;e<arguments.length;e++)"function"==typeof arguments[e]?arguments[e](this.prototype):this.prototype.extend(arguments[e]);return this},toString:function(){return""+this.valueOf()}}),wysihtml5.browser=function(){var e=navigator.userAgent,t=document.createElement("div"),n=-1!==e.indexOf("MSIE")&&-1===e.indexOf("Opera"),o=-1!==e.indexOf("Gecko")&&-1===e.indexOf("KHTML"),i=-1!==e.indexOf("AppleWebKit/"),r=-1!==e.indexOf("Chrome/"),a=-1!==e.indexOf("Opera/");return{USER_AGENT:e,supported:function(){var e=this.USER_AGENT.toLowerCase(),n="contentEditable"in t,o=document.execCommand&&document.queryCommandSupported&&document.queryCommandState,i=document.querySelector&&document.querySelectorAll,e=-1!==e.indexOf("opera mobi")||-1!==e.indexOf("hpwos/");return n&&o&&i&&!e},isTouchDevice:function(){return this.supportsEvent("touchmove")},isIos:function(){var e=this.USER_AGENT.toLowerCase();return-1!==e.indexOf("webkit")&&-1!==e.indexOf("mobile")},supportsSandboxedIframes:function(){return n},throwsMixedContentWarningWhenIframeSrcIsEmpty:function(){return!("querySelector"in document)},displaysCaretInEmptyContentEditableCorrectly:function(){return!o},hasCurrentStyleProperty:function(){return"currentStyle"in t},insertsLineBreaksOnReturn:function(){return o},supportsPlaceholderAttributeOn:function(e){return"placeholder"in e},supportsEvent:function(e){var n;return(n="on"+e in t)||(t.setAttribute("on"+e,"return;"),n="function"==typeof t["on"+e]),n},supportsEventsInIframeCorrectly:function(){return!a},firesOnDropOnlyWhenOnDragOverIsCancelled:function(){return i||o},supportsDataTransfer:function(){try{return i&&(window.Clipboard||window.DataTransfer).prototype.getData}catch(e){return!1}},supportsHTML5Tags:function(e){return e=e.createElement("div"),e.innerHTML="<article>foo</article>","<article>foo</article>"===e.innerHTML.toLowerCase()},supportsCommand:function(){var e={formatBlock:n,insertUnorderedList:n||a||i,insertOrderedList:n||a||i},t={insertHTML:o};return function(n,o){if(!e[o]){try{return n.queryCommandSupported(o)}catch(i){}try{return n.queryCommandEnabled(o)}catch(r){return!!t[o]}}return!1}}(),doesAutoLinkingInContentEditable:function(){return n},canDisableAutoLinking:function(){return this.supportsCommand (document,"AutoUrlDetect")},clearsContentEditableCorrectly:function(){return o||a||i},supportsGetAttributeCorrectly:function(){return"1"!=document.createElement("td").getAttribute("rowspan")},canSelectImagesInContentEditable:function(){return o||n||a},clearsListsInContentEditableCorrectly:function(){return o||n||i},autoScrollsToCaret:function(){return!i},autoClosesUnclosedTags:function(){var e,n=t.cloneNode(!1);return n.innerHTML="<p><div></div>",n=n.innerHTML.toLowerCase(),e="<p></p><div></div>"===n||"<p><div></div></p>"===n,this.autoClosesUnclosedTags=function(){return e},e},supportsNativeGetElementsByClassName:function(){return-1!==(""+document.getElementsByClassName).indexOf("[native code]")},supportsSelectionModify:function(){return"getSelection"in window&&"modify"in window.getSelection()},supportsClassList:function(){return"classList"in t},needsSpaceAfterLineBreak:function(){return a},supportsSpeechApiOn:function(t){return 11<=(e.match(/Chrome\/(\d+)/)||[,0])[1]&&("onwebkitspeechchange"in t||"speech"in t)},crashesWhenDefineProperty:function(e){return n&&("XMLHttpRequest"===e||"XDomainRequest"===e)},doesAsyncFocus:function(){return n},hasProblemsSettingCaretAfterImg:function(){return n},hasUndoInContextMenu:function(){return o||r||a}}}(),wysihtml5.lang.array=function(e){return{contains:function(t){if(e.indexOf)return-1!==e.indexOf(t);for(var n=0,o=e.length;o>n;n++)if(e[n]===t)return!0;return!1},without:function(t){for(var t=wysihtml5.lang.array(t),n=[],o=0,i=e.length;i>o;o++)t.contains(e[o])||n.push(e[o]);return n},get:function(){for(var t=0,n=e.length,o=[];n>t;t++)o.push(e[t]);return o}}},wysihtml5.lang.Dispatcher=Base.extend({observe:function(e,t){return this.events=this.events||{},this.events[e]=this.events[e]||[],this.events[e].push(t),this},on:function(){return this.observe.apply(this,wysihtml5.lang.array(arguments).get())},fire:function(e,t){this.events=this.events||{};for(var n=this.events[e]||[],o=0;o<n.length;o++)n[o].call(this,t);return this},stopObserving:function(e,t){this.events=this.events||{};var n,o,i=0;if(e){for(n=this.events[e]||[],o=[];i<n.length;i++)n[i]!==t&&t&&o.push(n[i]);this.events[e]=o}else this.events={};return this}}),wysihtml5.lang.object=function(e){return{merge:function(t){for(var n in t)e[n]=t[n];return this},get:function(){return e},clone:function(){var t,n={};for(t in e)n[t]=e[t];return n},isArray:function(){return"[object Array]"===Object.prototype.toString.call(e)}}},function(){var e=/^\s+/,t=/\s+$/;wysihtml5.lang.string=function(n){return n=""+n,{trim:function(){return n.replace(e,"").replace(t,"")},interpolate:function(e){for(var t in e)n=this.replace("#{"+t+"}").by(e[t]);return n},replace:function(e){return{by:function(t){return n.split(e).join(t)}}}}}}(),function(e){function t(e){return e.replace(i,function(e,t){var n=(t.match(r)||[])[1]||"",o=s[n],t=t.replace(r,"");t.split(o).length>t.split(n).length&&(t+=n,n="");var i=o=t;return t.length>a&&(i=i.substr(0,a)+"..."),"www."===o.substr(0,4)&&(o="http://"+o),'<a href="'+o+'">'+i+"</a>"+n})}function n(r){if(!o.contains(r.nodeName)){if(r.nodeType!==e.TEXT_NODE||!r.data.match(i)){for(s=e.lang.array(r.childNodes).get(),a=s.length,l=0;a>l;l++)n(s[l]);return r}var a,s=r.parentNode;a=s.ownerDocument;var l=a._wysihtml5_tempElement;for(l||(l=a._wysihtml5_tempElement=a.createElement("div")),a=l,a.innerHTML="<span></span>"+t(r.data),a.removeChild(a.firstChild);a.firstChild;)s.insertBefore(a.firstChild,r);s.removeChild(r)}}var o=e.lang.array("CODE PRE A SCRIPT HEAD TITLE STYLE".split(" ")),i=/((https?:\/\/|www\.)[^\s<]{3,})/gi,r=/([^\w\/\-](,?))$/i,a=100,s={")":"(","]":"[","}":"{"};e.dom.autoLink=function(e){var t;e:{t=e;for(var i;t.parentNode;){if(t=t.parentNode,i=t.nodeName,o.contains(i)){t=!0;break e}if("body"===i)break}t=!1}return t?e:(e===e.ownerDocument.documentElement&&(e=e.ownerDocument.body),n(e))},e.dom.autoLink.URL_REG_EXP=i}(wysihtml5),function(e){var t=e.browser.supportsClassList(),n=e.dom;n.addClass=function(e,o){return t?e.classList.add(o):void(n.hasClass(e,o)||(e.className+=" "+o))},n.removeClass=function(e,n){return t?e.classList.remove(n):void(e.className=e.className.replace(RegExp("(^|\\s+)"+n+"(\\s+|$)")," "))},n.hasClass=function(e,n){if(t)return e.classList.contains(n);var o=e.className;return 0<o.length&&(o==n||RegExp("(^|\\s)"+n+"(\\s|$)").test(o))}}(wysihtml5),wysihtml5.dom.contains=function(){var e=document.documentElement;return e.contains?function(e,t){return t.nodeType!==wysihtml5.ELEMENT_NODE&&(t=t.parentNode),e!==t&&e.contains(t)}:e.compareDocumentPosition?function(e,t){return!!(16&e.compareDocumentPosition(t))}:void 0}(),wysihtml5.dom.convertToList=function(){function e(e,t){var n=e.createElement("li");return t.appendChild(n),n}return function(t,n){if("UL"===t.nodeName||"OL"===t.nodeName||"MENU"===t.nodeName)return t;var o,i,r,a,s,l=t.ownerDocument,c=l.createElement(n),d=t.querySelectorAll("br"),u=d.length;for(s=0;u>s;s++)for(o=d[s];(i=o.parentNode)&&i!==t&&i.lastChild===o;){if("block"===wysihtml5.dom.getStyle("display").from(i)){i.removeChild(o);break}wysihtml5.dom.insert(o).after(o.parentNode)}for(d=wysihtml5.lang.array(t.childNodes).get(),u=d.length,s=0;u>s;s++)a=a||e(l,c),o=d[s],i="block"===wysihtml5.dom.getStyle("display").from(o),r="BR"===o.nodeName,i?(a=a.firstChild?e(l,c):a,a.appendChild(o),a=null):r?a=a.firstChild?null:a:a.appendChild(o);return t.parentNode.replaceChild(c,t),c}}(),wysihtml5.dom.copyAttributes=function(e){return{from:function(t){return{to:function(n){for(var o,i=0,r=e.length;r>i;i++)o=e[i],"undefined"!=typeof t[o]&&""!==t[o]&&(n[o]=t[o]);return{andTo:arguments.callee}}}}}},function(e){var t=["-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing"],n=function(n){var o;e:for(var i=0,r=t.length;r>i;i++)if("border-box"===e.getStyle(t[i]).from(n)){o=t[i];break e}return o?parseInt(e.getStyle("width").from(n),10)<n.offsetWidth:!1};e.copyStyles=function(o){return{from:function(i){n(i)&&(o=wysihtml5.lang.array(o).without(t));for(var r,a="",s=o.length,l=0;s>l;l++)r=o[l],a+=r+":"+e.getStyle(r).from(i)+";";return{to:function(t){return e.setStyles(a).on(t),{andTo:arguments.callee}}}}}}}(wysihtml5.dom),function(e){e.dom.delegate=function(t,n,o,i){return e.dom.observe(t,o,function(o){for(var r=o.target,a=e.lang.array(t.querySelectorAll(n));r&&r!==t;){if(a.contains(r)){i.call(r,o);break}r=r.parentNode}})}}(wysihtml5),wysihtml5.dom.getAsDom=function(){var e="abbr article aside audio bdi canvas command datalist details figcaption figure footer header hgroup keygen mark meter nav output progress rp rt ruby svg section source summary time track video wbr".split(" ");return function(t,n){var o,n=n||document;if("object"==typeof t&&t.nodeType)o=n.createElement("div"),o.appendChild(t);else if(wysihtml5.browser.supportsHTML5Tags(n))o=n.createElement("div"),o.innerHTML=t;else{if(o=n,!o._wysihtml5_supportsHTML5Tags){for(var i=0,r=e.length;r>i;i++)o.createElement(e[i]);o._wysihtml5_supportsHTML5Tags=!0}o=n,i=o.createElement("div"),i.style.display="none",o.body.appendChild(i);try{i.innerHTML=t}catch(a){}o.body.removeChild(i),o=i}return o}}(),wysihtml5.dom.getParentElement=function(){function e(e,t){return t&&t.length?"string"==typeof t?e===t:wysihtml5.lang.array(t).contains(e):!0}return function(t,n,o){if(o=o||50,n.className||n.classRegExp){e:{for(var i=n.nodeName,r=n.className,n=n.classRegExp;o--&&t&&"BODY"!==t.nodeName;){var a;if((a=t.nodeType===wysihtml5.ELEMENT_NODE)&&(a=e(t.nodeName,i))){a=r;var s=(t.className||"").match(n)||[];a=a?s[s.length-1]===a:!!s.length}if(a)break e;t=t.parentNode}t=null}return t}e:{for(i=n.nodeName,r=o;r--&&t&&"BODY"!==t.nodeName;){if(e(t.nodeName,i))break e;t=t.parentNode}t=null}return t}}(),wysihtml5.dom.getStyle=function(){function e(e){return e.replace(n,function(e){return e.charAt(1).toUpperCase()})}var t={"float":"styleFloat"in document.createElement("div").style?"styleFloat":"cssFloat"},n=/\-[a-z]/g;return function(n){return{from:function(o){if(o.nodeType===wysihtml5.ELEMENT_NODE){var i=o.ownerDocument,r=t[n]||e(n),a=o.style,s=o.currentStyle,l=a[r];if(l)return l;if(s)try{return s[r]}catch(c){}var d,r=i.defaultView||i.parentWindow,i=("height"===n||"width"===n)&&"TEXTAREA"===o.nodeName;if(r.getComputedStyle)return i&&(d=a.overflow,a.overflow="hidden"),o=r.getComputedStyle(o,null).getPropertyValue(n),i&&(a.overflow=d||""),o}}}}}(),wysihtml5.dom.hasElementWithTagName=function(){var e={},t=1;return function(n,o){var i=(n._wysihtml5_identifier||(n._wysihtml5_identifier=t++))+":"+o,r=e[i];return r||(r=e[i]=n.getElementsByTagName(o)),0<r.length}}(),function(e){var t={},n=1;e.dom.hasElementWithClassName=function(o,i){if(!e.browser.supportsNativeGetElementsByClassName())return!!o.querySelector("."+i);var r=(o._wysihtml5_identifier||(o._wysihtml5_identifier=n++))+":"+i,a=t[r];return a||(a=t[r]=o.getElementsByClassName(i)),0<a.length}}(wysihtml5),wysihtml5.dom.insert=function(e){return{after:function(t){t.parentNode.insertBefore(e,t.nextSibling)},before:function(t){t.parentNode.insertBefore(e,t)},into:function(t){t.appendChild(e)}}},wysihtml5.dom.insertCSS=function(e){return e=e.join("\n"),{into:function(t){var n=t.head||t.getElementsByTagName("head")[0],o=t.createElement("style");o.type="text/css",o.styleSheet?o.styleSheet.cssText=e:o.appendChild(t.createTextNode(e)),n&&n.appendChild(o)}}},wysihtml5.dom.observe=function(e,t,n){for(var o,i,t="string"==typeof t?[t]:t,r=0,a=t.length;a>r;r++)i=t[r],e.addEventListener?e.addEventListener(i,n,!1):(o=function(t){"target"in t||(t.target=t.srcElement),t.preventDefault=t.preventDefault||function(){this.returnValue=!1},t.stopPropagation=t.stopPropagation||function(){this.cancelBubble=!0},n.call(e,t)},e.attachEvent("on"+i,o));return{stop:function(){for(var i,r=0,a=t.length;a>r;r++)i=t[r],e.removeEventListener?e.removeEventListener(i,n,!1):e.detachEvent("on"+i,o)}}},wysihtml5.dom.parse=function(){function e(t,i){var r,a=t.childNodes,s=a.length;r=n[t.nodeType];var l=0;if(r=r&&r(t),!r)return null;for(l=0;s>l;l++)(newChild=e(a[l],i))&&r.appendChild(newChild);return i&&1>=r.childNodes.length&&r.nodeName.toLowerCase()===o&&!r.attributes.length?r.firstChild:r}function t(e,t){var n,t=t.toLowerCase();if((n="IMG"==e.nodeName)&&(n="src"==t)){var o;try{o=e.complete&&!e.mozMatchesSelector(":-moz-broken")}catch(i){e.complete&&"complete"===e.readyState&&(o=!0)}n=!0===o}return n?e.src:s&&"outerHTML"in e?-1!=e.outerHTML.toLowerCase().indexOf(" "+t+"=")?e.getAttribute(t):null:e.getAttribute(t)}var n={1:function(e){var n,r,s=a.tags;if(r=e.nodeName.toLowerCase(),n=e.scopeName,e._wysihtml5)return null;if(e._wysihtml5=1,"wysihtml5-temp"===e.className)return null;if(n&&"HTML"!=n&&(r=n+":"+r),"outerHTML"in e&&!wysihtml5.browser.autoClosesUnclosedTags()&&"P"===e.nodeName&&"</p>"!==e.outerHTML.slice(-4).toLowerCase()&&(r="div"),r in s){if(n=s[r],!n||n.remove)return null;n="string"==typeof n?{rename_tag:n}:n}else{if(!e.firstChild)return null;n={rename_tag:o}}r=e.ownerDocument.createElement(n.rename_tag||r);var s={},d=n.set_class,u=n.add_class,h=n.set_attributes,f=n.check_attributes,m=a.classes,p=0,g=[];n=[];var y,v=[],w=[];if(h&&(s=wysihtml5.lang.object(h).clone()),f)for(y in f)(h=l[f[y]])&&(h=h(t(e,y)),"string"==typeof h&&(s[y]=h));if(d&&g.push(d),u)for(y in u)(h=c[u[y]])&&(d=h(t(e,y)),"string"==typeof d&&g.push(d));for(m["_wysihtml5-temp-placeholder"]=1,(w=e.getAttribute("class"))&&(g=g.concat(w.split(i))),u=g.length;u>p;p++)e=g[p],m[e]&&n.push(e);for(m=n.length;m--;)e=n[m],wysihtml5.lang.array(v).contains(e)||v.unshift(e);v.length&&(s["class"]=v.join(" "));for(y in s)try{r.setAttribute(y,s[y])}catch(b){}return s.src&&("undefined"!=typeof s.width&&r.setAttribute("width",s.width),"undefined"!=typeof s.height&&r.setAttribute("height",s.height)),r},3:function(e){return e.ownerDocument.createTextNode(e.data)}},o="span",i=/\s+/,r={tags:{},classes:{}},a={},s=!wysihtml5.browser.supportsGetAttributeCorrectly(),l={url:function(){var e=/^https?:\/\//i;return function(t){return t&&t.match(e)?t.replace(e,function(e){return e.toLowerCase()}):null}}(),alt:function(){var e=/[^ a-z0-9_\-]/gi;return function(t){return t?t.replace(e,""):""}}(),numbers:function(){var e=/\D/g;return function(t){return(t=(t||"").replace(e,""))||null}}()},c={align_img:function(){var e={left:"wysiwyg-float-left",right:"wysiwyg-float-right"};return function(t){return e[(""+t).toLowerCase()]}}(),align_text:function(){var e={left:"wysiwyg-text-align-left",right:"wysiwyg-text-align-right",center:"wysiwyg-text-align-center",justify:"wysiwyg-text-align-justify"};return function(t){return e[(""+t).toLowerCase()]}}(),clear_br:function(){var e={left:"wysiwyg-clear-left",right:"wysiwyg-clear-right",both:"wysiwyg-clear-both",all:"wysiwyg-clear-both"};return function(t){return e[(""+t).toLowerCase()]}}(),size_font:function(){var e={1:"wysiwyg-font-size-xx-small",2:"wysiwyg-font-size-small",3:"wysiwyg-font-size-medium",4:"wysiwyg-font-size-large",5:"wysiwyg-font-size-x-large",6:"wysiwyg-font-size-xx-large",7:"wysiwyg-font-size-xx-large","-":"wysiwyg-font-size-smaller","+":"wysiwyg-font-size-larger"};return function(t){return e[(""+t).charAt(0)]}}()};return function(t,n,o,i){wysihtml5.lang.object(a).merge(r).merge(n).get();for(var o=o||t.ownerDocument||document,n=o.createDocumentFragment(),s="string"==typeof t,t=s?wysihtml5.dom.getAsDom(t,o):t;t.firstChild;)o=t.firstChild,t.removeChild(o),(o=e(o,i))&&n.appendChild(o);return t.innerHTML="",t.appendChild(n),s?wysihtml5.quirks.getCorrectInnerHTML(t):t}}(),wysihtml5.dom.removeEmptyTextNodes=function(e){for(var t=wysihtml5.lang.array(e.childNodes).get(),n=t.length,o=0;n>o;o++)e=t[o],e.nodeType===wysihtml5.TEXT_NODE&&""===e.data&&e.parentNode.removeChild(e)},wysihtml5.dom.renameElement=function(e,t){for(var n,o=e.ownerDocument.createElement(t);n=e.firstChild;)o.appendChild(n);return wysihtml5.dom.copyAttributes(["align","className"]).from(e).to(o),e.parentNode.replaceChild(o,e),o},wysihtml5.dom.replaceWithChildNodes=function(e){if(e.parentNode)if(e.firstChild){for(var t=e.ownerDocument.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}else e.parentNode.removeChild(e)},function(e){function t(e){var t=e.ownerDocument.createElement("br");e.appendChild(t)}e.resolveList=function(n){if("MENU"===n.nodeName||"UL"===n.nodeName||"OL"===n.nodeName){var o,i,r,a=n.ownerDocument.createDocumentFragment(),s=n.previousElementSibling||n.previousSibling;for(s&&"block"!==e.getStyle("display").from(s)&&t(a);r=n.firstChild;){for(o=r.lastChild;s=r.firstChild;)i=(i=s===o)&&"block"!==e.getStyle("display").from(s)&&"BR"!==s.nodeName,a.appendChild(s),i&&t(a);r.parentNode.removeChild(r)}n.parentNode.replaceChild(a,n)}}}(wysihtml5.dom),function(e){var t=document,n="parent top opener frameElement frames localStorage globalStorage sessionStorage indexedDB".split(" "),o="open close openDialog showModalDialog alert confirm prompt openDatabase postMessage XMLHttpRequest XDomainRequest".split(" "),i=["referrer","write","open","close"];e.dom.Sandbox=Base.extend({constructor:function(t,n){this.callback=t||e.EMPTY_FUNCTION,this.config=e.lang.object({}).merge(n).get(),this.iframe=this._createIframe()},insertInto:function(e){"string"==typeof e&&(e=t.getElementById(e)),e.appendChild(this.iframe)},getIframe:function(){return this.iframe},getWindow:function(){this._readyError()},getDocument:function(){this._readyError()},destroy:function(){var e=this.getIframe();e.parentNode.removeChild(e)},_readyError:function(){throw Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet")},_createIframe:function(){var n=this,o=t.createElement("iframe");return o.className="wysihtml5-sandbox",e.dom.setAttributes({security:"restricted",allowtransparency:"true",frameborder:0,width:0,height:0,marginwidth:0,marginheight:0}).on(o),e.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()&&(o.src="javascript:'<html></html>'"),o.onload=function(){o.onreadystatechange=o.onload=null,n._onLoadIframe(o)},o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=o.onload=null,n._onLoadIframe(o))},o},_onLoadIframe:function(r){if(e.dom.contains(t.documentElement,r)){var a=this,s=r.contentWindow,l=r.contentWindow.document,c=this._getHtml({charset:t.characterSet||t.charset||"utf-8",stylesheets:this.config.stylesheets});if(l.open("text/html","replace"),l.write(c),l.close(),this.getWindow=function(){return r.contentWindow},this.getDocument=function(){return r.contentWindow.document},s.onerror=function(e,t,n){throw Error("wysihtml5.Sandbox: "+e,t,n)},!e.browser.supportsSandboxedIframes()){var d,c=0;for(d=n.length;d>c;c++)this._unset(s,n[c]);for(c=0,d=o.length;d>c;c++)this._unset(s,o[c],e.EMPTY_FUNCTION);for(c=0,d=i.length;d>c;c++)this._unset(l,i[c]);this._unset(l,"cookie","",!0)}this.loaded=!0,setTimeout(function(){a.callback(a)},0)}},_getHtml:function(t){var n,o=t.stylesheets,i="",r=0;if(o="string"==typeof o?[o]:o)for(n=o.length;n>r;r++)i+='<link rel="stylesheet" href="'+o[r]+'">';return t.stylesheets=i,e.lang.string('<!DOCTYPE html><html><head><meta charset="#{charset}">#{stylesheets}</head><body></body></html>').interpolate(t)},_unset:function(t,n,o,i){try{t[n]=o}catch(r){}try{t.__defineGetter__(n,function(){return o})}catch(a){}if(i)try{t.__defineSetter__(n,function(){})}catch(s){}if(!e.browser.crashesWhenDefineProperty(n))try{var l={get:function(){return o}};i&&(l.set=function(){}),Object.defineProperty(t,n,l)}catch(c){}}})}(wysihtml5),function(){var e={className:"class"};wysihtml5.dom.setAttributes=function(t){return{on:function(n){for(var o in t)n.setAttribute(e[o]||o,t[o])}}}}(),wysihtml5.dom.setStyles=function(e){return{on:function(t){if(t=t.style,"string"==typeof e)t.cssText+=";"+e;else for(var n in e)"float"===n?(t.cssFloat=e[n],t.styleFloat=e[n]):t[n]=e[n]}}},function(e){e.simulatePlaceholder=function(t,n,o){var i=function(){n.hasPlaceholderSet()&&n.clear(),e.removeClass(n.element,"placeholder")},r=function(){n.isEmpty()&&(n.setValue(o),e.addClass(n.element,"placeholder"))};t.observe("set_placeholder",r).observe("unset_placeholder",i).observe("focus:composer",i).observe("paste:composer",i).observe("blur:composer",r),r()}}(wysihtml5.dom),function(e){var t=document.documentElement;"textContent"in t?(e.setTextContent=function(e,t){e.textContent=t},e.getTextContent=function(e){return e.textContent}):"innerText"in t?(e.setTextContent=function(e,t){e.innerText=t},e.getTextContent=function(e){return e.innerText}):(e.setTextContent=function(e,t){e.nodeValue=t},e.getTextContent=function(e){return e.nodeValue})}(wysihtml5.dom),wysihtml5.quirks.cleanPastedHTML=function(){var e={"a u":wysihtml5.dom.replaceWithChildNodes};return function(t,n,o){var i,r,a,n=n||e,o=o||t.ownerDocument||document,s="string"==typeof t,l=0,t=s?wysihtml5.dom.getAsDom(t,o):t;for(a in n)for(i=t.querySelectorAll(a),o=n[a],r=i.length;r>l;l++)o(i[l]);return s?t.innerHTML:t}}(),function(e){var t=e.dom;e.quirks.ensureProperClearing=function(){var e=function(){var e=this;setTimeout(function(){var t=e.innerHTML.toLowerCase();("<p>&nbsp;</p>"==t||"<p>&nbsp;</p><p>&nbsp;</p>"==t)&&(e.innerHTML="")},0)};return function(n){t.observe(n.element,["cut","keydown"],e);
}}(),e.quirks.ensureProperClearingOfLists=function(){var n=["OL","UL","MENU"];return function(o){t.observe(o.element,"keydown",function(i){if(i.keyCode===e.BACKSPACE_KEY){var r=o.selection.getSelectedNode(),i=o.element;i.firstChild&&e.lang.array(n).contains(i.firstChild.nodeName)&&(r=t.getParentElement(r,{nodeName:n}))&&r==i.firstChild&&1>=r.childNodes.length&&(r.firstChild?""===r.firstChild.innerHTML:1)&&r.parentNode.removeChild(r)}})}}()}(wysihtml5),function(e){e.quirks.getCorrectInnerHTML=function(t){var n=t.innerHTML;if(-1===n.indexOf("%7E"))return n;var o,i,r,a,t=t.querySelectorAll("[href*='~'], [src*='~']");for(a=0,r=t.length;r>a;a++)o=t[a].href||t[a].src,i=e.lang.string(o).replace("~").by("%7E"),n=e.lang.string(n).replace(i).by(o);return n}}(wysihtml5),function(e){var t=e.dom,n="LI P H1 H2 H3 H4 H5 H6".split(" "),o=["UL","OL","MENU"];e.quirks.insertLineBreakOnReturn=function(i){function r(n){if(n=t.getParentElement(n,{nodeName:["P","DIV"]},2)){var o=document.createTextNode(e.INVISIBLE_SPACE);t.insert(o).before(n),t.replaceWithChildNodes(n),i.selection.selectNode(o)}}t.observe(i.element.ownerDocument,"keydown",function(a){var s=a.keyCode;if(!(a.shiftKey||s!==e.ENTER_KEY&&s!==e.BACKSPACE_KEY)){var l=i.selection.getSelectedNode();(l=t.getParentElement(l,{nodeName:n},4))?"LI"!==l.nodeName||s!==e.ENTER_KEY&&s!==e.BACKSPACE_KEY?l.nodeName.match(/H[1-6]/)&&s===e.ENTER_KEY&&setTimeout(function(){r(i.selection.getSelectedNode())},0):setTimeout(function(){var e,n=i.selection.getSelectedNode();n&&((e=t.getParentElement(n,{nodeName:o},2))||r(n))},0):s===e.ENTER_KEY&&!e.browser.insertsLineBreaksOnReturn()&&(i.commands.exec("insertLineBreak"),a.preventDefault())}})}}(wysihtml5),function(e){e.quirks.redraw=function(t){e.dom.addClass(t,"wysihtml5-quirks-redraw"),e.dom.removeClass(t,"wysihtml5-quirks-redraw");try{var n=t.ownerDocument;n.execCommand ("italic",!1,null),n.execCommand ("italic",!1,null)}catch(o){}}}(wysihtml5),function(e){var t=e.dom;e.Selection=Base.extend({constructor:function(e){window.rangy.init(),this.editor=e,this.composer=e.composer,this.doc=this.composer.doc},getBookmark:function(){var e=this.getRange();return e&&e.cloneRange()},setBookmark:function(e){e&&this.setSelection(e)},setBefore:function(e){var t=rangy.createRange(this.doc);return t.setStartBefore(e),t.setEndBefore(e),this.setSelection(t)},setAfter:function(e){var t=rangy.createRange(this.doc);return t.setStartAfter(e),t.setEndAfter(e),this.setSelection(t)},selectNode:function(n){var o=rangy.createRange(this.doc),i=n.nodeType===e.ELEMENT_NODE,r="canHaveHTML"in n?n.canHaveHTML:"IMG"!==n.nodeName,a=i?n.innerHTML:n.data,a=""===a||a===e.INVISIBLE_SPACE,s=t.getStyle("display").from(n),s="block"===s||"list-item"===s;if(a&&i&&r)try{n.innerHTML=e.INVISIBLE_SPACE}catch(l){}r?o.selectNodeContents(n):o.selectNode(n),r&&a&&i?o.collapse(s):r&&a&&(o.setStartAfter(n),o.setEndAfter(n)),this.setSelection(o)},getSelectedNode:function(e){return e&&this.doc.selection&&"Control"===this.doc.selection.type&&(e=this.doc.selection.createRange())&&e.length?e.item(0):(e=this.getSelection(this.doc),e.focusNode===e.anchorNode?e.focusNode:(e=this.getRange(this.doc))?e.commonAncestorContainer:this.doc.body)},executeAndRestore:function(t,n){var o=this.doc.body,i=n&&o.scrollTop,r=n&&o.scrollLeft,a='<span class="_wysihtml5-temp-placeholder">'+e.INVISIBLE_SPACE+"</span>",s=this.getRange(this.doc);if(s){a=s.createContextualFragment(a),s.insertNode(a);try{t(s.startContainer,s.endContainer)}catch(l){setTimeout(function(){throw l},0)}(caretPlaceholder=this.doc.querySelector("._wysihtml5-temp-placeholder"))?(s=rangy.createRange(this.doc),s.selectNode(caretPlaceholder),s.deleteContents(),this.setSelection(s)):o.focus(),n&&(o.scrollTop=i,o.scrollLeft=r);try{caretPlaceholder.parentNode.removeChild(caretPlaceholder)}catch(c){}}else t(o,o)},executeAndRestoreSimple:function(e){var t,n,o,i=this.getRange(),r=this.doc.body;if(i){t=i.getNodes([3]),r=t[0]||i.startContainer,o=t[t.length-1]||i.endContainer,t=r===i.startContainer?i.startOffset:0,n=o===i.endContainer?i.endOffset:o.length;try{e(i.startContainer,i.endContainer)}catch(a){setTimeout(function(){throw a},0)}e=rangy.createRange(this.doc);try{e.setStart(r,t)}catch(s){}try{e.setEnd(o,n)}catch(l){}try{this.setSelection(e)}catch(c){}}else e(r,r)},insertHTML:function(e){var e=rangy.createRange(this.doc).createContextualFragment(e),t=e.lastChild;this.insertNode(e),t&&this.setAfter(t)},insertNode:function(e){var t=this.getRange();t&&t.insertNode(e)},surround:function(e){var t=this.getRange();if(t)try{t.surroundContents(e),this.selectNode(e)}catch(n){e.appendChild(t.extractContents()),t.insertNode(e)}},scrollIntoView:function(){var t,n=this.doc,o=n.documentElement.scrollHeight>n.documentElement.offsetHeight;if((t=n._wysihtml5ScrollIntoViewElement)||(t=n.createElement("span"),t.innerHTML=e.INVISIBLE_SPACE),t=n._wysihtml5ScrollIntoViewElement=t,o){this.insertNode(t);var o=t,i=0;if(o.parentNode)do i+=o.offsetTop||0,o=o.offsetParent;while(o);o=i,t.parentNode.removeChild(t),o>n.body.scrollTop&&(n.body.scrollTop=o)}},selectLine:function(){e.browser.supportsSelectionModify()?this._selectLine_W3C():this.doc.selection&&this._selectLine_MSIE()},_selectLine_W3C:function(){var e=this.doc.defaultView.getSelection();e.modify("extend","left","lineboundary"),e.modify("extend","right","lineboundary")},_selectLine_MSIE:function(){var e,t=this.doc.selection.createRange(),n=t.boundingTop,o=this.doc.body.scrollWidth;if(t.moveToPoint){for(0===n&&(e=this.doc.createElement("span"),this.insertNode(e),n=e.offsetTop,e.parentNode.removeChild(e)),n+=1,e=-10;o>e;e+=2)try{t.moveToPoint(e,n);break}catch(i){}for(e=this.doc.selection.createRange();o>=0;o--)try{e.moveToPoint(o,n);break}catch(r){}t.setEndPoint("EndToEnd",e),t.select()}},getText:function(){var e=this.getSelection();return e?e.toString():""},getNodes:function(e,t){var n=this.getRange();return n?n.getNodes([e],t):[]},getRange:function(){var e=this.getSelection();return e&&e.rangeCount&&e.getRangeAt(0)},getSelection:function(){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow)},setSelection:function(e){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow).setSingleRange(e)}})}(wysihtml5),function(e,t){function n(e,n){return t.dom.isCharacterDataNode(e)?0==n?!!e.previousSibling:n==e.length?!!e.nextSibling:!0:n>0&&n<e.childNodes.length}function o(e,n,i){var r;if(t.dom.isCharacterDataNode(n)&&(0==i?(i=t.dom.getNodeIndex(n),n=n.parentNode):i==n.length?(i=t.dom.getNodeIndex(n)+1,n=n.parentNode):r=t.dom.splitDataNode(n,i)),!r){r=n.cloneNode(!1),r.id&&r.removeAttribute("id");for(var a;a=n.childNodes[i];)r.appendChild(a);t.dom.insertAfter(r,n)}return n==e?r:o(e,r.parentNode,t.dom.getNodeIndex(r))}function i(t){this.firstTextNode=(this.isElementMerge=t.nodeType==e.ELEMENT_NODE)?t.lastChild:t,this.textNodes=[this.firstTextNode]}function r(e,t,n,o){this.tagNames=e||[a],this.cssClass=t||"",this.similarClassRegExp=n,this.normalize=o,this.applyToAnyTagName=!1}var a="span",s=/\s+/g;i.prototype={doMerge:function(){for(var e,t,n=[],o=0,i=this.textNodes.length;i>o;++o)e=this.textNodes[o],t=e.parentNode,n[o]=e.data,o&&(t.removeChild(e),t.hasChildNodes()||t.parentNode.removeChild(t));return this.firstTextNode.data=n=n.join("")},getLength:function(){for(var e=this.textNodes.length,t=0;e--;)t+=this.textNodes[e].length;return t},toString:function(){for(var e=[],t=0,n=this.textNodes.length;n>t;++t)e[t]="'"+this.textNodes[t].data+"'";return"[Merge("+e.join(",")+")]"}},r.prototype={getAncestorWithClass:function(n){for(var o;n;){if(this.cssClass)if(o=this.cssClass,n.className){var i=n.className.match(this.similarClassRegExp)||[];o=i[i.length-1]===o}else o=!1;else o=!0;if(n.nodeType==e.ELEMENT_NODE&&t.dom.arrayContains(this.tagNames,n.tagName.toLowerCase())&&o)return n;n=n.parentNode}return!1},postApply:function(e,t){for(var n,o,r,a=e[0],s=e[e.length-1],l=[],c=a,d=s,u=0,h=s.length,f=0,m=e.length;m>f;++f)o=e[f],(r=this.getAdjacentMergeableTextNode(o.parentNode,!1))?(n||(n=new i(r),l.push(n)),n.textNodes.push(o),o===a&&(c=n.firstTextNode,u=c.length),o===s&&(d=n.firstTextNode,h=n.getLength())):n=null;if((a=this.getAdjacentMergeableTextNode(s.parentNode,!0))&&(n||(n=new i(s),l.push(n)),n.textNodes.push(a)),l.length){for(f=0,m=l.length;m>f;++f)l[f].doMerge();t.setStart(c,u),t.setEnd(d,h)}},getAdjacentMergeableTextNode:function(t,n){var o=t.nodeType==e.TEXT_NODE,i=o?t.parentNode:t,r=n?"nextSibling":"previousSibling";if(o){if((o=t[r])&&o.nodeType==e.TEXT_NODE)return o}else if((o=i[r])&&this.areElementsMergeable(t,o))return o[n?"firstChild":"lastChild"];return null},areElementsMergeable:function(e,n){var o;if((o=t.dom.arrayContains(this.tagNames,(e.tagName||"").toLowerCase()))&&(o=t.dom.arrayContains(this.tagNames,(n.tagName||"").toLowerCase()))&&(o=e.className.replace(s," ")==n.className.replace(s," ")))e:if(e.attributes.length!=n.attributes.length)o=!1;else{o=0;for(var i,r,a=e.attributes.length;a>o;++o)if(i=e.attributes[o],r=i.name,"class"!=r&&(r=n.attributes.getNamedItem(r),i.specified!=r.specified||i.specified&&i.nodeValue!==r.nodeValue)){o=!1;break e}o=!0}return o},createContainer:function(e){return e=e.createElement(this.tagNames[0]),this.cssClass&&(e.className=this.cssClass),e},applyToTextNode:function(e){var n=e.parentNode;1==n.childNodes.length&&t.dom.arrayContains(this.tagNames,n.tagName.toLowerCase())?this.cssClass&&(e=this.cssClass,n.className?(n.className&&(n.className=n.className.replace(this.similarClassRegExp,"")),n.className+=" "+e):n.className=e):(n=this.createContainer(t.dom.getDocument(e)),e.parentNode.insertBefore(n,e),n.appendChild(e))},isRemovable:function(n){return t.dom.arrayContains(this.tagNames,n.tagName.toLowerCase())&&e.lang.string(n.className).trim()==this.cssClass},undoToTextNode:function(e,t,i){if(t.containsNode(i)||(e=t.cloneRange(),e.selectNode(i),e.isPointInRange(t.endContainer,t.endOffset)&&n(t.endContainer,t.endOffset)&&(o(i,t.endContainer,t.endOffset),t.setEndAfter(i)),e.isPointInRange(t.startContainer,t.startOffset)&&n(t.startContainer,t.startOffset)&&(i=o(i,t.startContainer,t.startOffset))),this.similarClassRegExp&&i.className&&(i.className=i.className.replace(this.similarClassRegExp,"")),this.isRemovable(i)){for(t=i,i=t.parentNode;t.firstChild;)i.insertBefore(t.firstChild,t);i.removeChild(t)}},applyToRange:function(t){var n=t.getNodes([e.TEXT_NODE]);if(!n.length)try{var o=this.createContainer(t.endContainer.ownerDocument);return t.surroundContents(o),void this.selectNode(t,o)}catch(i){}if(t.splitBoundaries(),n=t.getNodes([e.TEXT_NODE]),n.length){for(var r=0,a=n.length;a>r;++r)o=n[r],this.getAncestorWithClass(o)||this.applyToTextNode(o);t.setStart(n[0],0),o=n[n.length-1],t.setEnd(o,o.length),this.normalize&&this.postApply(n,t)}},undoToRange:function(t){var n,o,i=t.getNodes([e.TEXT_NODE]);i.length?(t.splitBoundaries(),i=t.getNodes([e.TEXT_NODE])):(i=t.endContainer.ownerDocument.createTextNode(e.INVISIBLE_SPACE),t.insertNode(i),t.selectNode(i),i=[i]);for(var r=0,a=i.length;a>r;++r)n=i[r],(o=this.getAncestorWithClass(n))&&this.undoToTextNode(n,t,o);1==a?this.selectNode(t,i[0]):(t.setStart(i[0],0),n=i[i.length-1],t.setEnd(n,n.length),this.normalize&&this.postApply(i,t))},selectNode:function(t,n){var o=n.nodeType===e.ELEMENT_NODE,i="canHaveHTML"in n?n.canHaveHTML:!0,r=o?n.innerHTML:n.data;if((r=""===r||r===e.INVISIBLE_SPACE)&&o&&i)try{n.innerHTML=e.INVISIBLE_SPACE}catch(a){}t.selectNodeContents(n),r&&o?t.collapse(!1):r&&(t.setStartAfter(n),t.setEndAfter(n))},getTextSelectedByRange:function(e,t){var n=t.cloneRange();n.selectNodeContents(e);var o=n.intersection(t),o=o?o.toString():"";return n.detach(),o},isAppliedToRange:function(t){var n,o=[],i=t.getNodes([e.TEXT_NODE]);if(!i.length)return(n=this.getAncestorWithClass(t.startContainer))?[n]:!1;for(var r,a=0,s=i.length;s>a;++a){if(r=this.getTextSelectedByRange(i[a],t),n=this.getAncestorWithClass(i[a]),""!=r&&!n)return!1;o.push(n)}return o},toggleRange:function(e){this.isAppliedToRange(e)?this.undoToRange(e):this.applyToRange(e)}},e.selection.HTMLApplier=r}(wysihtml5,rangy),wysihtml5.Commands=Base.extend({constructor:function(e){this.editor=e,this.composer=e.composer,this.doc=this.composer.doc},support:function(e){return wysihtml5.browser.supportsCommand (this.doc,e)},exec:function(e,t){var n=wysihtml5.commands[e],o=wysihtml5.lang.array(arguments).get(),i=n&&n.exec,r=null;if(this.editor.fire("beforecommand:composer"),i)o.unshift(this.composer),r=i.apply(n,o);else try{r=this.doc.execCommand (e,!1,t)}catch(a){}return this.editor.fire("aftercommand:composer"),r},state:function(e){var t=wysihtml5.commands[e],n=wysihtml5.lang.array(arguments).get(),o=t&&t.state;if(o)return n.unshift(this.composer),o.apply(t,n);try{return this.doc.queryCommandState(e)}catch(i){return!1}},value:function(e){var t=wysihtml5.commands[e],n=t&&t.value;if(n)return n.call(t,this.composer,e);try{return this.doc.queryCommandValue(e)}catch(o){return null}}}),function(e){e.commands.bold={exec:function(t,n){return e.commands.formatInline.exec(t,n,"b")},state:function(t,n){return e.commands.formatInline.state(t,n,"b")},value:function(){}}}(wysihtml5),function(e){function t(t,r){var a,s,l,c=t.doc,d="_wysihtml5-temp-"+ +new Date,u=0;for(e.commands.formatInline.exec(t,n,o,d,/non-matching-class/g),a=c.querySelectorAll(o+"."+d),d=a.length;d>u;u++)for(l in s=a[u],s.removeAttribute("class"),r)s.setAttribute(l,r[l]);u=s,1===d&&(l=i.getTextContent(s),d=!!s.querySelector("*"),l=""===l||l===e.INVISIBLE_SPACE,!d&&l&&(i.setTextContent(s,r.text||s.href),c=c.createTextNode(" "),t.selection.setAfter(s),t.selection.insertNode(c),u=c)),t.selection.setAfter(u)}var n,o="A",i=e.dom;e.commands.createLink={exec:function(e,n,o){var r=this.state(e,n);r?e.selection.executeAndRestore(function(){for(var e,t,n,o=r.length,a=0;o>a;a++)e=r[a],t=i.getParentElement(e,{nodeName:"code"}),n=i.getTextContent(e),n.match(i.autoLink.URL_REG_EXP)&&!t?i.renameElement(e,"code"):i.replaceWithChildNodes(e)}):(o="object"==typeof o?o:{href:o},t(e,o))},state:function(t,n){return e.commands.formatInline.state(t,n,"A")},value:function(){return n}}}(wysihtml5),function(e){var t=/wysiwyg-font-size-[a-z\-]+/g;e.commands.fontSize={exec:function(n,o,i){return e.commands.formatInline.exec(n,o,"span","wysiwyg-font-size-"+i,t)},state:function(n,o,i){return e.commands.formatInline.state(n,o,"span","wysiwyg-font-size-"+i,t)},value:function(){}}}(wysihtml5),function(e){var t=/wysiwyg-color-[a-z]+/g;e.commands.foreColor={exec:function(n,o,i){return e.commands.formatInline.exec(n,o,"span","wysiwyg-color-"+i,t)},state:function(n,o,i){return e.commands.formatInline.state(n,o,"span","wysiwyg-color-"+i,t)},value:function(){}}}(wysihtml5),function(e){function t(t){for(t=t.previousSibling;t&&t.nodeType===e.TEXT_NODE&&!e.lang.string(t.data).trim();)t=t.previousSibling;return t}function n(t){for(t=t.nextSibling;t&&t.nodeType===e.TEXT_NODE&&!e.lang.string(t.data).trim();)t=t.nextSibling;return t}function o(e){return"BR"===e.nodeName||"block"===a.getStyle("display").from(e)?!0:!1}function i(t,n,o,i){if(i)var r=a.observe(t,"DOMNodeInserted",function(t){var n,t=t.target;t.nodeType===e.ELEMENT_NODE&&(n=a.getStyle("display").from(t),"inline"!==n.substr(0,6)&&(t.className+=" "+i))});t.execCommand (n,!1,o),r&&r.stop()}function r(e,o){e.selection.selectLine(),e.selection.surround(o);var i=n(o),r=t(o);i&&"BR"===i.nodeName&&i.parentNode.removeChild(i),r&&"BR"===r.nodeName&&r.parentNode.removeChild(r),(i=o.lastChild)&&"BR"===i.nodeName&&i.parentNode.removeChild(i),e.selection.selectNode(o)}var a=e.dom,s="H1 H2 H3 H4 H5 H6 P BLOCKQUOTE DIV".split(" ");e.commands.formatBlock={exec:function(l,c,d,u,h){var f,m=l.doc,p=this.state(l,c,d,u,h),d="string"==typeof d?d.toUpperCase():d;if(p)l.selection.executeAndRestoreSimple(function(){h&&(p.className=p.className.replace(h,""));var i=!!e.lang.string(p.className).trim();if(i||p.nodeName!==(d||"DIV"))i&&a.renameElement(p,"DIV");else{var i=p,r=i.ownerDocument,s=n(i),l=t(i);s&&!o(s)&&i.parentNode.insertBefore(r.createElement("br"),s),l&&!o(l)&&i.parentNode.insertBefore(r.createElement("br"),i),a.replaceWithChildNodes(p)}});else{if((null===d||e.lang.array(s).contains(d))&&(f=l.selection.getSelectedNode(),p=a.getParentElement(f,{nodeName:s})))return void l.selection.executeAndRestoreSimple(function(){if(d&&(p=a.renameElement(p,d)),u){var e=p;e.className?(e.className=e.className.replace(h,""),e.className+=" "+u):e.className=u}});l.commands.support(c)?i(m,c,d||"DIV",u):(p=m.createElement(d||"DIV"),u&&(p.className=u),r(l,p))}},state:function(e,t,n,o,i){return n="string"==typeof n?n.toUpperCase():n,e=e.selection.getSelectedNode(),a.getParentElement(e,{nodeName:n,className:o,classRegExp:i})},value:function(){}}}(wysihtml5),function(e){function t(t,i,r){var a=t+":"+i;if(!o[a]){var s=o,l=e.selection.HTMLApplier,c=n[t],t=c?[t.toLowerCase(),c.toLowerCase()]:[t.toLowerCase()];s[a]=new l(t,i,r,!0)}return o[a]}var n={strong:"b",em:"i",b:"strong",i:"em"},o={};e.commands.formatInline={exec:function(e,n,o,i,r){return(n=e.selection.getRange())?(t(o,i,r).toggleRange(n),void e.selection.setSelection(n)):!1},state:function(o,i,r,a,s){var i=o.doc,l=n[r]||r;return!e.dom.hasElementWithTagName(i,r)&&!e.dom.hasElementWithTagName(i,l)||a&&!e.dom.hasElementWithClassName(i,a)?!1:(o=o.selection.getRange(),o?t(r,a,s).isAppliedToRange(o):!1)},value:function(){}}}(wysihtml5),function(e){e.commands.insertHTML={exec:function(e,t,n){e.commands.support(t)?e.doc.execCommand (t,!1,n):e.selection.insertHTML(n)},state:function(){return!1},value:function(){}}}(wysihtml5),function(e){e.commands.insertImage={exec:function(t,n,o){var i,o="object"==typeof o?o:{src:o},r=t.doc,n=this.state(t);if(n)t.selection.setBefore(n),o=n.parentNode,o.removeChild(n),e.dom.removeEmptyTextNodes(o),"A"===o.nodeName&&!o.firstChild&&(t.selection.setAfter(o),o.parentNode.removeChild(o)),e.quirks.redraw(t.element);else{n=r.createElement("IMG");for(i in o)n[i]=o[i];t.selection.insertNode(n),e.browser.hasProblemsSettingCaretAfterImg()?(o=r.createTextNode(e.INVISIBLE_SPACE),t.selection.insertNode(o),t.selection.setAfter(o)):t.selection.setAfter(n)}},state:function(t){var n;return e.dom.hasElementWithTagName(t.doc,"IMG")&&(n=t.selection.getSelectedNode())?"IMG"===n.nodeName?n:n.nodeType!==e.ELEMENT_NODE?!1:(n=t.selection.getText(),(n=e.lang.string(n).trim())?!1:(t=t.selection.getNodes(e.ELEMENT_NODE,function(e){return"IMG"===e.nodeName}),1!==t.length?!1:t[0])):!1},value:function(e){return(e=this.state(e))&&e.src}}}(wysihtml5),function(e){var t="<br>"+(e.browser.needsSpaceAfterLineBreak()?" ":"");e.commands.insertLineBreak={exec:function(n,o){n.commands.support(o)?(n.doc.execCommand (o,!1,null),e.browser.autoScrollsToCaret()||n.selection.scrollIntoView()):n.commands.exec("insertHTML",t)},state:function(){return!1},value:function(){}}}(wysihtml5),function(e){e.commands.insertOrderedList={exec:function(t,n){var o,i=t.doc,r=t.selection.getSelectedNode(),a=e.dom.getParentElement(r,{nodeName:"OL"}),s=e.dom.getParentElement(r,{nodeName:"UL"}),r="_wysihtml5-temp-"+(new Date).getTime();t.commands.support(n)?i.execCommand (n,!1,null):a?t.selection.executeAndRestoreSimple(function(){e.dom.resolveList(a)}):s?t.selection.executeAndRestoreSimple(function(){e.dom.renameElement(s,"ol")}):(t.commands.exec("formatBlock","div",r),o=i.querySelector("."+r),i=""===o.innerHTML||o.innerHTML===e.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){a=e.dom.convertToList(o,"ol")}),i&&t.selection.selectNode(a.querySelector("li")))},state:function(t){return t=t.selection.getSelectedNode(),e.dom.getParentElement(t,{nodeName:"OL"})},value:function(){}}}(wysihtml5),function(e){e.commands.insertUnorderedList={exec:function(t,n){var o,i=t.doc,r=t.selection.getSelectedNode(),a=e.dom.getParentElement(r,{nodeName:"UL"}),s=e.dom.getParentElement(r,{nodeName:"OL"}),r="_wysihtml5-temp-"+(new Date).getTime();t.commands.support(n)?i.execCommand (n,!1,null):a?t.selection.executeAndRestoreSimple(function(){e.dom.resolveList(a)}):s?t.selection.executeAndRestoreSimple(function(){e.dom.renameElement(s,"ul")}):(t.commands.exec("formatBlock","div",r),o=i.querySelector("."+r),i=""===o.innerHTML||o.innerHTML===e.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){a=e.dom.convertToList(o,"ul")}),i&&t.selection.selectNode(a.querySelector("li")))},state:function(t){return t=t.selection.getSelectedNode(),e.dom.getParentElement(t,{nodeName:"UL"})},value:function(){}}}(wysihtml5),function(e){e.commands.italic={exec:function(t,n){return e.commands.formatInline.exec(t,n,"i")},state:function(t,n){return e.commands.formatInline.state(t,n,"i")},value:function(){}}}(wysihtml5),function(e){var t=/text-[a-z]+/g;e.commands.alignCenter={exec:function(n){return e.commands.formatBlock.exec(n,"formatBlock",null,"text-center",t)},state:function(n){return e.commands.formatBlock.state(n,"formatBlock",null,"text-center",t)},value:function(){}}}(wysihtml5),function(e){var t=/text-[a-z]+/g;e.commands.alignLeft={exec:function(n){return e.commands.formatBlock.exec(n,"formatBlock",null,"text-left",t)},state:function(n){return e.commands.formatBlock.state(n,"formatBlock",null,"text-left",t)},value:function(){}}}(wysihtml5),function(e){var t=/text-[a-z]+/g;e.commands.alignRight={exec:function(n){return e.commands.formatBlock.exec(n,"formatBlock",null,"text-right",t)},state:function(n){return e.commands.formatBlock.state(n,"formatBlock",null,"text-right",t)},value:function(){}}}(wysihtml5),function(e){var t=/text-[a-z]+/g;e.commands.alignJustify={exec:function(n){return e.commands.formatBlock.exec(n,"formatBlock",null,"text-justify",t)},state:function(n){return e.commands.formatBlock.state(n,"formatBlock",null,"text-justify",t)},value:function(){}}}(wysihtml5),function(e){e.commands.underline={exec:function(t,n){return e.commands.formatInline.exec(t,n,"u")},state:function(t,n){return e.commands.formatInline.state(t,n,"u")},value:function(){}}}(wysihtml5),function(e){var t='<span id="_wysihtml5-undo" class="_wysihtml5-temp">'+e.INVISIBLE_SPACE+"</span>",n='<span id="_wysihtml5-redo" class="_wysihtml5-temp">'+e.INVISIBLE_SPACE+"</span>",o=e.dom;e.UndoManager=e.lang.Dispatcher.extend({constructor:function(e){this.editor=e,this.composer=e.composer,this.element=this.composer.element,this.history=[this.composer.getValue()],this.position=1,this.composer.commands.support("insertHTML")&&this._observe()},_observe:function(){var i,r=this,a=this.composer.sandbox.getDocument();if(o.observe(this.element,"keydown",function(e){if(!e.altKey&&(e.ctrlKey||e.metaKey)){var t=e.keyCode,n=90===t&&e.shiftKey||89===t;90!==t||e.shiftKey?n&&(r.redo(),e.preventDefault()):(r.undo(),e.preventDefault())}}),o.observe(this.element,"keydown",function(e){e=e.keyCode,e!==i&&(i=e,(8===e||46===e)&&r.transact())}),e.browser.hasUndoInContextMenu()){var s,l,c=function(){for(var e;e=a.querySelector("._wysihtml5-temp");)e.parentNode.removeChild(e);clearInterval(s)};o.observe(this.element,"contextmenu",function(){c(),r.composer.selection.executeAndRestoreSimple(function(){r.element.lastChild&&r.composer.selection.setAfter(r.element.lastChild),a.execCommand ("insertHTML",!1,t),a.execCommand ("insertHTML",!1,n),a.execCommand ("undo",!1,null)}),s=setInterval(function(){a.getElementById("_wysihtml5-redo")?(c(),r.redo()):a.getElementById("_wysihtml5-undo")||(c(),r.undo())},400),l||(l=!0,o.observe(document,"mousedown",c),o.observe(a,["mousedown","paste","cut","copy"],c))})}this.editor.observe("newword:composer",function(){r.transact()}).observe("beforecommand:composer",function(){r.transact()})},transact:function(){var e=this.history[this.position-1],t=this.composer.getValue();t!=e&&(40<(this.history.length=this.position)&&(this.history.shift(),this.position--),this.position++,this.history.push(t))},undo:function(){this.transact(),1>=this.position||(this.set(this.history[--this.position-1]),this.editor.fire("undo:composer"))},redo:function(){this.position>=this.history.length||(this.set(this.history[++this.position-1]),this.editor.fire("redo:composer"))},set:function(e){this.composer.setValue(e),this.editor.focus(!0)}})}(wysihtml5),wysihtml5.views.View=Base.extend({constructor:function(e,t,n){this.parent=e,this.element=t,this.config=n,this._observeViewChange()},_observeViewChange:function(){var e=this;this.parent.observe("beforeload",function(){e.parent.observe("change_view",function(t){t===e.name?(e.parent.currentView=e,e.show(),setTimeout(function(){e.focus()},0)):e.hide()})})},focus:function(){if(this.element.ownerDocument.querySelector(":focus")!==this.element)try{this.element.focus()}catch(e){}},hide:function(){this.element.style.display="none"},show:function(){this.element.style.display=""},disable:function(){this.element.setAttribute("disabled","disabled")},enable:function(){this.element.removeAttribute("disabled")}}),function(e){var t=e.dom,n=e.browser;e.views.Composer=e.views.View.extend({name:"composer",CARET_HACK:"<br>",constructor:function(e,t,n){this.base(e,t,n),this.textarea=this.parent.textarea,this._initSandbox()},clear:function(){this.element.innerHTML=n.displaysCaretInEmptyContentEditableCorrectly()?"":this.CARET_HACK},getValue:function(t){var n=this.isEmpty()?"":e.quirks.getCorrectInnerHTML(this.element);return t&&(n=this.parent.parse(n)),n=e.lang.string(n).replace(e.INVISIBLE_SPACE).by("")},setValue:function(e,t){t&&(e=this.parent.parse(e)),this.element.innerHTML=e},show:function(){this.iframe.style.display=this._displayStyle||"",this.disable(),this.enable()},hide:function(){this._displayStyle=t.getStyle("display").from(this.iframe),"none"===this._displayStyle&&(this._displayStyle=null),this.iframe.style.display="none"},disable:function(){this.element.removeAttribute("contentEditable"),this.base()},enable:function(){this.element.setAttribute("contentEditable","true"),this.base()},focus:function(t){e.browser.doesAsyncFocus()&&this.hasPlaceholderSet()&&this.clear(),this.base();var n=this.element.lastChild;t&&n&&("BR"===n.nodeName?this.selection.setBefore(this.element.lastChild):this.selection.setAfter(this.element.lastChild))},getTextContent:function(){return t.getTextContent(this.element)},hasPlaceholderSet:function(){return this.getTextContent()==this.textarea.element.getAttribute("placeholder")},isEmpty:function(){var e=this.element.innerHTML;return""===e||e===this.CARET_HACK||this.hasPlaceholderSet()||""===this.getTextContent()&&!this.element.querySelector("blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea")},_initSandbox:function(){var e=this;this.sandbox=new t.Sandbox(function(){e._create()},{stylesheets:this.config.stylesheets}),this.iframe=this.sandbox.getIframe();var n=document.createElement("input");n.type="hidden",n.name="_wysihtml5_mode",n.value=1;var o=this.textarea.element;t.insert(this.iframe).after(o),t.insert(n).after(o)},_create:function(){var o=this;this.doc=this.sandbox.getDocument(),this.element=this.doc.body,this.textarea=this.parent.textarea,this.element.innerHTML=this.textarea.getValue(!0),this.enable(),this.selection=new e.Selection(this.parent),this.commands=new e.Commands(this.parent),t.copyAttributes("className spellcheck title lang dir accessKey".split(" ")).from(this.textarea.element).to(this.element),t.addClass(this.element,this.config.composerClassName),this.config.style&&this.style(),this.observe();var i=this.config.name;i&&(t.addClass(this.element,i),t.addClass(this.iframe,i)),(i="string"==typeof this.config.placeholder?this.config.placeholder:this.textarea.element.getAttribute("placeholder"))&&t.simulatePlaceholder(this.parent,this,i),this.commands.exec("styleWithCSS",!1),this._initAutoLinking(),this._initObjectResizing(),this._initUndoManager(),(this.textarea.element.hasAttribute("autofocus")||document.querySelector(":focus")==this.textarea.element)&&setTimeout(function(){o.focus()},100),e.quirks.insertLineBreakOnReturn(this),n.clearsContentEditableCorrectly()||e.quirks.ensureProperClearing(this),n.clearsListsInContentEditableCorrectly()||e.quirks.ensureProperClearingOfLists(this),this.initSync&&this.config.sync&&this.initSync(),this.textarea.hide(),this.parent.fire("beforeload").fire("load")},_initAutoLinking:function(){var o=this,i=n.canDisableAutoLinking(),r=n.doesAutoLinkingInContentEditable();if(i&&this.commands.exec("autoUrlDetect",!1),this.config.autoLink){(!r||r&&i)&&this.parent.observe("newword:composer",function(){o.selection.executeAndRestore(function(e,n){t.autoLink(n.parentNode)})});var a=this.sandbox.getDocument().getElementsByTagName("a"),s=t.autoLink.URL_REG_EXP,l=function(n){return n=e.lang.string(t.getTextContent(n)).trim(),"www."===n.substr(0,4)&&(n="http://"+n),n};t.observe(this.element,"keydown",function(e){if(a.length){var n,e=o.selection.getSelectedNode(e.target.ownerDocument),i=t.getParentElement(e,{nodeName:"A"},4);i&&(n=l(i),setTimeout(function(){var e=l(i);e!==n&&e.match(s)&&i.setAttribute("href",e)},0))}})}},_initObjectResizing:function(){var o=["width","height"],i=o.length,r=this.element;this.commands.exec("enableObjectResizing",this.config.allowObjectResizing),this.config.allowObjectResizing?n.supportsEvent("resizeend")&&t.observe(r,"resizeend",function(t){for(var n,t=t.target||t.srcElement,a=t.style,s=0;i>s;s++)n=o[s],a[n]&&(t.setAttribute(n,parseInt(a[n],10)),a[n]="");e.quirks.redraw(r)}):n.supportsEvent("resizestart")&&t.observe(r,"resizestart",function(e){e.preventDefault()})},_initUndoManager:function(){new e.UndoManager(this.parent)}})}(wysihtml5),function(e){var t=e.dom,n=document,o=window,i=n.createElement("div"),r="background-color color cursor font-family font-size font-style font-variant font-weight line-height letter-spacing text-align text-decoration text-indent text-rendering word-break word-wrap word-spacing".split(" "),a="background-color border-collapse border-bottom-color border-bottom-style border-bottom-width border-left-color border-left-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-style border-top-width clear display float margin-bottom margin-left margin-right margin-top outline-color outline-offset outline-width outline-style padding-left padding-right padding-top padding-bottom position top left right bottom z-index vertical-align text-align -webkit-box-sizing -moz-box-sizing -ms-box-sizing box-sizing -webkit-box-shadow -moz-box-shadow -ms-box-shadow box-shadow -webkit-border-top-right-radius -moz-border-radius-topright border-top-right-radius -webkit-border-bottom-right-radius -moz-border-radius-bottomright border-bottom-right-radius -webkit-border-bottom-left-radius -moz-border-radius-bottomleft border-bottom-left-radius -webkit-border-top-left-radius -moz-border-radius-topleft border-top-left-radius width height".split(" "),s="width height top left right bottom".split(" "),l=["html             { height: 100%; }","body             { min-height: 100%; padding: 0; margin: 0; margin-top: -1px; padding-top: 1px; }","._wysihtml5-temp { display: none; }",e.browser.isGecko?"body.placeholder { color: graytext !important; }":"body.placeholder { color: #a9a9a9 !important; }","body[disabled]   { background-color: #eee !important; color: #999 !important; cursor: default !important; }","img:-moz-broken  { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],c=function(e){if(e.setActive)try{e.setActive()}catch(i){}else{var r=e.style,a=n.documentElement.scrollTop||n.body.scrollTop,s=n.documentElement.scrollLeft||n.body.scrollLeft,r={position:r.position,top:r.top,left:r.left,WebkitUserSelect:r.WebkitUserSelect};t.setStyles({position:"absolute",top:"-99999px",left:"-99999px",WebkitUserSelect:"none"}).on(e),e.focus(),t.setStyles(r).on(e),o.scrollTo&&o.scrollTo(s,a)}};e.views.Composer.prototype.style=function(){var d=this,u=n.querySelector(":focus"),h=this.textarea.element,f=h.hasAttribute("placeholder"),m=f&&h.getAttribute("placeholder");this.focusStylesHost=this.focusStylesHost||i.cloneNode(!1),this.blurStylesHost=this.blurStylesHost||i.cloneNode(!1),f&&h.removeAttribute("placeholder"),
h===u&&h.blur(),t.copyStyles(a).from(h).to(this.iframe).andTo(this.blurStylesHost),t.copyStyles(r).from(h).to(this.element).andTo(this.blurStylesHost),t.insertCSS(l).into(this.element.ownerDocument),c(h),t.copyStyles(a).from(h).to(this.focusStylesHost),t.copyStyles(r).from(h).to(this.focusStylesHost);var p=e.lang.array(a).without(["display"]);if(u?u.focus():h.blur(),f&&h.setAttribute("placeholder",m),!e.browser.hasCurrentStyleProperty())var g=t.observe(o,"resize",function(){if(t.contains(document.documentElement,d.iframe)){var e=t.getStyle("display").from(h),n=t.getStyle("display").from(d.iframe);h.style.display="",d.iframe.style.display="none",t.copyStyles(s).from(h).to(d.iframe).andTo(d.focusStylesHost).andTo(d.blurStylesHost),d.iframe.style.display=n,h.style.display=e}else g.stop()});return this.parent.observe("focus:composer",function(){t.copyStyles(p).from(d.focusStylesHost).to(d.iframe),t.copyStyles(r).from(d.focusStylesHost).to(d.element)}),this.parent.observe("blur:composer",function(){t.copyStyles(p).from(d.blurStylesHost).to(d.iframe),t.copyStyles(r).from(d.blurStylesHost).to(d.element)}),this}}(wysihtml5),function(e){var t=e.dom,n=e.browser,o={66:"bold",73:"italic",85:"underline"};e.views.Composer.prototype.observe=function(){var i=this,r=this.getValue(),a=this.sandbox.getIframe(),s=this.element,l=n.supportsEventsInIframeCorrectly()?s:this.sandbox.getWindow(),c=n.supportsEvent("drop")?["drop","paste"]:["dragdrop","paste"];t.observe(a,"DOMNodeRemoved",function(){clearInterval(d),i.parent.fire("destroy:composer")});var d=setInterval(function(){t.contains(document.documentElement,a)||(clearInterval(d),i.parent.fire("destroy:composer"))},250);t.observe(l,"focus",function(){i.parent.fire("focus").fire("focus:composer"),setTimeout(function(){r=i.getValue()},0)}),t.observe(l,"blur",function(){r!==i.getValue()&&i.parent.fire("change").fire("change:composer"),i.parent.fire("blur").fire("blur:composer")}),e.browser.isIos()&&t.observe(s,"blur",function(){var e=s.ownerDocument.createElement("input"),t=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.scrollLeft||document.body.scrollLeft;try{i.selection.insertNode(e)}catch(o){s.appendChild(e)}e.focus(),e.parentNode.removeChild(e),window.scrollTo(n,t)}),t.observe(s,"dragenter",function(){i.parent.fire("unset_placeholder")}),n.firesOnDropOnlyWhenOnDragOverIsCancelled()&&t.observe(s,["dragover","dragenter"],function(e){e.preventDefault()}),t.observe(s,c,function(e){var t,o=e.dataTransfer;o&&n.supportsDataTransfer()&&(t=o.getData("text/html")||o.getData("text/plain")),t?(s.focus(),i.commands.exec("insertHTML",t),i.parent.fire("paste").fire("paste:composer"),e.stopPropagation(),e.preventDefault()):setTimeout(function(){i.parent.fire("paste").fire("paste:composer")},0)}),t.observe(s,"keyup",function(t){t=t.keyCode,(t===e.SPACE_KEY||t===e.ENTER_KEY)&&i.parent.fire("newword:composer")}),this.parent.observe("paste:composer",function(){setTimeout(function(){i.parent.fire("newword:composer")},0)}),n.canSelectImagesInContentEditable()||t.observe(s,"mousedown",function(e){var t=e.target;"IMG"===t.nodeName&&(i.selection.selectNode(t),e.preventDefault())}),t.observe(s,"keydown",function(e){var t=o[e.keyCode];(e.ctrlKey||e.metaKey)&&!e.altKey&&t&&(i.commands.exec(t),e.preventDefault())}),t.observe(s,"keydown",function(t){var n=i.selection.getSelectedNode(!0),o=t.keyCode;!n||"IMG"!==n.nodeName||o!==e.BACKSPACE_KEY&&o!==e.DELETE_KEY||(o=n.parentNode,o.removeChild(n),"A"===o.nodeName&&!o.firstChild&&o.parentNode.removeChild(o),setTimeout(function(){e.quirks.redraw(s)},0),t.preventDefault())});var u={IMG:"Image: ",A:"Link: "};t.observe(s,"mouseover",function(e){var e=e.target,t=e.nodeName;!("A"!==t&&"IMG"!==t)&&!e.hasAttribute("title")&&(t=u[t]+(e.getAttribute("href")||e.getAttribute("src")),e.setAttribute("title",t))})}}(wysihtml5),function(e){e.views.Synchronizer=Base.extend({constructor:function(e,t,n){this.editor=e,this.textarea=t,this.composer=n,this._observe()},fromComposerToTextarea:function(t){this.textarea.setValue(e.lang.string(this.composer.getValue()).trim(),t)},fromTextareaToComposer:function(e){var t=this.textarea.getValue();t?this.composer.setValue(t,e):(this.composer.clear(),this.editor.fire("set_placeholder"))},sync:function(e){"textarea"===this.editor.currentView.name?this.fromTextareaToComposer(e):this.fromComposerToTextarea(e)},_observe:function(){var t,n=this,o=this.textarea.element.form,i=function(){t=setInterval(function(){n.fromComposerToTextarea()},400)},r=function(){clearInterval(t),t=null};i(),o&&(e.dom.observe(o,"submit",function(){n.sync(!0)}),e.dom.observe(o,"reset",function(){setTimeout(function(){n.fromTextareaToComposer()},0)})),this.editor.observe("change_view",function(e){"composer"!==e||t?"textarea"===e&&(n.fromComposerToTextarea(!0),r()):(n.fromTextareaToComposer(!0),i())}),this.editor.observe("destroy:composer",r)}})}(wysihtml5),wysihtml5.views.Textarea=wysihtml5.views.View.extend({name:"textarea",constructor:function(e,t,n){this.base(e,t,n),this._observe()},clear:function(){this.element.value=""},getValue:function(e){var t=this.isEmpty()?"":this.element.value;return e&&(t=this.parent.parse(t)),t},setValue:function(e,t){t&&(e=this.parent.parse(e)),this.element.value=e},hasPlaceholderSet:function(){var e=wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),t=this.element.getAttribute("placeholder")||null,n=this.element.value;return e&&!n||n===t},isEmpty:function(){return!wysihtml5.lang.string(this.element.value).trim()||this.hasPlaceholderSet()},_observe:function(){var e=this.element,t=this.parent,n={focusin:"focus",focusout:"blur"},o=wysihtml5.browser.supportsEvent("focusin")?["focusin","focusout","change"]:["focus","blur","change"];t.observe("beforeload",function(){wysihtml5.dom.observe(e,o,function(e){e=n[e.type]||e.type,t.fire(e).fire(e+":textarea")}),wysihtml5.dom.observe(e,["paste","drop"],function(){setTimeout(function(){t.fire("paste").fire("paste:textarea")},0)})})}}),function(e){var t=e.dom;e.toolbar.Dialog=e.lang.Dispatcher.extend({constructor:function(e,t){this.link=e,this.container=t},_observe:function(){if(!this._observed){var n=this,o=function(e){var t=n._serialize();t==n.elementToChange?n.fire("edit",t):n.fire("save",t),n.hide(),e.preventDefault(),e.stopPropagation()};t.observe(n.link,"click",function(){t.hasClass(n.link,"wysihtml5-command-dialog-opened")&&setTimeout(function(){n.hide()},0)}),t.observe(this.container,"keydown",function(t){var i=t.keyCode;i===e.ENTER_KEY&&o(t),i===e.ESCAPE_KEY&&n.hide()}),t.delegate(this.container,"[data-wysihtml5-dialog-action=save]","click",o),t.delegate(this.container,"[data-wysihtml5-dialog-action=cancel]","click",function(e){n.fire("cancel"),n.hide(),e.preventDefault(),e.stopPropagation()});for(var i=this.container.querySelectorAll("input, select, textarea"),r=0,a=i.length,s=function(){clearInterval(n.interval)};a>r;r++)t.observe(i[r],"change",s);this._observed=!0}},_serialize:function(){for(var e=this.elementToChange||{},t=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),n=t.length,o=0;n>o;o++)e[t[o].getAttribute("data-wysihtml5-dialog-field")]=t[o].value;return e},_interpolate:function(e){for(var t,n,o=document.querySelector(":focus"),i=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),r=i.length,a=0;r>a;a++)t=i[a],t!==o&&!(e&&"hidden"===t.type)&&(n=t.getAttribute("data-wysihtml5-dialog-field"),n=this.elementToChange?this.elementToChange[n]||"":t.defaultValue,t.value=n)},show:function(e){var n=this,o=this.container.querySelector("input, select, textarea");if(this.elementToChange=e,this._observe(),this._interpolate(),e&&(this.interval=setInterval(function(){n._interpolate(!0)},500)),t.addClass(this.link,"wysihtml5-command-dialog-opened"),this.container.style.display="",this.fire("show"),o&&!e)try{o.focus()}catch(i){}},hide:function(){clearInterval(this.interval),this.elementToChange=null,t.removeClass(this.link,"wysihtml5-command-dialog-opened"),this.container.style.display="none",this.fire("hide")}})}(wysihtml5),function(e){var t=e.dom,n={position:"relative"},o={left:0,margin:0,opacity:0,overflow:"hidden",padding:0,position:"absolute",top:0,zIndex:1},i={cursor:"inherit",fontSize:"50px",height:"50px",marginTop:"-25px",outline:0,padding:0,position:"absolute",right:"-4px",top:"50%"},r={"x-webkit-speech":"",speech:""};e.toolbar.Speech=function(a,s){var l=document.createElement("input");if(e.browser.supportsSpeechApiOn(l)){var c=document.createElement("div");e.lang.object(o).merge({width:s.offsetWidth+"px",height:s.offsetHeight+"px"}),t.insert(l).into(c),t.insert(c).into(s),t.setStyles(i).on(l),t.setAttributes(r).on(l),t.setStyles(o).on(c),t.setStyles(n).on(s),t.observe(l,"onwebkitspeechchange"in l?"webkitspeechchange":"speechchange",function(){a.execCommand ("insertText",l.value),l.value=""}),t.observe(l,"click",function(e){t.hasClass(s,"wysihtml5-command-disabled")&&e.preventDefault(),e.stopPropagation()})}else s.style.display="none"}}(wysihtml5),function(e){var t=e.dom;e.toolbar.Toolbar=Base.extend({constructor:function(t,n){this.editor=t,this.container="string"==typeof n?document.getElementById(n):n,this.composer=t.composer,this._getLinks("command"),this._getLinks("action"),this._observe(),this.show();for(var o=this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),i=o.length,r=0;i>r;r++)new e.toolbar.Speech(this,o[r])},_getLinks:function(t){for(var n,o,i,r,a,s=this[t+"Links"]=e.lang.array(this.container.querySelectorAll("[data-wysihtml5-"+t+"]")).get(),l=s.length,c=0,d=this[t+"Mapping"]={};l>c;c++)n=s[c],i=n.getAttribute("data-wysihtml5-"+t),r=n.getAttribute("data-wysihtml5-"+t+"-value"),o=this.container.querySelector("[data-wysihtml5-"+t+"-group='"+i+"']"),a=this._getDialog(n,i),d[i+":"+r]={link:n,group:o,name:i,value:r,dialog:a,state:!1}},_getDialog:function(t,n){var o,i,r=this,a=this.container.querySelector("[data-wysihtml5-dialog='"+n+"']");return a&&(o=new e.toolbar.Dialog(t,a),o.observe("show",function(){i=r.composer.selection.getBookmark(),r.editor.fire("show:dialog",{command:n,dialogContainer:a,commandLink:t})}),o.observe("save",function(e){i&&r.composer.selection.setBookmark(i),r._execCommand (n,e),r.editor.fire("save:dialog",{command:n,dialogContainer:a,commandLink:t})}),o.observe("cancel",function(){r.editor.focus(!1),r.editor.fire("cancel:dialog",{command:n,dialogContainer:a,commandLink:t})})),o},execCommand:function(e,t){if(!this.commandsDisabled){var n=this.commandMapping[e+":"+t];n&&n.dialog&&!n.state?n.dialog.show():this._execCommand (e,t)}},_execCommand:function(e,t){this.editor.focus(!1),this.composer.commands.exec(e,t),this._updateLinkStates()},execAction:function(e){var t=this.editor;switch(e){case"change_view":t.currentView===t.textarea?t.fire("change_view","composer"):t.fire("change_view","textarea")}},_observe:function(){for(var e=this,n=this.editor,o=this.container,i=this.commandLinks.concat(this.actionLinks),r=i.length,a=0;r>a;a++)t.setAttributes({href:"javascript:;",unselectable:"on"}).on(i[a]);t.delegate(o,"[data-wysihtml5-command]","mousedown",function(e){e.preventDefault()}),t.delegate(o,"[data-wysihtml5-command]","click",function(t){var n=this.getAttribute("data-wysihtml5-command"),o=this.getAttribute("data-wysihtml5-command-value");e.execCommand (n,o),t.preventDefault()}),t.delegate(o,"[data-wysihtml5-action]","click",function(t){var n=this.getAttribute("data-wysihtml5-action");e.execAction(n),t.preventDefault()}),n.observe("focus:composer",function(){e.bookmark=null,clearInterval(e.interval),e.interval=setInterval(function(){e._updateLinkStates()},500)}),n.observe("blur:composer",function(){clearInterval(e.interval)}),n.observe("destroy:composer",function(){clearInterval(e.interval)}),n.observe("change_view",function(n){setTimeout(function(){e.commandsDisabled="composer"!==n,e._updateLinkStates(),e.commandsDisabled?t.addClass(o,"wysihtml5-commands-disabled"):t.removeClass(o,"wysihtml5-commands-disabled")},0)})},_updateLinkStates:function(){var n,o,i,r=this.commandMapping,a=this.actionMapping;for(n in r)i=r[n],this.commandsDisabled?(o=!1,t.removeClass(i.link,"wysihtml5-command-active"),i.group&&t.removeClass(i.group,"wysihtml5-command-active"),i.dialog&&i.dialog.hide()):(o=this.composer.commands.state(i.name,i.value),e.lang.object(o).isArray()&&(o=1===o.length?o[0]:!0),t.removeClass(i.link,"wysihtml5-command-disabled"),i.group&&t.removeClass(i.group,"wysihtml5-command-disabled")),i.state!==o&&((i.state=o)?(t.addClass(i.link,"wysihtml5-command-active"),i.group&&t.addClass(i.group,"wysihtml5-command-active"),i.dialog&&("object"==typeof o?i.dialog.show(o):i.dialog.hide())):(t.removeClass(i.link,"wysihtml5-command-active"),i.group&&t.removeClass(i.group,"wysihtml5-command-active"),i.dialog&&i.dialog.hide()));for(n in a)r=a[n],"change_view"===r.name&&(r.state=this.editor.currentView===this.editor.textarea,r.state?t.addClass(r.link,"wysihtml5-action-active"):t.removeClass(r.link,"wysihtml5-action-active"))},show:function(){this.container.style.display=""},hide:function(){this.container.style.display="none"}})}(wysihtml5),function(e){var t={name:void 0,style:!0,toolbar:void 0,autoLink:!0,parserRules:{tags:{br:{},span:{},div:{},p:{}},classes:{}},parser:e.dom.parse,composerClassName:"wysihtml5-editor",bodyClassName:"wysihtml5-supported",stylesheets:[],placeholderText:void 0,allowObjectResizing:!0,supportTouchDevices:!0};e.Editor=e.lang.Dispatcher.extend({constructor:function(n,o){if(this.textareaElement="string"==typeof n?document.getElementById(n):n,this.config=e.lang.object({}).merge(t).merge(o).get(),this.currentView=this.textarea=new e.views.Textarea(this,this.textareaElement,this.config),this._isCompatible=e.browser.supported(),!this._isCompatible||!this.config.supportTouchDevices&&e.browser.isTouchDevice()){var i=this;setTimeout(function(){i.fire("beforeload").fire("load")},0)}else{e.dom.addClass(document.body,this.config.bodyClassName),this.currentView=this.composer=new e.views.Composer(this,this.textareaElement,this.config),"function"==typeof this.config.parser&&this._initParser(),this.observe("beforeload",function(){this.synchronizer=new e.views.Synchronizer(this,this.textarea,this.composer),this.config.toolbar&&(this.toolbar=new e.toolbar.Toolbar(this,this.config.toolbar))});try{console.log("Heya! This page is using wysihtml5 for rich text editing. Check out https://github.com/xing/wysihtml5")}catch(r){}}},isCompatible:function(){return this._isCompatible},clear:function(){return this.currentView.clear(),this},getValue:function(e){return this.currentView.getValue(e)},setValue:function(e,t){return e?(this.currentView.setValue(e,t),this):this.clear()},focus:function(e){return this.currentView.focus(e),this},disable:function(){return this.currentView.disable(),this},enable:function(){return this.currentView.enable(),this},isEmpty:function(){return this.currentView.isEmpty()},hasPlaceholderSet:function(){return this.currentView.hasPlaceholderSet()},parse:function(t){var n=this.config.parser(t,this.config.parserRules,this.composer.sandbox.getDocument(),!0);return"object"==typeof t&&e.quirks.redraw(t),n},_initParser:function(){this.observe("paste:composer",function(){var t=this;t.composer.selection.executeAndRestore(function(){e.quirks.cleanPastedHTML(t.composer.element),t.parse(t.composer.element)},!0)}),this.observe("paste:textarea",function(){this.textarea.setValue(this.parse(this.textarea.getValue()))})}})}(wysihtml5);var Handlebars=function(){var e=function(){"use strict";function e(e){this.string=e}var t;return e.prototype.toString=function(){return""+this.string},t=e}(),t=function(e){"use strict";function t(e){return s[e]||"&amp;"}function n(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function o(e){return e instanceof a?e.toString():e||0===e?(e=""+e,c.test(e)?e.replace(l,t):e):""}function i(e){return e||0===e?h(e)&&0===e.length?!0:!1:!0}var r={},a=e,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},l=/[&<>"'`]/g,c=/[&<>"'`]/;r.extend=n;var d=Object.prototype.toString;r.toString=d;var u=function(e){return"function"==typeof e};u(/x/)&&(u=function(e){return"function"==typeof e&&"[object Function]"===d.call(e)});var u;r.isFunction=u;var h=Array.isArray||function(e){return e&&"object"==typeof e?"[object Array]"===d.call(e):!1};return r.isArray=h,r.escapeExpression=o,r.isEmpty=i,r}(e),n=function(){"use strict";function e(){for(var e=Error.prototype.constructor.apply(this,arguments),t=0;t<n.length;t++)this[n[t]]=e[n[t]]}var t,n=["description","fileName","lineNumber","message","name","number","stack"];return e.prototype=new Error,t=e}(),o=function(e,t){"use strict";function n(e,t){this.helpers=e||{},this.partials=t||{},o(this)}function o(e){e.registerHelper("helperMissing",function(e){if(2!==arguments.length)throw new Error("Missing helper: '"+e+"'")}),e.registerHelper("blockHelperMissing",function(t,n){var o=n.inverse||function(){},i=n.fn;return h(t)&&(t=t.call(this)),t===!0?i(this):t===!1||null==t?o(this):u(t)?t.length>0?e.helpers.each(t,n):o(this):i(t)}),e.registerHelper("each",function(e,t){var n,o=t.fn,i=t.inverse,r=0,a="";if(h(e)&&(e=e.call(this)),t.data&&(n=g(t.data)),e&&"object"==typeof e)if(u(e))for(var s=e.length;s>r;r++)n&&(n.index=r,n.first=0===r,n.last=r===e.length-1),a+=o(e[r],{data:n});else for(var l in e)e.hasOwnProperty(l)&&(n&&(n.key=l),a+=o(e[l],{data:n}),r++);return 0===r&&(a=i(this)),a}),e.registerHelper("if",function(e,t){return h(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||a.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,n){return e.helpers["if"].call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})}),e.registerHelper("with",function(e,t){return h(e)&&(e=e.call(this)),a.isEmpty(e)?void 0:t.fn(e)}),e.registerHelper("log",function(t,n){var o=n.data&&null!=n.data.level?parseInt(n.data.level,10):1;e.log(o,t)})}function i(e,t){p.log(e,t)}var r={},a=e,s=t,l="1.1.2";r.VERSION=l;var c=4;r.COMPILER_REVISION=c;var d={1:"<=1.0.rc.2",2:"==1.0.0-rc.3",3:"==1.0.0-rc.4",4:">=1.0.0"};r.REVISION_CHANGES=d;var u=a.isArray,h=a.isFunction,f=a.toString,m="[object Object]";r.HandlebarsEnvironment=n,n.prototype={constructor:n,logger:p,log:i,registerHelper:function(e,t,n){if(f.call(e)===m){if(n||t)throw new s("Arg not supported with multiple helpers");a.extend(this.helpers,e)}else n&&(t.not=n),this.helpers[e]=t},registerPartial:function(e,t){f.call(e)===m?a.extend(this.partials,e):this.partials[e]=t}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){if(p.level<=e){var n=p.methodMap[e];"undefined"!=typeof console&&console[n]&&console[n].call(console,t)}}};r.logger=p,r.log=i;var g=function(e){var t={};return a.extend(t,e),t};return r.createFrame=g,r}(t,n),i=function(e,t,n){"use strict";function o(e){var t=e&&e[0]||1,n=h;if(t!==n){if(n>t){var o=f[n],i=f[t];throw new Error("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+o+") or downgrade your runtime to an older version ("+i+").")}throw new Error("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}}function i(e,t){if(!t)throw new Error("No environment passed to template");var n;n=t.compile?function(e,n,o,i,r,a){var l=s.apply(this,arguments);if(l)return l;var c={helpers:i,partials:r,data:a};return r[n]=t.compile(e,{data:void 0!==a},t),r[n](o,c)}:function(e,t){var n=s.apply(this,arguments);if(n)return n;throw new u("The partial "+t+" could not be compiled when running in runtime-only mode")};var i={escapeExpression:d.escapeExpression,invokePartial:n,programs:[],program:function(e,t,n){var o=this.programs[e];return n?o=a(e,t,n):o||(o=this.programs[e]=a(e,t)),o},merge:function(e,t){var n=e||t;return e&&t&&e!==t&&(n={},d.extend(n,t),d.extend(n,e)),n},programWithDepth:r,noop:l,compilerInfo:null};return function(n,r){r=r||{};var a,s,l=r.partial?r:t;r.partial||(a=r.helpers,s=r.partials);var c=e.call(i,l,n,a,s,r.data);return r.partial||o(i.compilerInfo),c}}function r(e,t,n){var o=Array.prototype.slice.call(arguments,3),i=function(e,i){return i=i||{},t.apply(this,[e,i.data||n].concat(o))};return i.program=e,i.depth=o.length,i}function a(e,t,n){var o=function(e,o){return o=o||{},t(e,o.data||n)};return o.program=e,o.depth=0,o}function s(e,t,n,o,i,r){var a={partial:!0,helpers:o,partials:i,data:r};if(void 0===e)throw new u("The partial "+t+" could not be found");return e instanceof Function?e(n,a):void 0}function l(){return""}var c={},d=e,u=t,h=n.COMPILER_REVISION,f=n.REVISION_CHANGES;return c.template=i,c.programWithDepth=r,c.program=a,c.invokePartial=s,c.noop=l,c}(t,n,o),r=function(e,t,n,o,i){"use strict";var r,a=e,s=t,l=n,c=o,d=i,u=function(){var e=new a.HandlebarsEnvironment;return c.extend(e,a),e.SafeString=s,e.Exception=l,e.Utils=c,e.VM=d,e.template=function(t){return d.template(t,e)},e},h=u();return h.create=u,r=h}(o,e,n,t,i);return r}(),glob="undefined"==typeof window?global:window,Handlebars=glob.Handlebars||require("handlebars");this.wysihtml5=this.wysihtml5||{},this.wysihtml5.tpl=this.wysihtml5.tpl||{},this.wysihtml5.tpl.blockquote=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="blockquote" data-wysihtml5-display-format-name="false" tabindex="-1">\n    <span class="fa fa-quote-left"></span>\n  </a>\n</li>\n'}),this.wysihtml5.tpl.color=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li class="dropdown">\n  <a class="btn btn-default dropdown-toggle ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+='" data-toggle="dropdown" tabindex="-1">\n    <span class="current-color">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.black,typeof a===c?a.apply(t):a))+'</span>\n    <b class="caret"></b>\n  </a>\n  <ul class="dropdown-menu">\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="black"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="black">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.black,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="silver"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="silver">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.silver,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="gray"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="gray">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.gray,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="maroon"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="maroon">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.maroon,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="red"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="red">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.red,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="purple"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="purple">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.purple,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="green"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="green">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.green,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="olive"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="olive">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.olive,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="navy"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="navy">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.navy,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="blue"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="blue">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.blue,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><div class="wysihtml5-colors" data-wysihtml5-command-value="orange"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="orange">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.colours,a=null==a||a===!1?a:a.orange,typeof a===c?a.apply(t):a))+"</a></li>\n  </ul>\n</li>\n"}),this.wysihtml5.tpl.emphasis=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+u((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===d?t.apply(e):t))}function a(e,t){var o,i,a="";return a+='\n    <a class="btn ',i=n["if"].call(e,(o=e&&e.options,null==o||o===!1?o:o.size),{hash:{},inverse:h.noop,fn:h.program(1,r,t),data:t}),(i||0===i)&&(a+=i),a+=' btn-default" data-wysihtml5-command="small" title="CTRL+S" tabindex="-1">'+u((o=e&&e.locale,o=null==o||o===!1?o:o.emphasis,o=null==o||o===!1?o:o.small,typeof o===d?o.apply(e):o))+"</a>\n    "}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var s,l,c="",d="function",u=this.escapeExpression,h=this;return c+='<li>\n  <div class="btn-group">\n    <a class="btn ',l=n["if"].call(t,(s=t&&t.options,null==s||s===!1?s:s.size),{hash:{},inverse:h.noop,fn:h.program(1,r,i),data:i}),(l||0===l)&&(c+=l),c+=' btn-default" data-wysihtml5-command="bold" title="CTRL+B" tabindex="-1">'+u((s=t&&t.locale,s=null==s||s===!1?s:s.emphasis,s=null==s||s===!1?s:s.bold,typeof s===d?s.apply(t):s))+'</a>\n    <a class="btn ',l=n["if"].call(t,(s=t&&t.options,null==s||s===!1?s:s.size),{hash:{},inverse:h.noop,fn:h.program(1,r,i),data:i}),(l||0===l)&&(c+=l),c+=' btn-default" data-wysihtml5-command="italic" title="CTRL+I" tabindex="-1">'+u((s=t&&t.locale,s=null==s||s===!1?s:s.emphasis,s=null==s||s===!1?s:s.italic,typeof s===d?s.apply(t):s))+'</a>\n    <a class="btn ',l=n["if"].call(t,(s=t&&t.options,null==s||s===!1?s:s.size),{hash:{},inverse:h.noop,fn:h.program(1,r,i),data:i}),(l||0===l)&&(c+=l),c+=' btn-default" data-wysihtml5-command="underline" title="CTRL+U" tabindex="-1">'+u((s=t&&t.locale,s=null==s||s===!1?s:s.emphasis,s=null==s||s===!1?s:s.underline,typeof s===d?s.apply(t):s))+"</a>\n    ",l=n["if"].call(t,(s=t&&t.options,null==s||s===!1?s:s.emSmall),{hash:{},inverse:h.noop,fn:h.program(3,a,i),data:i}),(l||0===l)&&(c+=l),c+="\n  </div>\n</li>\n"}),this.wysihtml5.tpl["font-styles"]=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li class="dropdown">\n  <a class="btn btn-default dropdown-toggle ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+='" data-toggle="dropdown">\n    <span class="fa fa-font"></span>\n    <span class="current-font">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.normal,typeof a===c?a.apply(t):a))+'</span>\n    <b class="caret"></b>\n  </a>\n  <ul class="dropdown-menu">\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="p" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.normal,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h1,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h2,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h3" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h3,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h4" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h4,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h5" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h5,typeof a===c?a.apply(t):a))+'</a></li>\n    <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h6" tabindex="-1">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.font_styles,a=null==a||a===!1?a:a.h6,typeof a===c?a.apply(t):a))+"</a></li>\n  </ul>\n</li>\n"}),this.wysihtml5.tpl.html=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <div class="btn-group">\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-action="change_view" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.html,a=null==a||a===!1?a:a.edit,typeof a===c?a.apply(t):a))+'" tabindex="-1">\n      <span class="fa fa-pencil"></span>\n    </a>\n  </div>\n</li>\n'}),this.wysihtml5.tpl.image=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <div class="bootstrap-wysihtml5-insert-image-modal modal fade">\n    <div class="modal-dialog">\n      <div class="modal-content">\n        <div class="modal-header">\n          <a class="close" data-dismiss="modal">&times;</a>\n          <h3>'+d((a=t&&t.locale,a=null==a||a===!1?a:a.image,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'</h3>\n        </div>\n        <div class="modal-body">\n          <input value="http://" class="bootstrap-wysihtml5-insert-image-url form-control">\n        </div>\n        <div class="modal-footer">\n          <a class="btn btn-default" data-dismiss="modal">'+d((a=t&&t.locale,
a=null==a||a===!1?a:a.image,a=null==a||a===!1?a:a.cancel,typeof a===c?a.apply(t):a))+'</a>\n          <a class="btn btn-primary" data-dismiss="modal">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.image,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'</a>\n        </div>\n      </div>\n    </div>\n  </div>\n  <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="insertImage" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.image,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'" tabindex="-1">\n    <span class="fa fa-photo"></span>\n  </a>\n</li>\n'}),this.wysihtml5.tpl.link=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <div class="bootstrap-wysihtml5-insert-link-modal modal fade">\n    <div class="modal-dialog">\n      <div class="modal-content">\n        <div class="modal-header">\n          <a class="close" data-dismiss="modal">&times;</a>\n          <h3>'+d((a=t&&t.locale,a=null==a||a===!1?a:a.link,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'</h3>\n        </div>\n        <div class="modal-body">\n          <input value="http://" class="bootstrap-wysihtml5-insert-link-url form-control">\n          <p> <input type="checkbox" class="bootstrap-wysihtml5-insert-link-target" checked>&nbsp;'+d((a=t&&t.locale,a=null==a||a===!1?a:a.link,a=null==a||a===!1?a:a.target,typeof a===c?a.apply(t):a))+'</p>\n        </div>\n        <div class="modal-footer">\n          <a class="btn btn-default" data-dismiss="modal">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.link,a=null==a||a===!1?a:a.cancel,typeof a===c?a.apply(t):a))+'</a>\n          <a href="#" class="btn btn-primary" data-dismiss="modal">'+d((a=t&&t.locale,a=null==a||a===!1?a:a.link,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'</a>\n        </div>\n      </div>\n    </div>\n  </div>\n  <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="createLink" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.link,a=null==a||a===!1?a:a.insert,typeof a===c?a.apply(t):a))+'" tabindex="-1">\n    <span class="fa fa-link"></span>\n  </a>\n</li>\n'}),this.wysihtml5.tpl.lists=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <div class="btn-group">\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="insertUnorderedList" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.lists,a=null==a||a===!1?a:a.unordered,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-list"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="insertOrderedList" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.lists,a=null==a||a===!1?a:a.ordered,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-list-ol"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="Outdent" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.lists,a=null==a||a===!1?a:a.outdent,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-outdent"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="Indent" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.lists,a=null==a||a===!1?a:a.indent,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-indent"></span></a>\n  </div>\n</li>\n'}),this.wysihtml5.tpl.align=Handlebars.template(function(e,t,n,o,i){function r(e){var t,n="";return n+="btn-"+d((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===c?t.apply(e):t))}this.compilerInfo=[4,">=1.0.0"],n=this.merge(n,e.helpers),i=i||{};var a,s,l="",c="function",d=this.escapeExpression,u=this;return l+='<li>\n  <div class="btn-group">\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="alignLeft" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.align,a=null==a||a===!1?a:a.left,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-align-left"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="alignRight" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.align,a=null==a||a===!1?a:a.right,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-align-right"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="alignCenter" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.align,a=null==a||a===!1?a:a.center,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-align-center"></span></a>\n    <a class="btn ',s=n["if"].call(t,(a=t&&t.options,null==a||a===!1?a:a.size),{hash:{},inverse:u.noop,fn:u.program(1,r,i),data:i}),(s||0===s)&&(l+=s),l+=' btn-default" data-wysihtml5-command="alignJustify" title="'+d((a=t&&t.locale,a=null==a||a===!1?a:a.align,a=null==a||a===!1?a:a.justify,typeof a===c?a.apply(t):a))+'" tabindex="-1"><span class="fa fa-align-justify"></span></a>\n  </div>\n</li>\n'}),"object"==typeof exports&&exports&&(module.exports=this.wysihtml5.tpl),!function(e,t){"use strict";var n=function(e,n,o){return t.tpl[e]({locale:n,options:o})},o=function(n,o){this.el=n;var i=o||r;e.extend(i.shortcuts,r.shortcuts);for(var a in i.customTemplates)t.tpl[a]=i.customTemplates[a];this.toolbar=this.createToolbar(n,i),this.editor=this.createEditor(i),window.editor=this.editor,e("iframe.wysihtml5-sandbox").each(function(t,n){e(n.contentWindow).off("focus.wysihtml5").on({"focus.wysihtml5":function(){e("li.dropdown").removeClass("open")}})})};o.prototype={constructor:o,createEditor:function(n){n=n||{},n=e.extend(!0,{},n),n.toolbar=this.toolbar[0];var o=new t.Editor(this.el[0],n);if(this.addMoreShortcuts(o,o.currentView.iframe.contentDocument.body,n.shortcuts),n&&n.events)for(var i in n.events)o.on(i,n.events[i]);return o},createToolbar:function(t,o){var i=this,s=e("<ul/>",{"class":"wysihtml5-toolbar",style:"display:none"}),l=o.locale||r.locale||"en";a.hasOwnProperty(l)||(console.debug("Locale '"+l+"' not found. Available locales are: "+Object.keys(a)+". Falling back to 'en'."),l="en");var c=e.extend(!0,{},a.en,a[l]);for(var d in r){var u=!1;void 0!==o[d]?o[d]===!0&&(u=!0):u=r[d],u===!0&&(s.append(n(d,c,o)),"html"===d&&this.initHtml(s),"link"===d&&this.initInsertLink(s),"image"===d&&this.initInsertImage(s))}if(o.toolbar)for(d in o.toolbar)s.append(o.toolbar[d]);return s.find('a[data-wysihtml5-command="formatBlock"]').click(function(t){var n=t.delegateTarget||t.target||t.srcElement,o=e(n),r=o.data("wysihtml5-display-format-name"),a=o.data("wysihtml5-format-name")||o.html();(void 0===r||"true"===r)&&i.toolbar.find(".current-font").text(a)}),s.find('a[data-wysihtml5-command="foreColor"]').click(function(t){var n=t.target||t.srcElement,o=e(n);i.toolbar.find(".current-color").text(o.html())}),this.el.before(s),s},initHtml:function(e){var t='a[data-wysihtml5-action="change_view"]';e.find(t).click(function(){e.find("a.btn").not(t).toggleClass("disabled")})},initInsertImage:function(t){var n,o=this,i=t.find(".bootstrap-wysihtml5-insert-image-modal"),r=i.find(".bootstrap-wysihtml5-insert-image-url"),a=i.find("a.btn-primary"),s=r.val(),l=function(){var e=r.val();r.val(s),o.editor.currentView.element.focus(),n&&(o.editor.composer.selection.setBookmark(n),n=null),o.editor.composer.commands.exec("insertImage",e)};r.keypress(function(e){13==e.which&&(l(),i.modal("hide"))}),a.click(l),i.on("shown",function(){r.focus()}),i.on("hide",function(){o.editor.currentView.element.focus()}),t.find("a[data-wysihtml5-command=insertImage]").click(function(){var t=e(this).hasClass("wysihtml5-command-active");return t?!0:(o.editor.currentView.element.focus(!1),n=o.editor.composer.selection.getBookmark(),i.appendTo("body").modal("show"),i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(e){e.stopPropagation()}),!1)})},initInsertLink:function(t){var n,o=this,i=t.find(".bootstrap-wysihtml5-insert-link-modal"),r=i.find(".bootstrap-wysihtml5-insert-link-url"),a=i.find(".bootstrap-wysihtml5-insert-link-target"),s=i.find("a.btn-primary"),l=r.val(),c=function(){var e=r.val();r.val(l),o.editor.currentView.element.focus(),n&&(o.editor.composer.selection.setBookmark(n),n=null);var t=a.prop("checked");o.editor.composer.commands.exec("createLink",{href:e,target:t?"_blank":"_self",rel:t?"nofollow":""})};r.keypress(function(e){13==e.which&&(c(),i.modal("hide"))}),s.click(c),i.on("shown",function(){r.focus()}),i.on("hide",function(){o.editor.currentView.element.focus()}),t.find("a[data-wysihtml5-command=createLink]").click(function(){var t=e(this).hasClass("wysihtml5-command-active");return t?!0:(o.editor.currentView.element.focus(!1),n=o.editor.composer.selection.getBookmark(),i.appendTo("body").modal("show"),i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(e){e.stopPropagation()}),!1)})},addMoreShortcuts:function(e,n,o){t.dom.observe(n,"keydown",function(n){var i=n.keyCode,r=o[i];(n.ctrlKey||n.metaKey)&&!n.altKey&&r&&t.commands[r]&&(t.commands[r].exec(e.composer,r),n.preventDefault())})}};var i={resetDefaults:function(){e.fn.wysihtml5.defaultOptions=e.extend(!0,{},e.fn.wysihtml5.defaultOptionsCache)},bypassDefaults:function(t){return this.each(function(){var n=e(this);n.data("wysihtml5",new o(n,t))})},shallowExtend:function(t){var n=e.extend({},e.fn.wysihtml5.defaultOptions,t||{},e(this).data()),o=this;return i.bypassDefaults.apply(o,[n])},deepExtend:function(t){var n=e.extend(!0,{},e.fn.wysihtml5.defaultOptions,t||{}),o=this;return i.bypassDefaults.apply(o,[n])},init:function(e){var t=this;return i.shallowExtend.apply(t,[e])}};e.fn.wysihtml5=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.wysihtml5"):i.init.apply(this,arguments)},e.fn.wysihtml5.Constructor=o;var r=e.fn.wysihtml5.defaultOptions={"font-styles":!0,color:!1,emphasis:!0,blockquote:!0,align:!1,lists:!0,html:!1,link:!0,image:!0,events:{},parserRules:{classes:{"wysiwyg-color-silver":1,"wysiwyg-color-gray":1,"wysiwyg-color-white":1,"wysiwyg-color-maroon":1,"wysiwyg-color-red":1,"wysiwyg-color-purple":1,"wysiwyg-color-fuchsia":1,"wysiwyg-color-green":1,"wysiwyg-color-lime":1,"wysiwyg-color-olive":1,"wysiwyg-color-yellow":1,"wysiwyg-color-navy":1,"wysiwyg-color-blue":1,"wysiwyg-color-teal":1,"wysiwyg-color-aqua":1,"wysiwyg-color-orange":1,"text-left":1,"text-right":1,"text-center":1,"text-justify":1},tags:{b:{},i:{},strong:{},em:{},p:{},br:{},ol:{},ul:{},li:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},blockquote:{},u:1,img:{check_attributes:{width:"numbers",alt:"alt",src:"url",height:"numbers"}},a:{check_attributes:{href:"url"},set_attributes:{target:"_blank",rel:"nofollow"}},span:1,div:1,small:1,code:1,pre:1,iframe:{check_attributes:{width:"numbers",height:"numbers",src:"url",allowfullscreen:1},set_attributes:{frameborder:"0"}}}},emSmall:1,locale:"en",shortcuts:{83:"small"}};"undefined"==typeof e.fn.wysihtml5.defaultOptionsCache&&(e.fn.wysihtml5.defaultOptionsCache=e.extend(!0,{},e.fn.wysihtml5.defaultOptions));var a=e.fn.wysihtml5.locale={}}(window.jQuery,window.wysihtml5),function(e){var t;e.commands.small={exec:function(t,n){return e.commands.formatInline.exec(t,n,"small")},state:function(t,n){return e.commands.formatInline.state(t,n,"small")},value:function(){return t}}}(wysihtml5),function(e){e.fn.wysihtml5.locale.en=e.fn.wysihtml5.locale["en-US"]={font_styles:{normal:wysihtml5L10n.normal,h1:wysihtml5L10n.h1,h2:wysihtml5L10n.h2,h3:wysihtml5L10n.h3,h4:wysihtml5L10n.h4,h5:wysihtml5L10n.h5,h6:wysihtml5L10n.h6},emphasis:{bold:wysihtml5L10n.bold,italic:wysihtml5L10n.italic,underline:wysihtml5L10n.underline,small:wysihtml5L10n.small},align:{left:wysihtml5L10n.align_left,right:wysihtml5L10n.align_right,center:wysihtml5L10n.align_center,justify:wysihtml5L10n.align_justify},lists:{unordered:wysihtml5L10n.unordered,ordered:wysihtml5L10n.ordered,outdent:wysihtml5L10n.outdent,indent:wysihtml5L10n.indent},link:{insert:wysihtml5L10n.insert_link,cancel:wysihtml5L10n.cancel,target:wysihtml5L10n.target},image:{insert:wysihtml5L10n.insert_image,cancel:wysihtml5L10n.cancel},html:{edit:wysihtml5L10n.edit_html},colours:{black:wysihtml5L10n.black,silver:wysihtml5L10n.silver,gray:wysihtml5L10n.gray,maroon:wysihtml5L10n.maroon,red:wysihtml5L10n.red,purple:wysihtml5L10n.purple,green:wysihtml5L10n.green,olive:wysihtml5L10n.olive,navy:wysihtml5L10n.navy,blue:wysihtml5L10n.blue,orange:wysihtml5L10n.orange}}}(jQuery);