text: rangy.createModule("TextRange",["WrappedSelection"],function(aP,aO){function aq(r,q){function m(a,w,v){var u=r.slice(a,w),t={isWord:v,chars:u,toString:function(){return u.join("")}};for(var s=0,e=u.length;s<e;++s){u[s].token=t}n.push(t)}var p=r.join(""),o,n=[],l=0,k,j;while(o=q.wordRegex.exec(p)){k=o.index,j=k+o[0].length,k>l&&m(l,k,!1);if(q.includeTrailingSpace){while(aA.test(r[j])){++j}}m(k,j,!0),l=j}return l<r.length&&m(l,r.length,!1),n}function am(e,d){if(!e){return d}var f={};return aH(f,d),aH(f,e),f}function al(e){var d,f;return e?(d=e.language||ay,f={},aH(f,an[d]||an[ay]),aH(f,e),f):an[ay]}function bm(b){return am(b,ap)}function bl(b){return am(b,ao)}function ba(f,e){var h=bf(f,"display",e),g=f.tagName.toLowerCase();return h=="block"&&be&&bd.hasOwnProperty(g)?bd[g]:h}function a9(f){var e=a1(f);for(var h=0,g=e.length;h<g;++h){if(e[h].nodeType==1&&ba(e[h])=="none"){return !0}}return !1}function a7(d){var c;return d.nodeType==3&&(c=d.parentNode)&&bf(c,"visibility")=="hidden"}function a6(b){return b&&(b.nodeType==1&&!/^(inline(-block|-table)?|none)$/.test(ba(b))||b.nodeType==9||b.nodeType==11)}function a5(d){var c=d.lastChild;return c?a5(c):d}function a4(b){return aJ.isCharacterDataNode(b)||!/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i.test(b.nodeName)}function a3(d){var c=[];while(d.parentNode){c.unshift(d.parentNode),d=d.parentNode}return c}function a1(b){return a3(b).concat([b])}function a0(b){while(b&&!b.nextSibling){b=b.parentNode}return b?b.nextSibling:null}function aZ(d,c){return !c&&d.hasChildNodes()?d.firstChild:a0(d)}function aY(e){var d=e.previousSibling;if(d){e=d;while(e.hasChildNodes()){e=e.lastChild}return e}var f=e.parentNode;return f&&f.nodeType==1?f:null}function aX(f){if(!f||f.nodeType!=3){return !1}var e=f.data;if(e===""){return !0}var h=f.parentNode;if(!h||h.nodeType!=1){return !1}var g=bf(f.parentNode,"whiteSpace");return/^[\t\n\r ]+$/.test(e)&&/^(normal|nowrap)$/.test(g)||/^[\t\r ]+$/.test(e)&&g=="pre-line"}function aW(d){if(d.data===""){return !0}if(!aX(d)){return !1}var c=d.parentNode;return c?a9(d)?!0:!1:!0}function aV(d){var c=d.nodeType;return c==7||c==8||a9(d)||/^(script|style)$/i.test(d.nodeName)||a7(d)||aW(d)}function aU(e,d){var f=e.nodeType;return f==7||f==8||f==1&&ba(e,d)=="none"}function aT(){this.store={}}function aR(e,d,f){return function(c){var b=this.cache;if(b.hasOwnProperty(e)){return aS++,b[e]}bt++;var a=d.call(this,f?this[f]:this,c);return b[e]=a,a}}function bp(d,c){this.node=d,this.session=c,this.cache=new aT,this.positions=new aT}function by(d,c){this.offset=c,this.nodeWrapper=d,this.node=d.node,this.session=d.session,this.cache=new aT}function bs(){return"[Position("+aJ.inspectNode(this.node)+":"+this.offset+")]"}function ae(){return bu(),aK=new aj}function bz(){return aK||ae()}function bu(){aK&&aK.detach(),aK=null}function bn(r,q,p,o){function l(){var d=null,c=null;return q?(c=n,m||(n=n.previousVisible(),m=!n||p&&n.equals(p))):m||(c=n=n.nextVisible(),m=!n||p&&n.equals(p)),m&&(n=null),c}p&&(q?aV(p.node)&&(p=r.previousVisible()):aV(p.node)&&(p=p.nextVisible()));var n=r,m=!1,k,b=!1;return{next:function(){if(b){return b=!1,k}var d,c;while(d=l()){c=d.getCharacter(o);if(c){return k=d,d}}return null},rewind:function(){if(!k){throw aO.createError("createCharacterIterator: cannot rewind. Only one position can be rewound.")}b=!0},dispose:function(){r=p=null}}}function ak(z,y,x){function t(e){var d,A,n=[],m=e?w:v,k=!1,j=!1;while(d=m.next()){A=d.character;if(aB.test(A)){j&&(j=!1,k=!0)}else{if(k){m.rewind();break}j=!0}n.push(d)}return n}function l(e){var d=["["+e.length+"]"];for(var f=0;f<e.length;++f){d.push("(word: "+e[f]+", is word: "+e[f].isWord+")")}return d}var w=bn(z,!1,null,y),v=bn(z,!0,null,y),u=x.tokenizer,s=t(!0),r=t(!1).reverse(),q=u(r.concat(s),x),p=s.length?q.slice(aQ(q,s[0].token)):[],o=r.length?q.slice(0,aQ(q,r.pop().token)+1):[];return{nextEndToken:function(){var d,c;while(p.length==1&&!(d=p[0]).isWord&&(c=t(!0)).length>0){p=u(d.chars.concat(c),x)}return p.shift()},previousStartToken:function(){var d,c;while(o.length==1&&!(d=o[0]).isWord&&(c=t(!1)).length>0){o=u(c.reverse().concat(d.chars),x)}return o.pop()},dispose:function(){w.dispose(),v.dispose(),p=o=null}}}function af(D,C,B,A,z){var y=0,x,w=D,v,u,t=Math.abs(B),s;if(B!==0){var r=B<0;switch(C){case aM:v=bn(D,r,null,A);while((x=v.next())&&y<t){++y,w=x}u=x,v.dispose();break;case aL:var e=ak(D,A,z),d=r?e.previousStartToken:e.nextEndToken;while((s=d())&&y<t){s.isWord&&(++y,w=r?s.chars[0]:s.chars[s.chars.length-1])}break;default:throw new Error("movePositionBy: unit '"+C+"' not implemented")}r?(w=w.previousVisible(),y=-y):w&&w.isLeadingSpace&&(C==aL&&(v=bn(D,!1,null,A),u=v.next(),v.dispose()),u&&(w=u.previousVisible()))}return{position:w,unitsMoved:y}}function aa(j,i,p,o){var n=j.getRangeBoundaryPosition(i,!0),m=j.getRangeBoundaryPosition(i,!1),l=o?m:n,k=o?n:m;return bn(l,!!o,k,p)}function bv(h,g,l){var k=[],j=aa(h,g,l),i;while(i=j.next()){k.push(i)}return j.dispose(),k}function bo(a,j,i){var h=aP.createRange(a.node);h.setStartAndEnd(a.node,a.offset,j.node,j.offset);var g=!h.expand("word",i);return h.detach(),g}function bx(H,G,F,E,D){function p(g,e){var j=z[g].previousVisible(),i=z[e-1],h=!D.wholeWordsOnly||bo(j,i,D.wordOptions);return{startPos:j,endPos:i,valid:h}}var C=aw(D.direction),B=bn(H,C,H.session.getRangeBoundaryPosition(E,C),D),A="",z=[],y,x,w,v,u,t,s=null;while(y=B.next()){x=y.character,!F&&!D.caseSensitive&&(x=x.toLowerCase()),C?(z.unshift(y),A=x+A):(z.push(y),A+=x);if(F){u=G.exec(A);if(u){if(t){w=u.index,v=w+u[0].length;if(!C&&v<A.length||C&&w>0){s=p(w,v);break}}else{t=!0}}}else{if((w=A.indexOf(G))!=-1){s=p(w,w+G.length);break}}}return t&&(s=p(w,v)),B.dispose(),s}function br(b){return function(){var a=!!aK,h=bz(),g=[h].concat(aI.toArray(arguments)),f=b.apply(this,g);return a||bu(),f}}function bc(d,c){return br(function(s,r,q,p){typeof q=="undefined"&&(q=r,r=aM),p=am(p,bj);var o=bm(p.characterOptions),n=al(p.wordOptions),m=d;c&&(m=q>=0,this.collapse(!m));var b=af(s.getRangeBoundaryPosition(this,m),r,q,o,n),a=b.position;return this[m?"setStart":"setEnd"](a.node,a.offset),b.unitsMoved})}function aG(b){return br(function(a,l){l=bm(l);var k,j=aa(a,this,l,!b),i=0;while((k=j.next())&&aB.test(k.character)){++i}j.dispose();var h=i>0;return h&&this[b?"moveStart":"moveEnd"]("character",b?i:-i,{characterOptions:l}),h})}function ai(b){return br(function(a,f){var e=!1;return this.changeEachRange(function(c){e=c[b](f)||e}),e})}var aN="undefined",aM="character",aL="word",aJ=aP.dom,aI=aP.util,aH=aI.extend,aF=aJ.getBody,aE=/^[ \t\f\r\n]+$/,aC=/^[ \t\f\r]+$/,aB=/^[\t-\r \u0085\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]+$/,aA=/^[\t \u00A0\u1680\u180E\u2000-\u200B\u202F\u205F\u3000]+$/,az=/^[\n-\r\u0085\u2028\u2029]$/,ay="en",aw=aP.Selection.isDirectionBackward,av=!1,au=!1,at=!1,ar=!0;var ap={includeBlockContentTrailingSpace:!0,includeSpaceBeforeBr:!0,includeSpaceBeforeBlock:!0,includePreLineTrailingSpace:!0},ao={includeBlockContentTrailingSpace:!ar,includeSpaceBeforeBr:!au,includeSpaceBeforeBlock:!at,includePreLineTrailingSpace:!0},an={en:{wordRegex:/[a-z0-9]+('[a-z0-9]+)*/gi,includeTrailingSpace:!1,tokenizer:aq}},bk={caseSensitive:!1,withinRange:null,wholeWordsOnly:!1,wrap:!1,direction:"forward",wordOptions:null,characterOptions:null},bj={wordOptions:null,characterOptions:null},bi={wordOptions:null,characterOptions:null,trim:!1,trimStart:!0,trimEnd:!0},bh={wordOptions:null,characterOptions:null,direction:"forward"},bf=aJ.getComputedStyleProperty,be;(function(){var d=document.createElement("table"),c=aF(document);c.appendChild(d),be=bf(d,"display")=="block",c.removeChild(d)})(),aP.features.tableCssDisplayBlock=be;var bd={table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell"};aT.prototype={get:function(b){return this.store.hasOwnProperty(b)?this.store[b]:null},set:function(d,c){return this.store[d]=c}};var aS=0,bt=0,a2={getPosition:function(d){var c=this.positions;return c.get(d)||c.set(d,new by(this,d))},toString:function(){return"[NodeWrapper("+aJ.inspectNode(this.node)+")]"}};bp.prototype=a2;var ax="EMPTY",ag="NON_SPACE",ac="UNCOLLAPSIBLE_SPACE",bw="COLLAPSIBLE_SPACE",bq="TRAILING_SPACE_BEFORE_BLOCK",a8="TRAILING_SPACE_IN_BLOCK",aD="TRAILING_SPACE_BEFORE_BR",ah="PRE_LINE_TRAILING_SPACE_BEFORE_LINE_BREAK",ad="TRAILING_LINE_BREAK_AFTER_BR";aH(a2,{isCharacterDataNode:aR("isCharacterDataNode",aJ.isCharacterDataNode,"node"),getNodeIndex:aR("nodeIndex",aJ.getNodeIndex,"node"),getLength:aR("nodeLength",aJ.getNodeLength,"node"),containsPositions:aR("containsPositions",a4,"node"),isWhitespace:aR("isWhitespace",aX,"node"),isCollapsedWhitespace:aR("isCollapsedWhitespace",aW,"node"),getComputedDisplay:aR("computedDisplay",ba,"node"),isCollapsed:aR("collapsed",aV,"node"),isIgnored:aR("ignored",aU,"node"),next:aR("nextPos",aZ,"node"),previous:aR("previous",aY,"node"),getTextNodeInfo:aR("textNodeInfo",function(g){var f=null,j=!1,i=bf(g.parentNode,"whiteSpace"),h=i=="pre-line";if(h){f=aC,j=!0}else{if(i=="normal"||i=="nowrap"){f=aE,j=!0}}return{node:g,text:g.data,spaceRegex:f,collapseSpaces:j,preLine:h}},"node"),hasInnerText:aR("hasInnerText",function(i,h){var n=this.session,m=n.getPosition(i.parentNode,this.getNodeIndex()+1),l=n.getPosition(i,0),k=h?m:l,j=h?l:m;while(k!==j){k.prepopulateChar();if(k.isDefinitelyNonEmpty()){return !0}k=h?k.previousVisible():k.nextVisible()}return !1},"node"),isRenderedBlock:aR("isRenderedBlock",function(f){var e=f.getElementsByTagName("br");for(var h=0,g=e.length;h<g;++h){if(!aV(e[h])){return !0}}return this.hasInnerText()},"node"),getTrailingSpace:aR("trailingSpace",function(d){if(d.tagName.toLowerCase()=="br"){return""}switch(this.getComputedDisplay()){case"inline":var c=d.lastChild;while(c){if(!aU(c)){return c.nodeType==1?this.session.getNodeWrapper(c).getTrailingSpace():""}c=c.previousSibling}break;case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":break;case"table-cell":return"	";default:return this.isRenderedBlock(!0)?"\n":""}return""},"node"),getLeadingSpace:aR("leadingSpace",function(b){switch(this.getComputedDisplay()){case"inline":case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":case"table-cell":break;default:return this.isRenderedBlock(!1)?"\n":""}return""},"node")});var bg={character:"",characterType:ax,isBr:!1,prepopulateChar:function(){var x=this;if(!x.prepopulatedChar){var w=x.node,v=x.offset,u="",t=ax,s=!1;if(v>0){if(w.nodeType==3){var r=w.data,q=r.charAt(v-1),p=x.nodeWrapper.getTextNodeInfo(),o=p.spaceRegex;p.collapseSpaces?o.test(q)?v>1&&o.test(r.charAt(v-2))||(p.preLine&&r.charAt(v)==="\n"?(u=" ",t=ah):(u=" ",t=bw)):(u=q,t=ag,s=!0):(u=q,t=ac,s=!0)}else{var n=w.childNodes[v-1];n&&n.nodeType==1&&!aV(n)&&(n.tagName.toLowerCase()=="br"?(u="\n",x.isBr=!0,t=bw,s=!1):x.checkForTrailingSpace=!0);if(!u){var m=w.childNodes[v];m&&m.nodeType==1&&!aV(m)&&(x.checkForLeadingSpace=!0)}}}x.prepopulatedChar=!0,x.character=u,x.characterType=t,x.isCharInvariant=s}},isDefinitelyNonEmpty:function(){var b=this.characterType;return b==ag||b==ac},resolveLeadingAndTrailingSpaces:function(){this.prepopulatedChar||this.prepopulateChar();if(this.checkForTrailingSpace){var d=this.session.getNodeWrapper(this.node.childNodes[this.offset-1]).getTrailingSpace();d&&(this.isTrailingSpace=!0,this.character=d,this.characterType=bw),this.checkForTrailingSpace=!1}if(this.checkForLeadingSpace){var c=this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace();c&&(this.isLeadingSpace=!0,this.character=c,this.characterType=bw),this.checkForLeadingSpace=!1}},getPrecedingUncollapsedPosition:function(e){var d=this,f;while(d=d.previousVisible()){f=d.getCharacter(e);if(f!==""){return d}}return null},getCharacter:function(t){function k(){return m||(n=l.getPrecedingUncollapsedPosition(t),m=!0),n}this.resolveLeadingAndTrailingSpaces();if(this.isCharInvariant){return this.character}var s=["character",t.includeSpaceBeforeBr,t.includeBlockContentTrailingSpace,t.includePreLineTrailingSpace].join("_"),r=this.cache.get(s);if(r!==null){return r}var q="",p=this.characterType==bw,o,n,m=!1,l=this;if(p){if(this.character!=" "||!!k()&&!n.isTrailingSpace&&n.character!="\n"){if(this.character=="\n"&&this.isLeadingSpace){k()&&n.character!="\n"&&(q="\n")}else{o=this.nextUncollapsed();if(o){o.isBr?this.type=aD:o.isTrailingSpace&&o.character=="\n"?this.type=a8:o.isLeadingSpace&&o.character=="\n"&&(this.type=bq);if(o.character==="\n"){if(this.type!=aD||!!t.includeSpaceBeforeBr){if(this.type!=bq||!!t.includeSpaceBeforeBlock){if(this.type!=a8||!o.isTrailingSpace||!!t.includeBlockContentTrailingSpace){if(this.type!=ah||o.type!=ag||!!t.includePreLineTrailingSpace){this.character==="\n"?o.isTrailingSpace?this.isTrailingSpace||this.isBr&&(o.type=ad,k()&&n.isLeadingSpace&&n.character=="\n"&&(o.character="")):q="\n":this.character===" "&&(q=" ")}}}}}else{q=this.character}}}}}else{this.character!=="\n"||!!(o=this.nextUncollapsed())&&!o.isTrailingSpace}return this.cache.set(s,q),q},equals:function(b){return !!b&&this.node===b.node&&this.offset===b.offset},inspect:bs,toString:function(){return this.character}};by.prototype=bg,aH(bg,{next:aR("nextPos",function(j){var i=j.nodeWrapper,p=j.node,o=j.offset,n=i.session;if(!p){return null}var m,l,k;return o==i.getLength()?(m=p.parentNode,l=m?i.getNodeIndex()+1:0):i.isCharacterDataNode()?(m=p,l=o+1):(k=p.childNodes[o],n.getNodeWrapper(k).containsPositions()?(m=k,l=0):(m=p,l=o+1)),m?n.getPosition(m,l):null}),previous:aR("previous",function(j){var f=j.nodeWrapper,p=j.node,o=j.offset,n=f.session,m,l,k;return o==0?(m=p.parentNode,l=m?f.getNodeIndex():0):f.isCharacterDataNode()?(m=p,l=o-1):(k=p.childNodes[o-1],n.getNodeWrapper(k).containsPositions()?(m=k,l=aJ.getNodeLength(k)):(m=p,l=o-1)),m?n.getPosition(m,l):null}),nextVisible:aR("nextVisible",function(g){var f=g.next();if(!f){return null}var j=f.nodeWrapper,i=f.node,h=f;return j.isCollapsed()&&(h=j.session.getPosition(i.parentNode,j.getNodeIndex()+1)),h}),nextUncollapsed:aR("nextUncollapsed",function(d){var c=d;while(c=c.nextVisible()){c.resolveLeadingAndTrailingSpaces();if(c.character!==""){return c}}return null}),previousVisible:aR("previousVisible",function(g){var f=g.previous();if(!f){return null}var j=f.nodeWrapper,i=f.node,h=f;return j.isCollapsed()&&(h=j.session.getPosition(i.parentNode,j.getNodeIndex())),h})});var aK=null,aj=function(){function e(g){var c=new aT;return{get:function(i){var h=c.get(i[g]);if(h){for(var b=0,a;a=h[b++];){if(a.node===i){return a}}}return null},set:function(h){var b=h.node[g],a=c.get(b)||c.set(b,[]);a.push(h)}}}function f(){this.initCaches()}var d=aI.isHostProperty(document.documentElement,"uniqueID");return f.prototype={initCaches:function(){this.elementCache=d?function(){var b=new aT;return{get:function(a){return b.get(a.uniqueID)},set:function(a){b.set(a.node.uniqueID,a)}}}():e("tagName"),this.textNodeCache=e("data"),this.otherNodeCache=e("nodeName")},getNodeWrapper:function(h){var g;switch(h.nodeType){case 1:g=this.elementCache;break;case 3:g=this.textNodeCache;break;default:g=this.otherNodeCache}var i=g.get(h);return i||(i=new bp(h,this),g.set(i)),i},getPosition:function(g,c){return this.getNodeWrapper(g).getPosition(c)},getRangeBoundaryPosition:function(h,g){var i=g?"start":"end";return this.getPosition(h[i+"Container"],h[i+"Offset"])},detach:function(){this.elementCache=this.textNodeCache=this.otherNodeCache=null}},f}();aH(aJ,{nextNode:aZ,previousNode:aY});var aQ=Array.prototype.indexOf?function(d,c){return d.indexOf(c)}:function(f,e){for(var h=0,g=f.length;h<g;++h){if(f[h]===e){return h}}return -1};aH(aP.rangePrototype,{moveStart:bc(!0,!1),moveEnd:bc(!1,!1),move:bc(!0,!0),trimStart:aG(!0),trimEnd:aG(!1),trim:br(function(f,e){var h=this.trimStart(e),g=this.trimEnd(e);return h||g}),expand:br(function(B,A,z){var y=!1;z=am(z,bi);var x=bm(z.characterOptions);A||(A=aM);if(A==aL){var w=al(z.wordOptions),v=B.getRangeBoundaryPosition(this,!0),u=B.getRangeBoundaryPosition(this,!1),t=ak(v,x,w),s=t.nextEndToken(),r=s.chars[0].previousVisible(),q,e;if(this.collapsed){q=s}else{var d=ak(u,x,w);q=d.previousStartToken()}return e=q.chars[q.chars.length-1],r.equals(v)||(this.setStart(r.node,r.offset),y=!0),e&&!e.equals(u)&&(this.setEnd(e.node,e.offset),y=!0),z.trim&&(z.trimStart&&(y=this.trimStart(x)||y),z.trimEnd&&(y=this.trimEnd(x)||y)),y}return this.moveEnd(aM,1,z)}),text:br(function(d,c){return this.collapsed?"":bv(d,this,bm(c)).join("")}),selectCharacters:br(function(h,g,l,k,j){var i={characterOptions:j};g||(g=aF(this.getDocument())),this.selectNodeContents(g),this.collapse(!0),this.moveStart("character",l,i),this.collapse(!0),this.moveEnd("character",k-l,i)}),toCharacterRange:br(function(r,q,p){q||(q=aF(this.getDocument()));var o=q.parentNode,n=aJ.getNodeIndex(q),m=aJ.comparePoints(this.startContainer,this.endContainer,o,n)==-1,l=this.cloneRange(),i,f;return m?(l.setStartAndEnd(this.startContainer,this.startOffset,o,n),i=-l.text(p).length):(l.setStartAndEnd(o,n,this.startContainer,this.startOffset),i=l.text(p).length),f=i+this.text(p).length,{start:i,end:f}}),findText:br(function(x,w,v){v=am(v,bk),v.wholeWordsOnly&&(v.wordOptions=al(v.wordOptions),v.wordOptions.includeTrailingSpace=!1);var u=aw(v.direction),t=v.withinRange;t||(t=aP.createRange(),t.selectNodeContents(this.getDocument()));var s=w,r=!1;typeof s=="string"?v.caseSensitive||(s=s.toLowerCase()):r=!0;var q=x.getRangeBoundaryPosition(this,!u),p=t.comparePoint(q.node,q.offset);p===-1?q=x.getRangeBoundaryPosition(t,!0):p===1&&(q=x.getRangeBoundaryPosition(t,!1));var o=q,n=!1,a;for(;;){a=bx(o,s,r,t,v);if(a){if(a.valid){return this.setStartAndEnd(a.startPos.node,a.startPos.offset,a.endPos.node,a.endPos.offset),!0}o=u?a.startPos:a.endPos}else{if(!v.wrap||!!n){return !1}t=t.cloneRange(),o=x.getRangeBoundaryPosition(t,!u),t.setBoundary(q.node,q.offset,u),n=!0}}}),pasteHtml:function(e){this.deleteContents();if(e){var d=this.createContextualFragment(e),f=d.lastChild;this.insertNode(d),this.collapseAfter(f)}}}),aH(aP.selectionPrototype,{expand:br(function(e,d,f){this.changeEachRange(function(b){b.expand(d,f)})}),move:br(function(h,g,l,k){var j=0;if(this.focusNode){this.collapse(this.focusNode,this.focusOffset);var i=this.getRangeAt(0);k||(k={}),k.characterOptions=bl(k.characterOptions),j=i.move(g,l,k),this.setSingleRange(i)}return j}),trimStart:ai("trimStart"),trimEnd:ai("trimEnd"),trim:ai("trim"),selectCharacters:br(function(a,n,m,l,k,j){var i=aP.createRange(n);i.selectCharacters(n,m,l,j),this.setSingleRange(i,k)}),saveCharacterRanges:br(function(r,q,p){var o=this.getAllRanges(),n=o.length,m=[],l=n==1&&this.isBackward();for(var k=0,j=o.length;k<j;++k){m[k]={characterRange:o[k].toCharacterRange(q,p),backward:l,characterOptions:p}}return m}),restoreCharacterRanges:br(function(a,p,o){this.removeAllRanges();for(var n=0,m=o.length,l,k,j;n<m;++n){k=o[n],j=k.characterRange,l=aP.createRange(p),l.selectCharacters(p,j.start,j.end,k.characterOptions),this.addRange(l,k.backward)}}),text:br(function(g,f){var j=[];for(var i=0,h=this.rangeCount;i<h;++i){j[i]=this.getRangeAt(i).text(f)}return j.join("")})}),aP.innerText=function(a,h){var g=aP.createRange(a);g.selectNodeContents(a);var f=g.text(h);return g.detach(),f},aP.createWordIterator=function(r,q,p){var o=bz();p=am(p,bh);var n=bm(p.characterOptions),m=al(p.wordOptions),l=o.getPosition(r,q),k=ak(l,n,m),j=aw(p.direction);return{next:function(){return j?k.previousStartToken():k.nextEndToken()},dispose:function(){k.dispose(),this.next=function(){}}}},aP.noMutation=function(d){var c=bz();d(c),bu()},aP.noMutation.createEntryPointFunction=br,aP.textRange={isBlockNode:a6,isCollapsedWhitespaceNode:aW,createPosition:br(function(e,d,f){return e.getPosition(d,f)})}});