UNPKG

hdjs

Version:
6 lines 416 kB
webpackJsonphdjs([0],{505:function(e,t){!function(){function e(e,i){return n(e||self.document.URL||self.location.href,i||t())}function t(){var e=document.getElementsByTagName("script");return e[e.length-1].src}function n(e,t){var n=t;return/^(\/|\\\\)/.test(t)?n=/^.+?\w(\/|\\\\)/.exec(e)[0]+t.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(t)||(e=e.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),n=e+""+t),i(n)}function i(e){var t=/^[a-z]+:\/\//.exec(e)[0],n=null,i=[];for(e=e.replace(t,"").split("?")[0].split("#")[0],e=e.replace(/\\/g,"/").split(/\//),e[e.length-1]="";e.length;)".."===(n=e.shift())?i.pop():"."!==n&&i.push(n);return t+i.join("/")}var o=window.UEDITOR_HOME_URL||e();window.UEDITOR_CONFIG={UEDITOR_HOME_URL:o,serverUrl:o+"php/controller.php",toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imageright","imagecenter","|","simpleupload","insertimage","hdimage","emotion","scrawl","insertvideo","music","attachment","map","gmap","insertframe","insertcode","webapp","pagebreak","template","background","|","horizontal","date","time","spechars","snapscreen","wordimage","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","charts","|","print","preview","searchreplace","help","drafts"]]},window.UE={getUEBasePath:e}}()},506:function(module,exports){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! * UEditor * version: ueditor * build: Wed Aug 10 2016 11:06:02 GMT+0800 (CST) */ !function(){function getListener(e,t,n){var i;return t=t.toLowerCase(),(i=e.__allListeners||n&&(e.__allListeners={}))&&(i[t]||n&&(i[t]=[]))}function getDomNode(e,t,n,i,o,r){var a,s=i&&e[t];for(!s&&(s=e[n]);!s&&(a=(a||e).parentNode);){if("BODY"==a.tagName||r&&!r(a))return null;s=a[n]}return s&&o&&!o(s)?getDomNode(s,t,n,!1,o):s}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor=window.UE||{},UE.plugins={},UE.commands={},UE.instants={},UE.I18N={},UE._customizeUI={},UE.version="1.4.3";var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,n={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};n.gecko="Gecko"==navigator.product&&!n.webkit&&!n.opera&&!n.ie;var i=0;if(n.ie){var o=e.match(/(?:msie\s([\w.]+))/),r=e.match(/(?:trident.*rv:([\w.]+))/);i=o&&r&&o[1]&&r[1]?Math.max(1*o[1],1*r[1]):o&&o[1]?1*o[1]:r&&r[1]?1*r[1]:0,n.ie11Compat=11==document.documentMode,n.ie9Compat=9==document.documentMode,n.ie8=!!document.documentMode,n.ie8Compat=8==document.documentMode,n.ie7Compat=7==i&&!document.documentMode||7==document.documentMode,n.ie6Compat=i<7||n.quirks,n.ie9above=i>8,n.ie9below=i<9,n.ie11above=i>10,n.ie11below=i<11}if(n.gecko){var a=e.match(/rv:([\d\.]+)/);a&&(a=a[1].split("."),i=1e4*a[0]+100*(a[1]||0)+1*(a[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(n.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(n.safari=+(RegExp.$1||RegExp.$2)),n.opera&&(i=parseFloat(t.version())),n.webkit&&(i=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),n.version=i,n.isCompatible=!n.mobile&&(n.ie&&i>=6||n.gecko&&i>=10801||n.opera&&i>=9.5||n.air&&i>=1||n.webkit&&i>=522||!1),n}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(e,t,n){if(null!=e)if(e.length===+e.length){for(var i=0,o=e.length;i<o;i++)if(!1===t.call(n,e[i],i,e))return!1}else for(var r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return!1},makeInstance:function(e){var t=new Function;return t.prototype=e,e=new t,t.prototype=null,e},extend:function(e,t,n){if(t)for(var i in t)n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e},extend2:function(e){for(var t=arguments,n=1;n<t.length;n++){var i=t[n];for(var o in i)e.hasOwnProperty(o)||(e[o]=i[o])}return e},inherits:function(e,t){var n=e.prototype,i=utils.makeInstance(t.prototype);return utils.extend(i,n,!0),e.prototype=i,i.constructor=e},bind:function(e,t){return function(){return e.apply(t,arguments)}},defer:function(e,t,n){var i;return function(){n&&clearTimeout(i),i=setTimeout(e,t)}},indexOf:function(e,t,n){var i=-1;return n=this.isNumber(n)?n:0,this.each(e,function(e,o){if(o>=n&&e===t)return i=o,!1}),i},removeItem:function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]===t&&(e.splice(n,1),n--)},trim:function(e){return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(e){if(!e)return{};e=utils.isArray(e)?e:e.split(",");for(var t,n=0,i={};t=e[n++];)i[t.toUpperCase()]=i[t]=1;return i},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,function(e,t){return t?e:{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]}):""},unhtmlForUrl:function(e,t){return e?e.replace(t||/[<">']/g,function(e){return{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(e){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">","&#39;":"'","&nbsp;":" "}[e]}):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={float:void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}}(),loadFile:function(){function e(e,n){try{for(var i,o=0;i=t[o++];)if(i.doc===e&&i.url==(n.src||n.href))return i}catch(e){return null}}var t=[];return function(n,i,o){var r=e(n,i);if(r)return void(r.ready?o&&o():r.funs.push(o));if(t.push({doc:n,url:i.src||i.href,funs:[o]}),!n.body){var a=[];for(var s in i)"tag"!=s&&a.push(s+'="'+i[s]+'"');return void n.write("<"+i.tag+" "+a.join(" ")+" ></"+i.tag+">")}if(!i.id||!n.getElementById(i.id)){var l=n.createElement(i.tag);delete i.tag;for(var s in i)l.setAttribute(s,i[s]);l.onload=l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(r=e(n,i),r.funs.length>0){r.ready=1;for(var t;t=r.funs.pop();)t()}l.onload=l.onreadystatechange=null}},l.onerror=function(){throw Error("The load "+(i.href||i.src)+" fails,check the url settings of file ueditor.config.js ")},n.getElementsByTagName("head")[0].appendChild(l)}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var n=t.split(",");if(n.length>3)return"";t="#";for(var i,o=0;i=n[o++];)i=parseInt(i.replace(/[^\d]/gi,""),10).toString(16),t+=1==i.length?"0"+i:i;t=t.toUpperCase()}return t},optCss:function(e){function t(e,t){if(!e)return"";var n=e.top,i=e.bottom,o=e.left,r=e.right,a="";if(n&&o&&i&&r)a+=";"+t+":"+(n==i&&i==o&&o==r?n:n==i&&o==r?n+" "+o:o==r?n+" "+o+" "+i:n+" "+r+" "+i+" "+o)+";";else for(var s in e)a+=";"+t+"-"+s+":"+e[s]+";";return a}var n,i;return e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(e,t,o,r){if(1==r.split(" ").length)switch(t){case"padding":return!n&&(n={}),n[o]=r,"";case"margin":return!i&&(i={}),i[o]=r,"";case"border":return"initial"==r?"":e}return e}),e+=t(n,"padding")+t(i,"margin"),e.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(e,t){return t?t+";;":";"})},clone:function(e,t){var n;t=t||{};for(var i in e)e.hasOwnProperty(i)&&(n=e[i],"object"==(void 0===n?"undefined":_typeof(n))?(t[i]=utils.isArray(n)?[]:{},utils.clone(e[i],t[i])):t[i]=n);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,function(n,i,o){e=i,t=o}),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){function e(e){e.isReady=!0;for(var n;n=t.pop();n());}var t=[];return function(n,i){i=i||window;var o=i.document;n&&t.push(n),"complete"===o.readyState?e(o):(o.isReady&&e(o),browser.ie&&11!=browser.version?(!function(){if(!o.isReady){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}e(o)}}(),i.attachEvent("onload",function(){e(o)})):(o.addEventListener("DOMContentLoaded",function(){o.removeEventListener("DOMContentLoaded",arguments.callee,!1),e(o)},!1),i.addEventListener("load",function(){e(o)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(e,t,n){var i,o;if(void 0===t||t&&t.nodeType&&9==t.nodeType){if(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.indexList||(n.indexList={}),void 0!==(o=i[e]))return n.styleSheets[o].cssText}else{if(n=n||document,i=n.indexList||(n.indexList={}),o=i[e],""===t)return void 0!==o&&(n.styleSheets[o].cssText="",delete i[e],!0);void 0!==o?sheetStyle=n.styleSheets[o]:(sheetStyle=n.createStyleSheet("",o=n.styleSheets.length),i[e]=o),sheetStyle.cssText=t}}:function(e,t,n){var i;return void 0===t||t&&t.nodeType&&9==t.nodeType?(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.getElementById(e),i?i.innerHTML:void 0):(n=n||document,i=n.getElementById(e),""===t?!!i&&(i.parentNode.removeChild(i),!0):void(i?i.innerHTML=t:(i=n.createElement("style"),i.id=e,i.innerHTML=t,n.getElementsByTagName("head")[0].appendChild(i))))},sort:function(e,t){t=t||function(e,t){return e.localeCompare(t)};for(var n=0,i=e.length;n<i;n++)for(var o=n,r=e.length;o<r;o++)if(t(e[n],e[o])>0){var a=e[n];e[n]=e[o],e[o]=a}return e},serializeParam:function(e){var t=[];for(var n in e)if("method"!=n&&"timeout"!=n&&"async"!=n)if("function"!=_typeof(e[n]).toLowerCase()&&"object"!=_typeof(e[n]).toLowerCase())t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));else if(utils.isArray(e[n]))for(var i=0;i<e[n].length;i++)t.push(encodeURIComponent(n)+"[]="+encodeURIComponent(e[n][i]));return t.join("&")},formatUrl:function(e){var t=e.replace(/&&/g,"&");return t=t.replace(/\?&/g,"?"),t=t.replace(/&$/g,""),t=t.replace(/&#/g,"#"),t=t.replace(/&+/g,"&")},isCrossDomainUrl:function(e){var t=document.createElement("a");return t.href=e,browser.ie&&(t.href=t.href),!(t.protocol==location.protocol&&t.hostname==location.hostname&&(t.port==location.port||"80"==t.port&&""==location.port||""==t.port&&"80"==location.port))},clearEmptyAttrs:function(e){for(var t in e)""===e[t]&&delete e[t];return e},str2json:function(e){return utils.isString(e)?window.JSON?JSON.parse(e):new Function("return "+utils.trim(e||""))():null},json2str:function(){if(window.JSON)return JSON.stringify;var e=function(e){return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/["\\\x00-\x1f]/g,function(e){var t=o[e];return t||(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})),'"'+e+'"'},t=function(e){var t,n,i,o=["["],r=e.length;for(n=0;n<r;n++)switch(i=e[n],void 0===i?"undefined":_typeof(i)){case"undefined":case"function":case"unknown":break;default:t&&o.push(","),o.push(utils.json2str(i)),t=1}return o.push("]"),o.join("")},n=function(e){return e<10?"0"+e:e},i=function(e){return'"'+e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+'"'},o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(n){switch(void 0===n?"undefined":_typeof(n)){case"undefined":return"undefined";case"number":return isFinite(n)?String(n):"null";case"string":return e(n);case"boolean":return String(n);default:if(null===n)return"null";if(utils.isArray(n))return t(n);if(utils.isDate(n))return i(n);var o,r,a=["{"],s=utils.json2str;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l))switch(r=n[l],void 0===r?"undefined":_typeof(r)){case"undefined":case"unknown":case"function":break;default:o&&a.push(","),o=1,a.push(s(l)+":"+s(r))}return a.push("}"),a.join("")}}}()};utils.each(["String","Function","Array","Number","RegExp","Object","Date"],function(e){UE.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}});var EventBase=UE.EventBase=function(){};EventBase.prototype={addListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var n,i=0;n=e[i++];)getListener(this,n,!0).push(t)},on:function(e,t){return this.addListener(e,t)},off:function(e,t){return this.removeListener(e,t)},trigger:function(){return this.fireEvent.apply(this,arguments)},removeListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var n,i=0;n=e[i++];)utils.removeItem(getListener(this,n)||[],t)},fireEvent:function(){var e=arguments[0];e=utils.trim(e).split(" ");for(var t,n=0;t=e[n++];){var i,o,r,a=getListener(this,t);if(a)for(r=a.length;r--;)if(a[r]){if(!0===(o=a[r].apply(this,arguments)))return o;void 0!==o&&(i=o)}(o=this["on"+t.toLowerCase()])&&(i=o.apply(this,arguments))}return i}};var dtd=dom.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=utils.extend2,n=e({isindex:1,fieldset:1}),i=e({input:1,button:1,select:1,textarea:1,label:1}),o=t(e({a:1}),i),r=t({iframe:1},o),a=e({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),s=e({ins:1,del:1,script:1,style:1}),l=t(e({b:1,acronym:1,bdo:1,var:1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),s),d=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),c=t(e({p:1}),d),u=t(e({iframe:1}),d,i),m=e({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,var:1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),f=t(e({a:0}),u),h=e({tr:1}),p=e({"#":1}),g=t(e({param:1}),m),v=t(e({form:1}),n,r,a,c),b=e({li:1,ol:1,ul:1}),y=e({style:1,script:1}),C=e({base:1,link:1,meta:1,title:1}),x=t(C,y),w=e({head:1,body:1}),N=e({html:1}),U=e({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),E=e({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return e({$nonBodyContent:t(N,w,C),$block:U,$inline:f,$inlineWithA:t(e({a:1}),f),$body:t(e({script:1,style:1}),U),$cdata:e({script:1,style:1}),$empty:E,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:e({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,var:1}),$removeEmptyBlock:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),html:w,head:x,style:p,script:p,body:v,base:{},link:{},meta:{},title:p,col:{},tr:e({td:1,th:1}),img:{},embed:{},colgroup:e({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:v,td:v,br:{},th:v,center:v,kbd:f,button:t(c,a),basefont:{},h5:f,h4:f,samp:f,h6:f,ol:b,h1:f,h3:f,option:p,h2:f,form:t(n,r,a,c),select:e({optgroup:1,option:1}),font:f,ins:f,menu:b,abbr:f,label:f,table:e({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:f,tfoot:h,cite:f,li:v,input:{},iframe:v,strong:f,textarea:p,noframes:v,big:f,small:f,span:e({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:f,dt:f,sub:f,optgroup:e({option:1}),param:{},bdo:f,var:f,div:v,object:g,sup:f,dd:v,strike:f,area:{},dir:b,map:t(e({area:1,form:1,p:1}),n,s,a),applet:g,dl:e({dt:1,dd:1}),del:f,isindex:{},fieldset:t(e({legend:1}),m),thead:h,ul:b,acronym:f,b:f,a:t(e({a:1}),u),blockquote:t(e({td:1,tr:1,tbody:1,li:1}),v),caption:f,i:f,u:f,tbody:h,s:f,address:t(r,c),tt:f,legend:f,q:f,pre:t(l,o),p:t(e({a:1}),f),em:f,dfn:f})}(),attrFix=ie&&browser.version<9?{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},styleBlock=utils.listToMap(["-webkit-box","-moz-box","block","list-item","table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption"]),domUtils=dom.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:ie&&"6"==browser.version?"\ufeff":"​",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(e,t){if(e===t)return 0;var n,i=[e],o=[t];for(n=e;n=n.parentNode;){if(n===t)return 10;i.push(n)}for(n=t;n=n.parentNode;){if(n===e)return 20;o.push(n)}if(i.reverse(),o.reverse(),i[0]!==o[0])return 1;for(var r=-1;r++,i[r]===o[r];);for(e=i[r],t=o[r];e=e.nextSibling;)if(e===t)return 4;return 2},getNodeIndex:function(e,t){for(var n=e,i=0;n=n.previousSibling;)t&&3==n.nodeType?n.nodeType!=n.nextSibling.nodeType&&i++:i++;return i},inDoc:function(e,t){return 10==domUtils.getPosition(e,t)},findParent:function(e,t,n){if(e&&!domUtils.isBody(e))for(e=n?e:e.parentNode;e;){if(!t||t(e)||domUtils.isBody(e))return t&&!t(e)&&domUtils.isBody(e)?null:e;e=e.parentNode}return null},findParentByTagName:function(e,t,n,i){return t=utils.listToMap(utils.isArray(t)?t:[t]),domUtils.findParent(e,function(e){return t[e.tagName]&&!(i&&i(e))},n)},findParents:function(e,t,n,i){for(var o=t&&(n&&n(e)||!n)?[e]:[];e=domUtils.findParent(e,n);)o.push(e);return i?o:o.reverse()},insertAfter:function(e,t){return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)},remove:function(e,t){var n,i=e.parentNode;if(i){if(t&&e.hasChildNodes())for(;n=e.firstChild;)i.insertBefore(n,e);i.removeChild(e)}return e},getNextDomNode:function(e,t,n,i){return getDomNode(e,"firstChild","nextSibling",t,n,i)},getPreDomNode:function(e,t,n,i){return getDomNode(e,"lastChild","previousSibling",t,n,i)},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getCommonAncestor:function(e,t){if(e===t)return e;for(var n=[e],i=[t],o=e,r=-1;o=o.parentNode;){if(o===t)return o;n.push(o)}for(o=t;o=o.parentNode;){if(o===e)return o;i.push(o)}for(n.reverse(),i.reverse();r++,n[r]===i[r];);return 0==r?null:n[r-1]},clearEmptySibling:function(e,t,n){function i(e,t){for(var n;e&&!domUtils.isBookmarkNode(e)&&(domUtils.isEmptyInlineElement(e)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(e.nodeValue));)n=e[t],domUtils.remove(e),e=n}!t&&i(e.nextSibling,"nextSibling"),!n&&i(e.previousSibling,"previousSibling")},split:function(e,t){var n=e.ownerDocument;if(browser.ie&&t==e.nodeValue.length){var i=n.createTextNode("");return domUtils.insertAfter(e,i)}var o=e.splitText(t);if(browser.ie8){var r=n.createTextNode("");domUtils.insertAfter(o,r),domUtils.remove(r)}return o},isWhitespace:function(e){return!new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)},getXY:function(e){for(var t=0,n=0;e.offsetParent;)n+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:n}},on:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)for(;o--;)if(t=i[o],e.addEventListener)e.addEventListener(t,n,!1);else{n._d||(n._d={els:[]});var r=t+n.toString(),a=utils.indexOf(n._d.els,e);n._d[r]&&-1!=a||(-1==a&&n._d.els.push(e),n._d[r]||(n._d[r]=function(e){return n.call(e.srcElement,e||window.event)}),e.attachEvent("on"+t,n._d[r]))}e=null},un:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)for(;o--;)if(t=i[o],e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=t+n.toString();try{e.detachEvent("on"+t,n._d?n._d[r]:n)}catch(e){}if(n._d&&n._d[r]){var a=utils.indexOf(n._d.els,e);-1!=a&&n._d.els.splice(a,1),0==n._d.els.length&&delete n._d[r]}}},isSameElement:function(e,t){if(e.tagName!=t.tagName)return!1;var n=e.attributes,i=t.attributes;if(!ie&&n.length!=i.length)return!1;for(var o,r,a=0,s=0,l=0;o=n[l++];){if("style"==o.nodeName){if(o.specified&&a++,domUtils.isSameStyle(e,t))continue;return!1}if(ie){if(!o.specified)continue;a++,r=i.getNamedItem(o.nodeName)}else r=t.attributes[o.nodeName];if(!r.specified||o.nodeValue!=r.nodeValue)return!1}if(ie){for(l=0;r=i[l++];)r.specified&&s++;if(a!=s)return!1}return!0},isSameStyle:function(e,t){var n=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),i=t.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){if(n=e.style,i=t.style,n.length!=i.length)return!1;for(var o in n)if(!/^(\d+|csstext)$/i.test(o)&&n[o]!=i[o])return!1;return!0}if(!n||!i)return n==i;if(n=n.split(";"),i=i.split(";"),n.length!=i.length)return!1;for(var r,a=0;r=n[a++];)if(-1==utils.indexOf(i,r))return!1;return!0},isBlockElm:function(e){return 1==e.nodeType&&(dtd.$block[e.tagName]||styleBlock[domUtils.getComputedStyle(e,"display")])&&!dtd.$nonChild[e.tagName]},isBody:function(e){return e&&1==e.nodeType&&"body"==e.tagName.toLowerCase()},breakParent:function(e,t){var n,i,o,r=e,a=e;do{for(r=r.parentNode,i?(n=r.cloneNode(!1),n.appendChild(i),i=n,n=r.cloneNode(!1),n.appendChild(o),o=n):(i=r.cloneNode(!1),o=i.cloneNode(!1));n=a.previousSibling;)i.insertBefore(n,i.firstChild);for(;n=a.nextSibling;)o.appendChild(n);a=r}while(t!==r);return n=t.parentNode,n.insertBefore(i,t),n.insertBefore(o,t),n.insertBefore(e,o),domUtils.remove(t),e},isEmptyInlineElement:function(e){if(1!=e.nodeType||!dtd.$removeEmpty[e.tagName])return 0;for(e=e.firstChild;e;){if(domUtils.isBookmarkNode(e))return 0;if(1==e.nodeType&&!domUtils.isEmptyInlineElement(e)||3==e.nodeType&&!domUtils.isWhitespace(e))return 0;e=e.nextSibling}return 1},trimWhiteTextNode:function(e){function t(t){for(var n;(n=e[t])&&3==n.nodeType&&domUtils.isWhitespace(n);)e.removeChild(n)}t("firstChild"),t("lastChild")},mergeChild:function(e,t,n){for(var i,o=domUtils.getElementsByTagName(e,e.tagName.toLowerCase()),r=0;i=o[r++];)if(i.parentNode&&!domUtils.isBookmarkNode(i))if("span"!=i.tagName.toLowerCase())domUtils.isSameElement(e,i)&&domUtils.remove(i,!0);else{if(e===i.parentNode&&(domUtils.trimWhiteTextNode(e),1==e.childNodes.length)){e.style.cssText=i.style.cssText+";"+e.style.cssText,domUtils.remove(i,!0);continue}if(i.style.cssText=e.style.cssText+";"+i.style.cssText,n){var a=n.style;if(a){a=a.split(";");for(var s,l=0;s=a[l++];)i.style[utils.cssStyleToDomStyle(s.split(":")[0])]=s.split(":")[1]}}domUtils.isSameStyle(i,e)&&domUtils.remove(i,!0)}},getElementsByTagName:function(e,t,n){if(n&&utils.isString(n)){var i=n;n=function(e){return domUtils.hasClass(e,i)}}t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var o,r=[],a=0;o=t[a++];)for(var s,l=e.getElementsByTagName(o),d=0;s=l[d++];)n&&!n(s)||r.push(s);return r},mergeToParent:function(e){for(var t=e.parentNode;t&&dtd.$removeEmpty[t.tagName];){if(t.tagName==e.tagName||"A"==t.tagName){if(domUtils.trimWhiteTextNode(t),"SPAN"==t.tagName&&!domUtils.isSameStyle(t,e)||"A"==t.tagName&&"SPAN"==e.tagName){if(t.childNodes.length>1||t!==e.parentNode){e.style.cssText=t.style.cssText+";"+e.style.cssText,t=t.parentNode;continue}t.style.cssText+=";"+e.style.cssText,"A"==t.tagName&&(t.style.textDecoration="underline")}if("A"!=t.tagName){t===e.parentNode&&domUtils.remove(e,!0);break}}t=t.parentNode}},mergeSibling:function(e,t,n){function i(e,t,n){var i;if((i=n[e])&&!domUtils.isBookmarkNode(i)&&1==i.nodeType&&domUtils.isSameElement(n,i)){for(;i.firstChild;)"firstChild"==t?n.insertBefore(i.lastChild,n.firstChild):n.appendChild(i.firstChild);domUtils.remove(i)}}!t&&i("previousSibling","firstChild",e),!n&&i("nextSibling","lastChild",e)},unSelectable:ie&&browser.ie9below||browser.opera?function(e){e.onselectstart=function(){return!1},e.onclick=e.onkeyup=e.onkeydown=function(){return!1},e.unselectable="on",e.setAttribute("unselectable","on");for(var t,n=0;t=e.all[n++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.msUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0;n=t[i++];){switch(n=attrFix[n]||n){case"className":e[n]="";break;case"style":e.style.cssText="";var o=e.getAttributeNode("style");!browser.ie&&o&&e.removeAttributeNode(o)}e.removeAttribute(n)}},createElement:function(e,t,n){return domUtils.setAttributes(e.createElement(t),n)},setAttributes:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];switch(n){case"class":e.className=i;break;case"style":e.style.cssText=e.style.cssText+";"+i;break;case"innerHTML":e[n]=i;break;case"value":e.value=i;break;default:e.setAttribute(attrFix[n]||n,i)}}return e},getComputedStyle:function(e,t){if("width height top left".indexOf(t)>-1)return e["offset"+t.replace(/^\w/,function(e){return e.toUpperCase()})]+"px";if(3==e.nodeType&&(e=e.parentNode),browser.ie&&browser.version<9&&"font-size"==t&&!e.style.fontSize&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]){var n=e.ownerDocument.createElement("span");n.style.cssText="padding:0;border:0;font-family:simsun;",n.innerHTML=".",e.appendChild(n);var i=n.offsetHeight;return e.removeChild(n),n=null,i+"px"}try{var o=domUtils.getStyle(e,t)||(window.getComputedStyle?domUtils.getWindow(e).getComputedStyle(e,"").getPropertyValue(t):(e.currentStyle||e.style)[utils.cssStyleToDomStyle(t)])}catch(e){return""}return utils.transUnitToPx(utils.fixColor(t,o))},removeClasses:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)o=o.replace(new RegExp("\\b"+n+"\\b"),"");o=utils.trim(o).replace(/[ ]{2,}/g," "),o?e.className=o:domUtils.removeAttributes(e,["class"])},addClass:function(e,t){if(e){t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)new RegExp("\\b"+n+"\\b").test(o)||(o+=" "+n);e.className=utils.trim(o)}},hasClass:function(e,t){if(utils.isRegExp(t))return t.test(e.className);t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)if(!new RegExp("\\b"+n+"\\b","i").test(o))return!1;return i-1==t.length},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(e,t){browser.ie?("color"==t&&(t="(^|;)"+t),e.style.cssText=e.style.cssText.replace(new RegExp(t+"[^:]*:[^;]+;?","ig"),"")):e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(utils.cssStyleToDomStyle(t)),e.style.cssText||domUtils.removeAttributes(e,["style"])},getStyle:function(e,t){var n=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,n)},setStyle:function(e,t,n){e.style[utils.cssStyleToDomStyle(t)]=n,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(e,t){for(var n in t)t.hasOwnProperty(n)&&domUtils.setStyle(e,n,t[n])},removeDirtyAttr:function(e){for(var t,n=0,i=e.getElementsByTagName("*");t=i[n++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var n=0,i=e.firstChild;for(t=t||function(){return 1};i;)t(i)&&n++,i=i.nextSibling;return n},isEmptyNode:function(e){return!e.firstChild||0==domUtils.getChildCount(e,function(e){return!domUtils.isBr(e)&&!domUtils.isBookmarkNode(e)&&!domUtils.isWhitespace(e)})},clearSelectedArr:function(e){for(var t;t=e.pop();)domUtils.removeAttributes(t,["class"])},scrollToView:function(e,t,n){var i=function(){var e=t.document,n="CSS1Compat"==e.compatMode;return{width:(n?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(n?e.documentElement.clientHeight:e.body.clientHeight)||0}}().height,o=-1*i+n;o+=e.offsetHeight||0,o+=domUtils.getXY(e).y;var r=function(e){if("pageXOffset"in e)return{x:e.pageXOffset||0,y:e.pageYOffset||0};var t=e.document;return{x:t.documentElement.scrollLeft||t.body.scrollLeft||0,y:t.documentElement.scrollTop||t.body.scrollTop||0}}(t).y;(o>r||o<r-i)&&t.scrollTo(0,o+(o<0?-20:20))},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(e,t){if(3!=e.nodeType)return!1;var n=e.nodeValue;return t?new RegExp("^"+domUtils.fillChar).test(n):!n.replace(new RegExp(domUtils.fillChar,"g"),"").length},isStartInblock:function(e){var t,n=e.cloneRange(),i=0,o=n.startContainer;if(1==o.nodeType&&o.childNodes[n.startOffset]){o=o.childNodes[n.startOffset];for(var r=o.previousSibling;r&&domUtils.isFillChar(r);)o=r,r=r.previousSibling}for(this.isFillChar(o,!0)&&1==n.startOffset&&(n.setStartBefore(o),o=n.startContainer);o&&domUtils.isFillChar(o);)t=o,o=o.previousSibling;for(t&&(n.setStartBefore(t),o=n.startContainer),1==o.nodeType&&domUtils.isEmptyNode(o)&&1==n.startOffset&&n.setStart(o,0).collapse(!0);!n.startOffset;){if(o=n.startContainer,domUtils.isBlockElm(o)||domUtils.isBody(o)){i=1;break}var a,r=n.startContainer.previousSibling;if(r){for(;r&&domUtils.isFillChar(r);)a=r,r=r.previousSibling;a?n.setStartBefore(a):n.setStartBefore(n.startContainer)}else n.setStartBefore(n.startContainer)}return i&&!domUtils.isBody(n.startContainer)?1:0},isEmptyBlock:function(e,t){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[  \t\r\n"+domUtils.fillChar+"]","g"),e[browser.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(e.getElementsByTagName(n).length)return 0;return 1},setViewportOffset:function(e,t){var n=0|parseInt(e.style.left),i=0|parseInt(e.style.top),o=e.getBoundingClientRect(),r=t.left-o.left,a=t.top-o.top;r&&(e.style.left=n+r+"px"),a&&(e.style.top=i+a+"px")},fillNode:function(e,t){var n=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(n)},moveChild:function(e,t,n){for(;e.firstChild;)n&&t.firstChild?t.insertBefore(e.lastChild,t.firstChild):t.appendChild(e.firstChild)},hasNoAttributes:function(e){return browser.ie?/^<\w+\s*?>/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,t){return 1==e.nodeType&&new RegExp("\\b"+e.tagName+"\\b","i").test(t)},filterNodeList:function(e,t,n){var i=[];if(!utils.isFunction(t)){var o=t;t=function(e){return-1!=utils.indexOf(utils.isArray(o)?o:o.split(" "),e.tagName.toLowerCase())}}return utils.each(e,function(e){t(e)&&i.push(e)}),0==i.length?null:1!=i.length&&n?i:i[0]},isInNodeEndBoundary:function(e,t){var n=e.startContainer;if(3==n.nodeType&&e.startOffset!=n.nodeValue.length)return 0;if(1==n.nodeType&&e.startOffset!=n.childNodes.length)return 0;for(;n!==t;){if(n.nextSibling)return 0;n=n.parentNode}return 1},isBoundaryNode:function(e,t){for(var n;!domUtils.isBody(e);)if(n=e,e=e.parentNode,n!==e[t])return!1;return!0},fillHtml:browser.ie11below?"&nbsp;":"<br/>"},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function e(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function t(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function n(t,n,i,o){return 1==n.nodeType&&(dtd.$empty[n.tagName]||dtd.$nonChild[n.tagName])&&(i=domUtils.getNodeIndex(n)+(t?0:1),n=n.parentNode),t?(o.startContainer=n,o.startOffset=i,o.endContainer||o.collapse(!0)):(o.endContainer=n,o.endOffset=i,o.startContainer||o.collapse(!1)),e(o),o}function i(e,t){var n,i,o=e.startContainer,r=e.endContainer,a=e.startOffset,s=e.endOffset,l=e.document,d=l.createDocumentFragment();if(1==o.nodeType&&(o=o.childNodes[a]||(n=o.appendChild(l.createTextNode("")))),1==r.nodeType&&(r=r.childNodes[s]||(i=r.appendChild(l.createTextNode("")))),o===r&&3==o.nodeType)return d.appendChild(l.createTextNode(o.substringData(a,s-a))),t&&(o.deleteData(a,s-a),e.collapse(!0)),d;for(var c,u,m=d,f=domUtils.findParents(o,!0),h=domUtils.findParents(r,!0),p=0;f[p]==h[p];)p++;for(var g,v=p;g=f[v];v++){for(c=g.nextSibling,g==o?n||(3==e.startContainer.nodeType?(m.appendChild(l.createTextNode(o.nodeValue.slice(a))),t&&o.deleteData(a,o.nodeValue.length-a)):m.appendChild(t?o:o.cloneNode(!0))):(u=g.cloneNode(!1),m.appendChild(u));c&&c!==r&&c!==h[v];)g=c.nextSibling,m.appendChild(t?c:c.cloneNode(!0)),c=g;m=u}m=d,f[p]||(m.appendChild(f[p-1].cloneNode(!1)),m=m.firstChild);for(var b,v=p;b=h[v];v++){if(c=b.previousSibling,b==r?i||3!=e.endContainer.nodeType||(m.appendChild(l.createTextNode(r.substringData(0,s))),t&&r.deleteData(0,s)):(u=b.cloneNode(!1),m.appendChild(u)),v!=p||!f[p])for(;c&&c!==o;)b=c.previousSibling,m.insertBefore(t?c:c.cloneNode(!0),m.firstChild),c=b;m=u}return t&&e.setStartBefore(h[p]?f[p]?h[p]:f[p-1]:h[p-1]).collapse(!0),n&&domUtils.remove(n),i&&domUtils.remove(i),d}function o(e,t){try{if(a&&domUtils.inDoc(a,e))if(a.nodeValue.replace(fillCharReg,"").length)a.nodeValue=a.nodeValue.replace(fillCharReg,"");else{var n=a.parentNode;for(domUtils.remove(a);n&&domUtils.isEmptyInlineElement(n)&&(browser.safari?!(domUtils.getPosition(n,t)&domUtils.POSITION_CONTAINS):!n.contains(t));)a=n.parentNode,domUtils.remove(n),n=a}}catch(e){}}function r(e,t){var n;for(e=e[t];e&&domUtils.isFillChar(e);)n=e[t],domUtils.remove(e),e=n}var a,s=0,l=domUtils.fillChar,d=dom.Range=function(e){var t=this;t.startContainer=t.startOffset=t.endContainer=t.endOffset=null,t.document=e,t.collapsed=!0};d.prototype={cloneContents:function(){return this.collapsed?null:i(this,0)},deleteContents:function(){var e;return this.collapsed||i(this,1),browser.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},extractContents:function(){return this.collapsed?null:i(this,2)},setStart:function(e,t){return n(!0,e,t,this)},setEnd:function(e,t){return n(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new d(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){function t(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}for(var n,i=this,o=i.collapsed;1==i.startContainer.nodeType&&(n=i.startContainer.childNodes[i.startOffset])&&t(n);)i.setStart(n,0);if(o)return i.collapse(!0);if(!e)for(;1==i.endContainer.nodeType&&i.endOffset>0&&(n=i.endContainer.childNodes[i.endOffset-1])&&t(n);)i.setEnd(n,n.childNodes.length);return i},getCommonAncestor:function(e,n){var i=this,o=i.startContainer,r=i.endContainer;return o===r?e&&t(this)&&(o=o.childNodes[i.startOffset],1==o.nodeType)?o:n&&3==o.nodeType?o.parentNode:o:domUtils.getCommonAncestor(o,r)},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,n=this.startOffset,i=this.collapsed,o=this.endContainer;if(3==t.nodeType){if(0==n)this.setStartBefore(t);else if(n>=t.nodeValue.length)this.setStartAfter(t);else{var r=domUtils.split(t,n);t===o?this.setEnd(r,this.endOffset-n):t.parentNode===o&&(this.endOffset+=1),this.setStartBefore(r)}if(i)return this.collapse(!0)}return e||(n=this.endOffset,o=this.endContainer,3==o.nodeType&&(0==n?this.setEndBefore(o):(n<o.nodeValue.length&&domUtils.split(o,n),this.setEndAfter(o)))),this},txtToElmBoundary:function(e){function t(e,t){var n=e[t+"Container"],i=e[t+"Offset"];3==n.nodeType&&(i?i>=n.nodeValue.length&&e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"After"](n):e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"Before"](n))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,n=1;11==e.nodeType&&(t=e.firstChild,n=e.childNodes.length),this.trimBoundary(!0);var i=this.startContainer,o=this.startOffset,r=i.childNodes[o];return r?i.insertBefore(e,r):i.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+n),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,t){var n,i=this.document.createElement("span");return i.style.cssText="display:none;line-height:0px;",i.appendChild(this.document.createTextNode("‍")),i.id="_baidu_bookmark_start_"+(t?"":s++),this.collapsed||(n=i.cloneNode(!0),n.id="_baidu_bookmark_end_"+(t?"":s++)),this.insertNode(i),n&&this.collapse().insertNode(n).setEndBefore(n),this.setStartAfter(i),{start:e?i.id:i,end:n?e?n.id:n:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,n=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),n?(this.setEndBefore(n),domUtils.remove(n)):this.collapse(!0),this},enlarge:function(e,t){var n,i,o=domUtils.isBody,r=this.document.createTextNode("");if(e){for(i=this.startContainer,1==i.nodeType?i.childNodes[this.startOffset]?n=i=i.childNodes[this.startOffset]:(i.appendChild(r),n=i=r):n=i;;){if(domUtils.isBlockElm(i)){for(i=n;(n=i.previousSibling)&&!domUtils.isBlockElm(n);)i=n;this.setStartBefore(i);break}n=i,i=i.parentNode}for(i=this.endContainer,1==i.nodeType?((n=i.childNodes[this.endOffset])?i.insertBefore(r,n):i.appendChild(r),n=i=r):n=i;;){if(domUtils.isBlockElm(i)){for(i=n;(n=i.nextSibling)&&!domUtils.isBlockElm(n);)i=n;this.setEndAfter(i);break}n=i,i=i.parentNode}r.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(r)}if(!this.collapsed){for(;!(0!=this.startOffset||t&&t(this.startContainer)||o(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||t&&t(this.endContainer)||o(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(e){for(;!domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!e)for(;!domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(e,t,n){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(e){return 1==e.nodeType&&domUtils.isBlockElm(e)}).adjustmentBoundary();for(var i,o,r=this.createBookmark(),a=r.end,s=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},l=domUtils.getNextDomNode(r.start,!1,s),d=this.cloneRange();l&&domUtils.getPosition(l,a)&domUtils.POSITION_PRECEDING;)if(3==l.nodeType||dtd[e][l.tagName]){for(d.setStartBefore(l),i=l;i&&(3==i.nodeType||dtd[e][i.tagName])&&i!==a;)o=i,i=domUtils.getNextDomNode(i,1==i.nodeType,null,function(t){return dtd[e][t.tagName]});var c,u=d.setEndAfter(o).extractContents();if(n&&n.length>0){var m,f;f=m=n[0].cloneNode(!1);for(var h,p=1;h=n[p++];)m.appendChild(h.cloneNode(!1)),m=m.firstChild;c=m}else c=d.document.createElement(e);t&&domUtils.setAttributes(c,t),c.appendChild(u),d.insertNode(n?f:c);var g;if("span"==e&&t.style&&/text\-decoration/.test(t.style)&&(g=domUtils.findParentByTagName(c,"a",!0))?(domUtils.setAttributes(g,t),domUtils.remove(c,!0),c=g):(domUtils.mergeSibling(c),domUtils.clearEmptySibling(c)),domUtils.mergeChild(c,t),l=domUtils.getNextDomNode(c,!1,s),domUtils.mergeToParent(c),i===a)break}else l=domUtils.getNextDomNode(l,!0,s);return this.moveToBookmark(r)},removeInlineStyle:function(e){if(this.collapsed)return this;e=utils.isArray(e)?e:[e],this.shrinkBoundary().adjustmentBoundary();for(var t=this.startContainer,n=this.endContainer;;){if(1==t.nodeType){if(utils.indexOf(e,t.tagName.toLowerCase())>-1)break;if("body"==t.tagName.toLowerCase()){t=null;break}}t=t.parentNode}for(;;){if(1==n.nodeType){if(utils.indexOf(e,n.tagName.toLowerCase())>-1)break;if("body"==n.tagName.toLowerCase()){n=null;break}}n=n.parentNode}var i,o,r=this.createBookmark();t&&(o=this.cloneRange().setEndBefore(r.start).setStartBefore(t),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(t,!0),t.parentNode.insertBefore(r.start,t)),n&&(o=this.cloneRange().setStartAfter(r.end).setEndAfter(n),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(n,!1,!0),n.parentNode.insertBefore(r.end,n.nextSibling));for(var a,s=domUtils.getNextDomNode(r.start,!1,function(e){return 1==e.nodeType});s&&s!==r.end;)a=domUtils.getNextDomNode(s,!0,function(e){return 1==e.nodeType}),utils.indexOf(e,s.tagName.toLowerCase())>-1&&domUtils.remove(s,!0),s=a;return this.moveToBookmark(r)},getClosedNode:function(){var e;if(!this.collapsed){var n=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(t(n)){var i=n.startContainer.childNodes[n.startOffset];i&&1==i.nodeType&&(dtd.$empty[i.tagName]||dtd.$nonChild[i.tagName])&&(e=i)}}return e},select:browser.ie?function(e,t){var n;this.collapsed||this.shrinkBoundary();var i=this.getClosedNode();if(i&&!t){try{n=this.document.body.createControlRange(),n.addElement(i),n.select()}catch(e){}return this}var s,d=this.createBookmark(),c=d.start;if(n=this.document.body.createTextRange(),n.moveToElementText(c),n.moveStart("character",1),this.collapsed){if(!e&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(l),m=this.document.createElement("span");m.appendChild(this.document.createTextNode(l)),c.parentNode.insertBefore(m,c),c.parentNode.insertBefore(u,c),o(this.document,u),a=u,r(m,"previousSibling"),r(c,"nextSibling"),n.moveStart("character",-1),n.collapse(!0)}}else{var f=this.document.body.createTextRange();s=d.end,f.moveToElementText(s),n.setEndPoint("EndToEnd",f)}this.moveToBookmark(d),m&&domUtils.remove(m);try{n.select()}catch(e){}return this}:function(e){var t,n=domUtils.getWindow(this.document),i=n.getSelection();if(browser.gecko?this.document.body.focus():n.focus(),i){if(i.removeAllRanges(),this.collapsed&&!e){var s=this.startContainer,d=s;1==s.nodeType&&(d=s.childNodes[this.startOffset]),3==s.nodeType&&this.startOffset||(d?d.previousSibling&&3==d.previousSibling.nodeType:s.lastChild&&3==s.lastChild.nodeType)||(t=this.document.createTextNode(l),this.insertNode(t),o(this.document,t),r(t,"previousSibling"),r(t,"nextSibling"),a=t,this.setStart(t,browser.webkit?1:0).collapse(!0))}var c=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType){var d=this.startContainer.childNodes[this.startOffset];if(d){for(;d&&domUtils.isBlockElm(d)&&1==d.nodeType&&d.childNodes[0];)d=d.childNodes[0];d&&this.setStartBefore(d).collapse(!0)}else(d=this.startContainer.lastChild)&&domUtils.isBr(d)&&this.setStartBefore(d).collapse(!0)}!function(e){function t(t,n,i){3==t.nodeType&&t.nodeValue.length<n&&(e[i+"Offset"]=t.nodeValue.length)}t(e.startContainer,e.startOffset,"start"),t(e.endContainer,e.endOffset,"end")}(this),c.setStart(this.startContainer,this.startOffset),c.setEnd(this.endContainer,this.endOffset),i.addRange(c)}return this},scrollToView:function(e,t){e=e?window:domUtils.getWindow(this.document);var n=this,i=n.document.createElement("span");return i.innerHTML="&nbsp;",n.cloneRange().insertNode(i),domUtils.scrollToView(i,e,t),domUtils.remove(i),n},inFillChar:function(){var e=this.startContainer;return!(!this.collapsed||3!=e.nodeType||e.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"").length+1!=e.nodeValue.length)},createAddress:function(e,t){function n(e){for(var n,i=e?o.startContainer:o.endContainer,r=domUtils.findParents(i,!0,function(e){return!domUtils.isBody(e)}),a=[],s=0;n=r[s++];)a.push(domUtils.getNodeIndex(n,t));var l=0;if(t)if(3==i.nodeType){for(var d=i.previousSibling;d&&3==d.nodeType;)l+=d.nodeValue.replace(fillCharReg,"").length,d=d.previousSibling;l+=e?o.startOffset:o.endOffset}else if(i=i.childNodes[e?o.startOffset:o.endOffset])l=domUtils.getNodeIndex(i,t);else{i=e?o.startContainer:o.endContainer;for(var c=i.firstChild;c;)if(domUtils.isFillChar(c))c=c.nextSibling;else if(l++,3==c.nodeType)for(;c&&3==c.nodeType;)c=c.nextSibling;else c=c.nextSibling}else l=e?domUtils.isFillChar(i)?0:o.startOffset:o.endOffset;return l<0&&(l=0),a.push(l),a}var i={},o=this;return i.startAddress=n(!0),e||(i.endAddress=o.collapsed?[].concat(i.startAddress):n()),i},moveToAddress:function(e,t){function n(e,t){for(var n,o,r,a=i.document.body,s=0,l=e.length;s<l;s++)if(r=e[s],n=a,!(a=a.childNodes[r])){o=r;break}t?a?i.setStartBefore(a):i.setStart(n,o):a?i.setEndBefore(a):i.setEnd(n,o)}var i=this;return n(e.startAddress,!0),!t&&e.endAddress&&n(e.endAddress),i},equals:function(e){for(var t in this)if(this.hasOwnProperty(t)&&this[t]!==e[t])return!1;return!0},traversal:function(e,t){if(this.collapsed)return this;for(var n=this.createBookmark(),i=n.end,o=domUtils.getNextDomNode(n.start,!1,t);o&&o!==i&&domUtils.getPosition(o,i)&domUtils.POSITION_PRECEDING;){var r=domUtils.getNextDomNode(o,!1,t);e(o),o=r}return this.moveToBookmark(n)}}}(),function(){function e(e,t){var n=domUtils.getNodeIndex;e=e.duplicate(),e.collapse(t);var i=e.parentElement();if(!i.hasChildNodes())return{container:i,offset:0};for(var o,r,a=i.children,s=e.duplicate(),l=0,d=a.length-1,c=-1;l<=d;){c=Math.floor((l+d)/2),o=a[c],s.moveToElementText(o);var u=s.compareEndPoints("StartToStart",e);if(u>0)d=c-1;else{if(!(u<0))return{container:i,offset:n(o)};l=c+1}}if(-1==c){if(s.moveToElementText(i),s.setEndPoint("StartToStart",e),r=s.text.replace(/(\r\n|\r)/g,"\n").length,a=i.childNodes,!r)return o=a[a.length-1],{container:o,offset:o.nodeValue.length};for(var m=a.length;r>0;)r-=a[--m].nodeValue.length;return{container:a[m],offset:-r}}if(s.collapse(u>0),s.setEndPoint(u>0?"StartToStart":"EndToStart",e),!(r=s.text.replace(/(\r\n|\r)/g,"\n").length))return dtd.$empty[o.tagName]||dtd.$nonChild[o.tagName]?{container:i,offset:n(o)+(u>0?0:1)}:{container:o,offset:u>0?0:o.childNodes.length};for(;r>0;)try{var f=o;o=o[u>0?"previousSibling":"nextSibling"],r-=o.nodeValue.length}catch(e){return{container:i,offset:n(f)}}return{container:o,offset:u>0?-r:o.nodeValue.length+r}}function t(t,n){if(t.item)n.selectNode(t.item(0));else{var i=e(t,!0);n.setStart(i.container,i.offset),0!=t.compareEndPoints("StartToEnd",t)&&(i=e(t,!1),n.setEnd(i.container,i.offset))}return n}function n(e){var t;try{t=e.getNative().createRange()}catch(e){return null}var n=t.item?t.item(0):t.parentElement();return(n.ownerDocument||n)===e.document?t:null}(dom.Selection=function(e){var t,i=this;i.document=e,browser.ie9below&&(t=domUtils.getWindow(e).frameElement,domUtils.on(t,"beforedeactivate",function(){i._bakIERange=i.getIERange()}),domUtils.on(t,"activate",function(){try{!n(i)&&i._bakIERange&&i._bakIERange.select()}catch(e){}i._bakIERange=null})),t=e=null}).prototype={rangeInBody:function(e,t){var n=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return n===this.document.body||domUtils.inDoc(n,this.document)},getNative:function(){var e=this.document;try{return e?browser.ie9below?e.selection:domUtils.getWindow(e).getSelection():null}catch(e){return null}},getIERange:function(){var e=n(this);return!e&&this._bakIERange?this._bakIERange:e},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var e=this.getStart();return e?domUtils.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var e=n(this);return!(!e||!this.rangeInBody(e))}return!!this.getNative().rangeCount}catch(e){return!1}},getRange:func