From a7690a8bb114c84e576204b02dfaa9ddd9f5cffd Mon Sep 17 00:00:00 2001 From: JimQing <33045162+JimQing@users.noreply.github.com> Date: Tue, 19 May 2020 13:35:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20ecac2?= =?UTF-8?q?55dafd5a36d4b8356770cf3b6e59994bccd=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/app.8c7ab8cd.css | 1 + index.html | 2 +- js/app.96443dc9.js | 2 + js/app.96443dc9.js.map | 1 + js/chunk-vendors.caba6739.js | 70 ++++++++++++++++++++++++++++++++ js/chunk-vendors.caba6739.js.map | 1 + 6 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 css/app.8c7ab8cd.css create mode 100644 js/app.96443dc9.js create mode 100644 js/app.96443dc9.js.map create mode 100644 js/chunk-vendors.caba6739.js create mode 100644 js/chunk-vendors.caba6739.js.map diff --git a/css/app.8c7ab8cd.css b/css/app.8c7ab8cd.css new file mode 100644 index 0000000..173d0cb --- /dev/null +++ b/css/app.8c7ab8cd.css @@ -0,0 +1 @@ +.dialog-footer[data-v-7fbc8ba6],.reset__dialog[data-v-7fbc8ba6],.text[data-v-7fbc8ba6]{text-align:center}.editor__header[data-v-7db86454]{width:100%}.header__item[data-v-7db86454]{margin:0 3px}.header__item_last[data-v-7db86454]{margin-right:8px}.header__switch[data-v-7db86454]{margin-left:8px}.mode__switch[data-v-7db86454]{margin-left:24px;width:24px;height:24px;background:url(../img/night.8bc3a963.png) no-repeat;background-size:cover;-webkit-transition:all .3s;transition:all .3s}.mode__switch_black[data-v-7db86454]{background:url(../img/light.f7a977db.png) no-repeat;background-size:cover}.top[data-v-7db86454]{margin-right:0}.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.clo,.opn,.pun{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.kwd,.tag,.typ{font-weight:700}.str{color:#060}.kwd{color:#006}.com{color:#600;font-style:italic}.typ{color:#404}.lit{color:#044}.clo,.opn,.pun{color:#440}.tag{color:#006}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}.main-body[data-v-19a01e50]{overflow:hidden}.el-main[data-v-19a01e50]{padding:0;margin:20px}.container[data-v-19a01e50],.el-main[data-v-19a01e50]{-webkit-transition:all .3s;transition:all .3s}.preview[data-v-19a01e50]{-webkit-transition:background 0s;transition:background 0s;-webkit-transition-delay:.2s;transition-delay:.2s}.preview-wrapper_night[data-v-19a01e50]{overflow-y:inherit;position:relative;left:-3px}.preview-wrapper_night .preview[data-v-19a01e50]{background-color:#fff}#output-wrapper[data-v-19a01e50]{position:relative}.loading-mask[data-v-19a01e50]{top:50%;width:376px;height:101%;padding-top:1px;font-size:15px;color:grey;background-color:#1e1e1e}.loading-mask .loading__img[data-v-19a01e50],.loading-mask[data-v-19a01e50]{position:absolute;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.loading-mask .loading__img[data-v-19a01e50]{top:330px;width:50px;height:50px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAAt1BMVEX///8AAABIz0hHzkdIzkhIz0hIz0hHzkdIzkhFz0VAz0BHzUdIz0hHzkdIzkhIzUhHzUdHzUdIzkhEzEREzERGz0ZIz0hHzUdIzkhIzUhHzkdHzkdHzUdGz0ZIzkhHzkdKzkpIzUhGzUZD00NIzUhGzUZIzkhIzkhHzkdHzkdIzkhHz0dIzUhK1UpHzUdC0EJHzkdHzkdIz0hH1UdHzUdGzkZIzUhJ20lD10NJzklIzkhIzkj////r6/fCAAAAO3RSTlMAACDvoEBg0MAwEI9fz9+A8JDgDx5Ff/r9i+VdbHSDkx9RTRdce+6q6brLb58YSBvtd0oScFTxBxM/v5xq7LMAAAABYktHRACIBR1IAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wwcCBssFsYwawAAAe9JREFUaN7t2tlywiAUBmABiQY1W6vWbna1i6Z2sYs97/9eNcQ6U40kEMhoh/824qeAxwSo1Wx2MUgimAAQLNNCAanDInWzCAUeahRxUsQx212NxGgaHhMq21sqCHIpdZFpRDoW2ROEtdpY/S1xu8XyEdZZ/BA8VcNbNO6wPIQbAK6akZa2v0rWN0mLk6+G+Gnr3O5qgnR1EjfOQviHCRS7yw02uyELwWGkbHAlCnGR3wkuM4WxLSuGkQNfmLYW5BDE8fUgXcHVXv9oYB45PoGBeQSd5ioaEHSWp+hA0DkMzSNoKFZKI78zuWsQuaA8l3BlEFnm2iL/FrlpZqanFbntZxmjO73IfdbVh31ERjQjj1LImEyYGMn+9xUjbELGKyRObviJI57CTzBdu/b8Ip7CDkkeQuIlQrffY5dB0rtvuqvINHnpqwISR8nTQsExSWbVW7ExSZ4jong1u2ZByJDu7kKsHszkCqQCIl+FLbKLyPtaefwwgWxEP2LvVixiEYtoQgqlHPJJC+XLLqoZRsyvpuKJB0R9XZiA18pfF+Yr3KqKS4qtcFeyVl/FrgNrlN8/aeTun3AlUh34aMPYsqcVOmWmsBMyW1Ysooi487nx/fhKThbwDdVvs0glpz0qObdSyQkchAOAQOUskU3h/AAe7qmqtAqp/QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0xMi0yOFQwODoyNzo0NCswMDowMPJYdAwAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMTItMjhUMDg6Mjc6NDQrMDA6MDCDBcywAAAAAElFTkSuQmCC) no-repeat;background-size:cover}.loading-mask span[data-v-19a01e50]{position:absolute;left:50%;top:390px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.container_night,.container_night .el-main{background-color:#333}.container_night .CodeMirror{caret-color:grey;color:grey;background-color:#1e1e1e;-webkit-box-shadow:inset 0 0 0 1px rgba(100,37,37,.102);box-shadow:inset 0 0 0 1px rgba(100,37,37,.102)}.container_night .output_night .preview{background-color:#1e1e1e;-webkit-box-shadow:0 0 70px rgba(0,0,0,.3);box-shadow:0 0 70px rgba(0,0,0,.3)}.container_night .output_night .preview-wrapper{background-color:#1e1e1e;-webkit-box-shadow:inset 0 0 0 1px hsla(0,4.3%,91%,.102);box-shadow:inset 0 0 0 1px hsla(0,4.3%,91%,.102)}.container_night .output_night .code-snippet__fix{background-color:#eee}.container_night .cm-s-style-mirror .CodeMirror-matchingbracket{color:#fff!important;background:#1e1e1e!important}.container_night .cm-s-style-mirror span.cm-tag,.container_night .cm-s-xq-light span.cm-variable-2{color:grey}.container_night .cm-s-xq-light .CodeMirror-activeline-background{background-color:transparent}.container_night .cm-s-xq-light span.cm-string{color:#8e9eb9}.container_night .cm-s-xq-light span.cm-link{color:#84868b}.container_night .editor__header{background-color:#3c3c3c}.container_night .el-button{color:#fff;background-color:#1e1e1e;border:1px solid transparent}.container_night .el-button.is-plain:focus,.container_night .el-button.is-plain:hover{background:#1e1e1e;color:#fff;border:1px solid #fff}.container_night .el-button.is-plain:focus i,.container_night .el-button.is-plain:hover i{color:#fff}.container_night .about__dialog .el-dialog,.container_night .insert__dialog .el-dialog,.container_night .reset__dialog .el-dialog{background-color:#333}.container_night .about__dialog .el-dialog__body,.container_night .about__dialog .el-dialog__title,.container_night .about__dialog .el-form-item__label,.container_night .insert__dialog .el-dialog__body,.container_night .insert__dialog .el-dialog__title,.container_night .insert__dialog .el-form-item__label,.container_night .reset__dialog .el-dialog__body,.container_night .reset__dialog .el-dialog__title,.container_night .reset__dialog .el-form-item__label,.container_night i{color:#fff}.container_night ::-webkit-scrollbar{background-color:#1e1e1e} \ No newline at end of file diff --git a/index.html b/index.html index 8f7299c..f7ce677 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -微信 Markdown 编辑器
\ No newline at end of file +微信 Markdown 编辑器
\ No newline at end of file diff --git a/js/app.96443dc9.js b/js/app.96443dc9.js new file mode 100644 index 0000000..2e699a8 --- /dev/null +++ b/js/app.96443dc9.js @@ -0,0 +1,2 @@ +(function(e){function t(t){for(var o,a,s=t[0],l=t[1],c=t[2],d=0,f=[];d-1&&s>-1&&s>a&&(r=r.substr(0,a)+r.substring(a+i.commentStart.length,s)+r.substr(s+i.commentEnd.length)),o.replaceRange(r,t,n)}}))})),b.a.defineExtension("autoIndentRange",(function(e,t){var n=this;this.operation((function(){for(var o=e.line;o<=t.line;o++)n.indentLine(o,"smart")}))})),b.a.defineExtension("autoFormatRange",(function(e,t){var n=this,o=n.getMode(),i=n.getRange(e,t).split("\n"),r=b.a.copyState(o,n.getTokenAt(e).state),a=n.getOption("tabSize"),s="",l=0,c=0==e.ch;function u(){s+="\n",c=!0,++l}for(var d=0;d0}));r=i(r);var a=e.substring(0,n).split(",").map((function(e){return e.trim()}));a.forEach((function(e){t[e]||(t[e]={}),Object.keys(r).forEach((function(n){t[e][n]=r[n]}))})),e=e.slice(o+1).trim()};while(e.length>0&&-1!==e.indexOf("{")&&-1!==e.indexOf("}"))n();return t}function P(e,t){var n=e.getValue(0);n?localStorage.setItem(t,n):localStorage.removeItem(t)}function F(e){return/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(e.name)?e.size>5242880&&"由于公众号限制,图片大小不能超过 5.0M":"请上传 JPG/PNG/GIF 格式的图片"}var M=n("466b"),I=n.n(M);function D(){for(var e=document.getElementById("output"),t=e.getElementsByTagName("img"),n=0;n",triples:"",explode:"[]{}"},n=e.Pos;function o(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==Object(pe["a"])(e)&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(r(o(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:l,Enter:c};function r(e){for(var t=0;t=0;l--){var u=a[l].head;t.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(t){var n=s(t),i=n&&o(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var r=t.listSelections(),a=0;a0;return{anchor:new n(t.anchor.line,t.anchor.ch+(o?-1:1)),head:new n(t.head.line,t.head.ch+(o?1:-1))}}function d(t,i){var r=s(t);if(!r||t.getOption("disableInput"))return e.Pass;var a=o(r,"pairs"),l=a.indexOf(i);if(-1==l)return e.Pass;for(var c,d=o(r,"closeBefore"),f=o(r,"triples"),g=a.charAt(l+1)==i,h=t.listSelections(),m=l%2==0,b=0;b1&&f.indexOf(i)>=0&&t.getRange(n(x.line,x.ch-2),x)==i+i){if(x.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(x.line,x.ch-2))))return e.Pass;v="addFour"}else if(g){var C=0==x.ch?" ":t.getRange(n(x.line,x.ch-1),x);if(e.isWordChar(w)||C==i||e.isWordChar(C))return e.Pass;v="both"}else{if(!m||!(0===w.length||/\s/.test(w)||d.indexOf(w)>-1))return e.Pass;v="both"}else v=g&&p(t,x)?"both":f.indexOf(i)>=0&&t.getRange(x,n(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=v)return e.Pass}else c=v}var k=l%2?a.charAt(l-1):i,S=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var e=0;e<3;e++)t.execCommand("goCharRight");else if("surround"==c){var n=t.getSelections();for(e=0;e=65&&t.keyCode<=90||189===t.keyCode)&&e.showHint(t)})),this.cssEditor.on("update",(function(t){e.cssChanged(),P(e.cssEditor,"__css_content")}))},cssChanged:function(){var e=A(this.cssEditor.getValue(0)),t=z(this.currentSize.replace("px",""));t=$(e,this.currentColor,t),this.setWxRendererOptions({theme:t}),this.onEditorRefresh()},onTextareaChange:function(){console.log("change")},uploaded:function(e,t,n){if(e)if(e.success){var o=this.editor.getCursor(),i=e.data,r="![](".concat(i,")");this.editor.replaceSelection("\n".concat(r,"\n"),o),this.$message({showClose:!0,message:"图片插入成功",type:"success"}),this.onEditorRefresh()}else this.$message({showClose:!0,message:e.message,type:"error"});else this.$message({showClose:!0,message:"上传图片未知异常",type:"error"})},leftAndRightScroll:function(){he()("#preview").on("scroll",(function e(){clearTimeout(this.timeout);var t=he()(this),n=he()(t.is("#preview")?"div.CodeMirror-scroll":"#preview");n.off("scroll");var o=t[0],i=n[0],r=o.scrollTop/(o.scrollHeight-o.offsetHeight),a=r*(i.scrollHeight-i.offsetHeight);i.scrollTo(0,a),this.timeout=setTimeout((function(){n.on("scroll",e)}),100)}))},onEditorRefresh:function(){this.editorRefresh(),setTimeout((function(){return PR.prettyPrint()}),0)},endCopy:function(){var e=this;this.backLight=!1,setTimeout((function(){e.isCoping=!1}),800)}},Object(U["b"])(["initEditorState","initEditorEntity","setWxRendererOptions","editorRefresh","initCssEditorEntity"])),mounted:function(){this.leftAndRightScroll(),setTimeout((function(){PR.prettyPrint()}),300)}},be=me,ve=(n("9cf8"),Object(u["a"])(be,p,g,!1,null,"19a01e50",null)),ye=ve.exports,xe={name:"App",components:{Loading:f,CodemirrorEditor:ye},data:function(){return{loading:!0}},mounted:function(){var e=this;setTimeout((function(){e.loading=!1}),200),window.console&&window.console.log&&console.log("Think big, train fast, learn deep. See https://github.com/yanglbme")}},we=xe,Ce=Object(u["a"])(we,i,r,!1,null,"1407684e",null),ke=Ce.exports,Se=(n("99af"),n("a15b"),n("e0c1")),_e=n.n(Se),Ee=function(e){var t=this;this.opts=e;var n=!0,o=[],i=0,r=null,a="Menlo, Operator Mono, Consolas, Monaco, monospace",s=function(e,t){return Object.assign({},e,t)};this.buildTheme=function(e){var n={},o=s(e.BASE,{"font-family":t.opts.fonts,"font-size":t.opts.size}),i=s(o,{});for(var r in e.inline)if(e.inline.hasOwnProperty(r)){var l=e.inline[r];"codespan"===r&&(l["font-family"]=a,l["white-space"]="normal"),n[r]=s(o,l)}for(var c in e.block)if(e.block.hasOwnProperty(c)){var u=e.block[c];"code"===c&&(u["font-family"]=a),n[c]=s(i,u)}return n};var l=function(e,t){var n=[],o=r[e];if(!o)return"";for(var i in o)n.push(i+":"+o[i]);return'style="'.concat(n.join(";")+(t||""),'"')},c=function(e,t){return o.push([++i,e,t]),i};this.buildFootnotes=function(){var e=o.map((function(e){return e[1]===e[2]?'['.concat(e[0],"]: ").concat(e[1],"
"):'['.concat(e[0],"] ").concat(e[1],": ").concat(e[2],"
")}));return"

引用链接

").concat(e.join("\n"),"

")},this.buildAddition=function(){return'\n \n '},this.setOptions=function(e){t.opts=s(t.opts,e)},this.hasFootnotes=function(){return 0!==o.length},this.getRenderer=function(e){o=[],i=0,r=t.buildTheme(t.opts.theme);var a=new _e.a.Renderer;return a.heading=function(e,t){switch(t){case 1:return"

").concat(e,"

");case 2:return"

").concat(e,"

");case 3:return"

").concat(e,"

");default:return"

").concat(e,"

")}},a.paragraph=function(e){return"

").concat(e,"

")},a.blockquote=function(e){return e=e.replace(//,"

")),"

").concat(e,"
")},a.code=function(e,t){e=e.replace(//g,">");for(var n=e.split("\n"),o=[],i=[],r=0;r'.concat(a||"
","
")),i.push("
  • ")}var s=t||"";return'\n
    \n
      '.concat(i.join(""),'
    \n
    \n                ').concat(o.join(""),"\n            
    \n
    \n ")},a.codespan=function(e,t){return"").concat(e,"")},a.listitem=function(e){return"<%s/>').concat(e,"")},a.list=function(e,t,n){e=e.replace(/<\/*p.*?>/g,"");var o=e.split("<%s/>");if(!t)return e=o.join("•"),"

    ").concat(e,"

    ");e=o[0];for(var i=1;i").concat(e,"

    ")},a.image=function(e,t,o){var i="";o&&(i="
    ").concat(o,"
    "));var r=l("figure"),a=l(n?"image":"image_org");return"
    ').concat(o,'').concat(i,"
    ")},a.link=function(t,n,o){if(0===t.indexOf("https://mp.weixin.qq.com"))return'").concat(o,"");if(t===o)return o;if(e){var i=c(n||o,t);return"").concat(o,"[").concat(i,"]")}return o},a.strong=function(e){return"").concat(e,"")},a.em=function(e){return"

    ").concat(e,"

    ")},a.table=function(e,t){return'
    ").concat(e,"").concat(t,"
    ")},a.tablecell=function(e,t){return"").concat(e,"")},a.hr=function(){return'
    '},a}},Oe=Ee,Re='# 示例文章:Google 搜索的即时自动补全功能究竟是如何“工作”的?\n> Google 搜索**自动补全功能**的强大,相信不少朋友都能感受到,它帮助我们更快地“补全”我们所要输入的搜索关键字。那么,它怎么知道我们要输入什么内容?它又是如何工作的?在这篇文章里,我们一起来看看。\n\n## 使用自动补全\nGoogle 搜索的自动补全功能可以在 Google 搜索应用的大多数位置使用,包括 [Google](https://www.google.com/) 主页、适用于 IOS 和 Android 的 Google 应用,我们只需要在 Google 搜索框上开始键入关键字,就可以看到联想词了。\n\n![](https://imgkr.cn-bj.ufileos.com/17ed83bf-e028-4db2-9503-5a3b4e64deee.gif)\n\n在上图示例中,我们可以看到,输入关键字 `juej`,Google 搜索会联想到“掘金”、“掘金小册”、“绝句”等等,好处就是,我们无须输入完整的关键字即可轻松完成针对这些 topics 的搜索。\n\n谷歌搜索的自动补全功能对于使用移动设备的用户来说特别有用,用户可以轻松在难以键入的小屏幕上完成搜索。当然,对于移动设备用户和台式机用户而言,这都节省了大量的时间。根据 Google 官方报告,自动补全功能可以减少大约 25% 的打字,累积起来,预计每天可以节省 200 多年的打字时间。是的,每天!\n\n> 注意,本文所提到的“**联想词**”与“**预测**”,是同一个意思。\n\n## 基于“预测”而非“建议”\nGoogle 官方将自动补全功能称之为“预测”,而不是“建议”,为什么呢?其实是有充分理由的。自动补全功能是为了**帮助用户完成他们打算进行的搜索**,而不是建议用户要执行什么搜索。\n\n那么,Google 是如何确定这些“预测”的?其实,Google 会根据趋势搜索 [trends](https://trends.google.com/trends/?geo=US) 给到我们这些“预测”。简单来说,哪个热门、哪个搜索频率高,就更可能推给我们。当然,这也与我们当前所处的位置以及我们的搜索历史相关。\n\n另外,这些“预测”也会随着我们键入的关键字的变更而更改。例如,当我们把键入的关键字从 `juej` 更改为 `juex` 时,与“掘金”相关的预测会“消失”,同时,与“觉醒”、“决心”相关联的词会出现。\n\n![](https://imgkr.cn-bj.ufileos.com/5b17dc99-606d-42c1-9f86-e09e88aaa822.gif)\n\n## 为什么看不到某些联想词?\n如果我们在输入某个关键字时看不到联想词,那么表明 Google 的算法可能检测到:\n\n- 这个关键字不是热门字词;\n- 搜索的字词太新了,我们可能需要等待几天或几周才能看到联想词;\n- 这是一个侮辱性或敏感字词,这个搜索字词违反了 Google 的相关政策。更加详细的情况,可以了解 [Google 搜索自动补全政策](https://support.google.com/websearch/answer/7368877)。\n\n## 为什么会看到某些不当的联想词?\nGoogle 拥有专门设计的系统,可以自动捕获不适当的预测结果而不显示出来。然而,Google 每天需要处理数十亿次搜索,这意味着 Google 每天会显示数十亿甚至上百亿条预测。再好的系统,也可能存在缺陷,不正确的预测也可能随时会出现。\n\n我们作为 Google 搜索的用户,如果认定某条预测违反了相关的搜索自动补全政策,可以进行举报反馈,点击右下角“**举报不当的联想查询**”并勾选相关选项即可。\n\n![](https://imgkr.cn-bj.ufileos.com/6ca8185d-12c6-4550-bb4e-e49cfbf56db7.gif)\n\n## 如何实现自动补全算法?\n目前,Google 官方似乎并没有公开搜索自动补全的算法实现,但是业界在这方面已经有了不少研究。\n\n一个好的自动补全器必须是快速的,并且在用户键入下一个字符后立即更新联想词列表。**自动补全器的核心是一个函数,它接受输入的前缀,并搜索以给定前缀开头的词汇或语句列表**。通常来说,只需要返回少量的数目即可。\n\n接下来,我们先从一个简单且低效的实现开始,并在此基础上逐步构建更高效的方法。\n\n### 词汇表实现\n一个**简单粗暴的实现方式**是:顺序查找词汇表,依次检查每个词汇,看它是否以给定的前缀开头。\n\n但是,此方法需要将前缀与每个词汇进行匹配检查,若词汇量较少,这种方式可能勉强行得通。但是,如果词汇量规模较大,效率就太低了。\n\n一个**更好的实现方式是**:让词汇按字典顺序排序。借助二分搜索算法,可以快速搜索有序词汇表中的前缀。由于二分搜索的每一步都会将搜索的范围减半,因此,总的搜索时间与词汇表中单词数量的对数成正比,即时间复杂度是 `O(log N)`。二分搜索的性能很好,但有没有更好的实现呢?当然有,往下看。\n\n### 前缀树实现\n通常来说,许多词汇都以相同的前缀开头,比如 `need`、`nested` 都以 `ne` 开头,`seed`、`speed` 都以 `s` 开头。要是为每个单词分别存储公共前缀似乎很浪费。\n\n![](https://imgkr.cn-bj.ufileos.com/7cc3cf37-040a-420e-8ef9-d05e92c82cfd.png)\n\n前缀树是一种利用公共前缀来加速补全速度的数据结构。前缀树在节点树中排列一组单词,单词沿着从根节点到叶子节点的路径存储,树的层次对应于前缀的字母位置。\n\n前缀的补全是顺着前缀定义的路径来查找的。例如,在上图的前缀树中,前缀 `ne` 对应于从子节点取左边缘 `N` 和唯一边缘 `E` 的路径。然后可以通过继续遍历从 `E` 节点可以达到的所有叶节点来生成补全列表。在图中,`ne` 的补全可以是两个分支:`-ed` 和 `-sted`。如果在数中找不到由前缀定义的路径,则说明词汇表中不包含以该前缀开头的单词。\n\n### 有限状态自动机(DFA)实现\n前缀树可以有效处理公共前缀,但是,对于其他共享词部分,仍会分别存储在每个分支中。比如,后缀 `ed`、`ing`、`tion` 在英文单词中特别常见。在上一个例子中,`e`、`d` 分别存放在了每一个分支上。\n\n有没有一种方法可以更加节省存储空间呢?有的,那就是 DFA。\n\n
    \n
    \n\n在上面的例子中,单词 `need`、`nested`、`seed` 和 `speed` 仅由 9 个节点组成,而上一张图中的前缀树包含了 17 个节点。\n\n可以看出,最小化前缀树 DFA 可以在很大程度上减少数据结构的大小。即使词汇量很大,最小化 DFA 通常也适合在内存中存储,避免昂贵的磁盘访问是实现快速自动补全的关键。\n\n### 一些扩展\n上面介绍了如何利用合理的数据结构实现基本的自动补全功能。这些数据结构可以通过多种方式进行扩展,从而改善用户体验。\n\n通常,满足特定前缀的词汇可能很多,而用户界面上能够显示的却不多,我们更希望能显示最常搜索或者最有价值的词汇。这通常可以通过为词汇表中的每个单词增加一个代表单词值的**权重** `weight`,并且按照权重高低来排序自动补全列表。\n\n- 对于排序后的词汇表来说,在词汇表每个元素上增加 `weight` 属性并不难;\n- 对于前缀树来说,将 `weight` 存储在叶子节点中,也是很简单的一个实现;\n- 对于 `DFA` 来说,则较为复杂。因为一个叶子节点可以通过多条路径到达。一种解决方案是将权重关联到路径而不是叶子节点。\n\n目前有不少开源库都提供了这个功能,比如主流的搜索引擎框架 [Elasticsearch](https://www.elastic.co/products/elasticsearch)、[Solr](https://lucene.apache.org/solr/) 等,基于此,我们可以实现高效而强大的自动补全功能。\n\n#### 推荐阅读\n- [阿里又一个 20k+ stars 开源项目诞生,恭喜 fastjson!](https://mp.weixin.qq.com/s/RNKDCK2KoyeuMeEs6GUrow)\n- [刷掉 90% 候选人的互联网大厂海量数据面试题(附题解 + 方法总结)](https://mp.weixin.qq.com/s/rjGqxUvrEqJNlo09GrT1Dw)\n- [好用!期待已久的文本块功能究竟如何在 Java 13 中发挥作用?](https://mp.weixin.qq.com/s/kalGv5T8AZGxTnLHr2wDsA)\n- [2019 GitHub 开源贡献排行榜新鲜出炉!微软谷歌领头,阿里跻身前 12!](https://mp.weixin.qq.com/s/_q812aGD1b9QvZ2WFI0Qgw)\n\n---\n\n欢迎关注我的公众号“**Doocs开源社区**”,原创技术文章第一时间推送。\n\n
    \n \n
    \n\n',Te=Re;o["default"].use(U["a"]);var je={wxRenderer:null,output:"",editor:null,cssEditor:null,html:"",currentFont:"",currentSize:"",currentColor:"",citeStatus:0,nightMode:!1},Ne={setHtml:function(e,t){e.html=t},setEditorValue:function(e,t){e.editor.setValue(t)},setCssEditorValue:function(e,t){e.cssEditor.setValue(t)},setWxRendererOptions:function(e,t){e.wxRenderer.setOptions(t)},setCiteStatus:function(e,t){e.citeStatus=t,localStorage.setItem("citeStatus",t)},setCurrentFont:function(e,t){e.currentFont=t,localStorage.setItem("fonts",t)},setCurrentSize:function(e,t){e.currentSize=t,localStorage.setItem("size",t)},setCurrentColor:function(e,t){e.currentColor=t,localStorage.setItem("color",t)},themeChanged:function(e){e.nightMode=!e.nightMode},initEditorState:function(e){e.currentFont=localStorage.getItem("fonts")||B.builtinFonts[0].value,e.currentColor=localStorage.getItem("color")||B.colorOption[1].value,e.currentSize=localStorage.getItem("size")||B.sizeOption[2].value,e.citeStatus="true"===localStorage.getItem("citeStatus"),e.wxRenderer=new Oe({theme:N(e.currentColor),fonts:e.currentFont,size:e.currentSize,status:e.citeStatus})},initEditorEntity:function(e){e.editor=b.a.fromTextArea(document.getElementById("editor"),{value:"",mode:"text/x-markdown",theme:"xq-light",lineNumbers:!1,lineWrapping:!0,styleActiveLine:!0,autoCloseBrackets:!0}),localStorage.getItem("__editor_content")?e.editor.setValue(localStorage.getItem("__editor_content")):e.editor.setValue(Te)},initCssEditorEntity:function(e){e.cssEditor=b.a.fromTextArea(document.getElementById("cssEditor"),{value:"",mode:"css",theme:"style-mirror",lineNumbers:!1,lineWrapping:!0,matchBrackets:!0,autofocus:!0,extraKeys:{"Ctrl-F":function(e){var t=e.lineCount();e.autoFormatRange({line:0,ch:0},{line:t})}}}),localStorage.getItem("__css_content")?e.cssEditor.setValue(localStorage.getItem("__css_content")):e.cssEditor.setValue(V)},editorRefresh:function(e){var t=_e()(e.editor.getValue(0),{renderer:e.wxRenderer.getRenderer(e.citeStatus)});t=t.replace(/(style=".*?)"/,'$1;margin-top: 0"'),e.citeStatus&&(t+=e.wxRenderer.buildFootnotes(),t+=e.wxRenderer.buildAddition()),e.output=t},clearEditorToDefault:function(e){e.editor.setValue(Te),e.cssEditor.setValue(V)}},ze=new U["a"].Store({state:je,mutations:Ne,actions:{},modules:{}}),$e=n("5c96"),Ae=n.n($e);n("0fae");o["default"].use($e["Container"]),o["default"].use($e["Header"]),o["default"].use($e["Upload"]),o["default"].use($e["Tooltip"]),o["default"].use($e["Form"]),o["default"].use($e["FormItem"]),o["default"].use($e["Select"]),o["default"].use($e["Option"]),o["default"].use($e["ColorPicker"]),o["default"].use($e["Switch"]),o["default"].use($e["Button"]),o["default"].use($e["Main"]),o["default"].use($e["Col"]),o["default"].use($e["Row"]),o["default"].use($e["Dialog"]),o["default"].use($e["Loading"]),o["default"].component($e["Message"].name,$e["Message"]),o["default"].prototype.$loading=$e["Loading"].service,o["default"].prototype.$message=$e["Message"];n("a7be"),n("0f7c"),n("f6b6"),n("8d7e"),n("90ba");o["default"].use(Ae.a),o["default"].config.productionTip=!1,new o["default"]({store:ze,render:function(e){return e(ke)}}).$mount("#app")},"733a":function(e,t,n){"use strict";var o=n("9ca3"),i=n.n(o);i.a},"73ea":function(e,t,n){},"90ba":function(e,t,n){},"9ca3":function(e,t,n){},"9cf8":function(e,t,n){"use strict";var o=n("73ea"),i=n.n(o);i.a},"9e7d":function(e,t,n){},e022:function(e,t,n){n("99af"),n("c975"),n("a15b"),n("d3b7"),n("4d63"),n("ac1f"),n("25f0"),n("466d"),n("5319"),n("1276"),function(){"undefined"!==typeof window&&(window.PR_SHOULD_USE_CONTINUATION=!0),function(){function e(e){function t(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=d[n])?t:"0"<=n&&"7">=n?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1)}function n(e){return 32>e?(16>e?"\\x0":"\\x")+e.toString(16):(e=String.fromCharCode(e),"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e)}function o(e){var o=e.substring(1,e.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));e=[];var i="^"===o[0],r=["["];i&&r.push("^");i=i?1:0;for(var a=o.length;il||122l||90l||122s[0]&&(s[1]+1>s[0]&&r.push("-"),r.push(n(s[1])));return r.push("]"),r.join("")}function i(e){for(var t=e.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),i=t.length,s=[],l=0,c=0;l/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null])),o=e.regexLiterals){var r=(o=1|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*(/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+r+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+r+")*(?:\\x5D|$))+/)")])}return(o=e.types)&&n.push(["typ",o]),o=(""+e.keywords).replace(/^ | $/g,""),o.length&&n.push(["kwd",new RegExp("^(?:"+o.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]),o="^.[^\\s\\w.$@'\"`/\\\\]*",e.regexLiterals&&(o+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(o),null]),i(t,n)}function a(e,t,n){function o(e){var t=e.nodeType;if(1!=t||r.test(e.className)){if((3==t||4==t)&&n){var l=e.nodeValue,c=l.match(a);c&&(t=l.substring(0,c.index),e.nodeValue=t,(l=l.substring(c.index+c[0].length))&&e.parentNode.insertBefore(s.createTextNode(l),e.nextSibling),i(e),t||e.parentNode.removeChild(e))}}else if("br"===e.nodeName.toLowerCase())i(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)o(e)}function i(e){function t(e,n){var o=n?e.cloneNode(!1):e,i=e.parentNode;if(i){i=t(i,1);var r=e.nextSibling;i.appendChild(o);for(var a=r;a;a=r)r=a.nextSibling,i.appendChild(a)}return o}for(;!e.nextSibling;)if(e=e.parentNode,!e)return;e=t(e.nextSibling,0);for(var n;(n=e.parentNode)&&1===n.nodeType;)e=n;c.push(e)}for(var r=/(?:^|\s)nocode(?:\s|$)/,a=/\r\n?|\n/,s=e.ownerDocument,l=s.createElement("li");e.firstChild;)l.appendChild(e.firstChild);for(var c=[l],u=0;u=+s[1],n=/\n/g,e.a),d=c.length,f=(o=0,e.c),p=f.length,g=(i=0,e.g),h=g.length,m=0;for(g[h]=d,a=r=0;a=C&&(i+=2),o>=k&&(m+=2)}}finally{x&&(x.style.display=e)}}catch(R){u.console&&console.log(R&&R.stack||R)}}var u="undefined"!==typeof window?window:{},d=["break,continue,do,else,for,if,return,while"],f=[[d,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[f,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],g=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[f,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],m=(f=[f,"abstract,async,await,constructor,debugger,enum,eval,export,from,function,get,import,implements,instanceof,interface,let,null,of,set,undefined,var,with,yield,Infinity,NaN"],[d,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"]),b=[d,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=(d=[d,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/),y=/\S/,x=r({keywords:[p,h,g,f,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",m,b,d],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),w={};s(x,["default-code"]),s(i([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" ")),s(i([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),s(i([],[["atv",/^[\s\S]+/]]),["uq.val"]),s(r({keywords:p,hashComments:!0,cStyleComments:!0,types:v}),"c cc cpp cxx cyc m".split(" ")),s(r({keywords:"null,true,false"}),["json"]),s(r({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),s(r({keywords:g,cStyleComments:!0}),["java"]),s(r({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),s(r({keywords:m,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),s(r({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),s(r({keywords:b,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),s(r({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),s(r({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),s(i([],[["str",/^[\s\S]+/]]),["regex"]);var C=u.PR={createSimpleLexer:i,registerLangHandler:s,sourceDecorator:r,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:u.prettyPrintOne=function(e,t,n){n=n||!1,t=t||null;var o=document.createElement("div");return o.innerHTML="
    "+e+"
    ",o=o.firstChild,n&&a(o,n,!0),c({j:t,m:n,h:o,l:1,a:null,i:null,c:null,g:null}),o.innerHTML},prettyPrint:u.prettyPrint=function(e,t){function n(){for(var t=u.PR_SHOULD_USE_CONTINUATION?p.now()+250:1/0;g\n
    \n
    \n
    Loading...
    \n
    \n
    \n
    \n\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Loading.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Loading.vue?vue&type=template&id=71788ed8&scoped=true&\"\nimport script from \"./Loading.vue?vue&type=script&lang=js&\"\nexport * from \"./Loading.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"71788ed8\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\",class:{'container_night': _vm.nightMode}},[_c('el-container',[_c('el-header',{staticClass:\"editor__header\"},[_c('editor-header',{on:{\"refresh\":_vm.onEditorRefresh,\"uploaded\":_vm.uploaded,\"cssChanged\":_vm.cssChanged,\"showBox\":function($event){_vm.showBox = !_vm.showBox},\"showAboutDialog\":function($event){_vm.aboutDialogVisible = true},\"showDialogForm\":function($event){_vm.dialogFormVisible = true},\"startCopy\":function($event){_vm.isCoping = true, _vm.backLight = true},\"endCopy\":_vm.endCopy}})],1),_c('el-main',{staticClass:\"main-body\"},[_c('el-row',{staticClass:\"main-section\",attrs:{\"gutter\":10}},[_c('el-col',{attrs:{\"span\":12}},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.source),expression:\"source\"}],attrs:{\"id\":\"editor\",\"type\":\"textarea\",\"placeholder\":\"Your markdown text here.\"},domProps:{\"value\":(_vm.source)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.source=$event.target.value}}})]),_c('el-col',{staticClass:\"preview-wrapper\",class:{'preview-wrapper_night': _vm.nightMode && _vm.isCoping},attrs:{\"span\":12,\"id\":\"preview\"}},[_c('section',{class:{'output_night': _vm.nightMode && !_vm.backLight},attrs:{\"id\":\"output-wrapper\"}},[_c('div',{staticClass:\"preview\"},[_c('section',{attrs:{\"id\":\"output\"},domProps:{\"innerHTML\":_vm._s(_vm.output)}}),(_vm.nightMode && _vm.isCoping)?_c('div',{staticClass:\"loading-mask\"},[_c('div',{staticClass:\"loading__img\"}),_c('span',[_vm._v(\"正在生成\")])]):_vm._e()])])]),_c('transition',{attrs:{\"name\":\"custom-classes-transition\",\"enter-active-class\":\"animated bounceInRight\"}},[_c('el-col',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.showBox),expression:\"showBox\"}],attrs:{\"id\":\"cssBox\",\"span\":12}},[_c('textarea',{attrs:{\"id\":\"cssEditor\",\"type\":\"textarea\",\"placeholder\":\"Your custom css here.\"}})])],1)],1)],1)],1),_c('about-dialog',{attrs:{\"aboutDialogVisible\":_vm.aboutDialogVisible},on:{\"close\":function($event){_vm.aboutDialogVisible = false}}}),_c('insert-form-dialog',{attrs:{\"dialogFormVisible\":_vm.dialogFormVisible},on:{\"close\":function($event){_vm.dialogFormVisible = false}}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import CodeMirror from \"codemirror/lib/codemirror\";\n(function () {\n CodeMirror.extendMode('css', {\n commentStart: '/*',\n commentEnd: '*/',\n newlineAfterToken: function (type, content) {\n return /^[;{}]$/.test(content)\n }\n })\n\n // Comment/uncomment the specified range\n CodeMirror.defineExtension('commentRange', function (isComment, from, to) {\n var cm = this; var curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state).mode\n cm.operation(function () {\n if (isComment) { // Comment range\n cm.replaceRange(curMode.commentEnd, to)\n cm.replaceRange(curMode.commentStart, from)\n if (from.line == to.line && from.ch == to.ch) // An empty comment inserted - put cursor inside\n { cm.setCursor(from.line, from.ch + curMode.commentStart.length) }\n } else { // Uncomment range\n var selText = cm.getRange(from, to)\n var startIndex = selText.indexOf(curMode.commentStart)\n var endIndex = selText.lastIndexOf(curMode.commentEnd)\n if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {\n // Take string till comment start\n selText = selText.substr(0, startIndex) +\n // From comment start till comment end\n selText.substring(startIndex + curMode.commentStart.length, endIndex) +\n // From comment end till string end\n selText.substr(endIndex + curMode.commentEnd.length)\n }\n cm.replaceRange(selText, from, to)\n }\n })\n })\n\n // Applies automatic mode-aware indentation to the specified range\n CodeMirror.defineExtension('autoIndentRange', function (from, to) {\n var cmInstance = this\n this.operation(function () {\n for (var i = from.line; i <= to.line; i++) {\n cmInstance.indentLine(i, 'smart')\n }\n })\n })\n\n // Applies automatic formatting to the specified range\n CodeMirror.defineExtension('autoFormatRange', function (from, to) {\n var cm = this\n var outer = cm.getMode(); var text = cm.getRange(from, to).split('\\n')\n var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state)\n var tabSize = cm.getOption('tabSize')\n\n var out = ''; var lines = 0; var atSol = from.ch == 0\n function newline () {\n out += '\\n'\n atSol = true\n ++lines\n }\n\n for (var i = 0; i < text.length; ++i) {\n var stream = new CodeMirror.StringStream(text[i], tabSize)\n while (!stream.eol()) {\n var inner = CodeMirror.innerMode(outer, state)\n var style = outer.token(stream, state); var cur = stream.current()\n stream.start = stream.pos\n if (!atSol || /\\S/.test(cur)) {\n out += cur\n atSol = false\n }\n if (!atSol && inner.mode.newlineAfterToken &&\n inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || '', inner.state)) { newline() }\n }\n if (!stream.pos && outer.blankLine) outer.blankLine(state)\n if (!atSol) newline()\n }\n\n cm.operation(function () {\n cm.replaceRange(out, from, to)\n for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur) { cm.indentLine(cur, 'smart') }\n cm.setSelection(from, cm.getCursor(false))\n })\n })\n})()\n","import axios from 'axios';\n\n// 创建axios实例\nconst service = axios.create({\n baseURL: '',\n timeout: 10 * 1000 // 请求超时时间\n});\n\nservice.interceptors.request.use(\n config => {\n if (/^(post)|(put)|(delete)$/i.test(config.method)) {\n if (config.data && config.data.upload) {\n config.headers['Content-Type'] = 'multipart/form-data';\n }\n }\n return config;\n }, error => {\n Promise.reject(error);\n }\n);\n\nservice.interceptors.response.use(res => {\n if (res.data.success) {\n return res.data;\n }\n console.log(res);\n return Promise.reject(res.data);\n}, error => Promise.reject(error));\n\nexport default service;","import fetch from './fetch';\n\n\nfunction fileUpload(data) {\n return fetch({\n url: 'https://imgkr.com/api/files/upload',\n method: 'post',\n data: data\n })\n}\n\n\nexport default {\n fileUpload\n};","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-container',{staticClass:\"top is-dark\"},[_c('el-upload',{staticClass:\"header__item\",attrs:{\"action\":\"https://imgkr.com/api/files/upload\",\"headers\":{'Content-Type': 'multipart/form-data'},\"show-file-list\":false,\"multiple\":true,\"accept\":\".jpg,.jpeg,.png,.gif\",\"name\":\"file\",\"before-upload\":_vm.beforeUpload}},[_c('el-tooltip',{attrs:{\"effect\":_vm.effect,\"content\":\"上传图片\",\"placement\":\"bottom-start\"}},[_c('i',{staticClass:\"el-icon-upload\",attrs:{\"size\":\"medium\"}})])],1),_c('el-tooltip',{staticClass:\"header__item\",attrs:{\"effect\":_vm.effect,\"content\":\"下载编辑框Markdown文档\",\"placement\":\"bottom-start\"}},[_c('i',{staticClass:\"el-icon-download\",attrs:{\"size\":\"medium\"},on:{\"click\":_vm.downloadEditorContent}})]),_c('el-tooltip',{staticClass:\"header__item\",attrs:{\"effect\":_vm.effect,\"content\":\"重置页面\",\"placement\":\"bottom-start\"}},[_c('i',{staticClass:\"el-icon-refresh\",attrs:{\"size\":\"medium\"},on:{\"click\":_vm.reset}})]),_c('el-tooltip',{staticClass:\"header__item header__item_last\",attrs:{\"effect\":_vm.effect,\"content\":\"插入表格\",\"placement\":\"bottom-start\"}},[_c('i',{staticClass:\"el-icon-s-grid\",attrs:{\"size\":\"medium\"},on:{\"click\":function($event){return _vm.$emit('showDialogForm')}}})]),_c('el-form',{staticClass:\"ctrl\",attrs:{\"size\":\"mini\",\"inline\":true}},[_c('el-form-item',[_c('el-select',{attrs:{\"size\":\"mini\",\"placeholder\":\"选择字体\",\"clearable\":\"\"},on:{\"change\":_vm.fontChanged},model:{value:(_vm.selectFont),callback:function ($$v) {_vm.selectFont=$$v},expression:\"selectFont\"}},_vm._l((_vm.config.builtinFonts),function(font){return _c('el-option',{key:font.value,style:({fontFamily: font.value}),attrs:{\"label\":font.label,\"value\":font.value}},[_c('span',{staticClass:\"select-item-left\"},[_vm._v(_vm._s(font.label))]),_c('span',{staticClass:\"select-item-right\"},[_vm._v(\"Abc\")])])}),1)],1),_c('el-form-item',[_c('el-select',{attrs:{\"size\":\"mini\",\"placeholder\":\"选择段落字号\",\"clearable\":\"\"},on:{\"change\":_vm.sizeChanged},model:{value:(_vm.selectSize),callback:function ($$v) {_vm.selectSize=$$v},expression:\"selectSize\"}},_vm._l((_vm.config.sizeOption),function(size){return _c('el-option',{key:size.value,attrs:{\"label\":size.label,\"value\":size.value}},[_c('span',{staticClass:\"select-item-left\"},[_vm._v(_vm._s(size.label))]),_c('span',{staticClass:\"select-item-right\"},[_vm._v(_vm._s(size.desc))])])}),1)],1),_c('el-form-item',[_c('el-select',{attrs:{\"size\":\"mini\",\"placeholder\":\"选择颜色\",\"clearable\":\"\"},on:{\"change\":_vm.colorChanged},model:{value:(_vm.selectColor),callback:function ($$v) {_vm.selectColor=$$v},expression:\"selectColor\"}},_vm._l((_vm.config.colorOption),function(color){return _c('el-option',{key:color.value,attrs:{\"label\":color.label,\"value\":color.value}},[_c('span',{staticClass:\"select-item-left\"},[_vm._v(_vm._s(color.label))]),_c('span',{staticClass:\"select-item-right\"},[_vm._v(_vm._s(color.hex))])])}),1)],1),_c('el-tooltip',{attrs:{\"content\":\"自定义颜色\",\"effect\":_vm.effect,\"placement\":\"top\"}},[_c('el-color-picker',{attrs:{\"size\":\"mini\",\"show-alpha\":\"\"},on:{\"change\":_vm.colorChanged},model:{value:(_vm.selectColor),callback:function ($$v) {_vm.selectColor=$$v},expression:\"selectColor\"}})],1),_c('el-tooltip',{attrs:{\"content\":\"微信外链自动转为文末引用\",\"effect\":_vm.effect,\"placement\":\"top\"}},[_c('el-switch',{staticClass:\"header__switch\",attrs:{\"active-color\":\"#67c23a\",\"inactive-color\":\"#dcdfe6\"},on:{\"change\":_vm.statusChanged},model:{value:(_vm.citeStatus),callback:function ($$v) {_vm.citeStatus=$$v},expression:\"citeStatus\"}})],1)],1),_c('el-tooltip',{staticClass:\"item\",attrs:{\"effect\":_vm.effect,\"content\":\"自定义CSS样式\",\"placement\":\"left\"}},[_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\",\"size\":\"medium\",\"icon\":\"el-icon-setting\"},on:{\"click\":_vm.customStyle}})],1),_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\",\"size\":\"medium\"},on:{\"click\":_vm.copy}},[_vm._v(\"复制\")]),_c('el-button',{staticClass:\"about\",attrs:{\"type\":_vm.btnType,\"plain\":\"\",\"size\":\"medium\"},on:{\"click\":function($event){return _vm.$emit('showAboutDialog')}}},[_vm._v(\"关于\")]),_c('el-tooltip',{attrs:{\"content\":\"夜间模式\",\"placement\":\"bottom-start\"}},[(!_vm.nightMode)?_c('div',{staticClass:\"mode__switch\",on:{\"click\":_vm.themeChanged}}):_c('div',{staticClass:\"mode__switch mode__switch_black\",on:{\"click\":_vm.themeChanged}})]),_c('resetDialog',{attrs:{\"showResetConfirm\":_vm.showResetConfirm},on:{\"confirm\":_vm.confirmReset,\"close\":_vm.cancelReset}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\n BASE: {\n 'text-align': 'left',\n 'color': '#3f3f3f',\n 'line-height': '1.75',\n },\n BASE_BLOCK: {\n 'margin': '1em 8px'\n },\n block: {\n // 一级标题样式\n h1: {\n 'font-size': '1.2em',\n 'text-align': 'center',\n 'font-weight': 'bold',\n 'display': 'table',\n 'margin': '2em auto 1em',\n 'padding': '0 1em',\n 'border-bottom': '2px solid rgba(0, 152, 116, 0.9)'\n },\n\n // 二级标题样式\n h2: {\n 'font-size': '1.2em',\n 'text-align': 'center',\n 'font-weight': 'bold',\n 'display': 'table',\n 'margin': '4em auto 2em',\n 'padding': '0 0.2em',\n 'background': 'rgba(0, 152, 116, 0.9)',\n 'color': '#fff'\n },\n\n // 三级标题样式\n h3: {\n 'font-weight': 'bold',\n 'font-size': '1.1em',\n 'margin': '2em 8px 0.75em 0',\n 'line-height': '1.2',\n 'padding-left': '8px',\n 'border-left': '3px solid rgba(0, 152, 116, 0.9)'\n },\n\n // 四级标题样式\n h4: {\n 'font-weight': 'bold',\n 'font-size': '1em',\n 'margin': '2em 8px 0.5em',\n 'color': 'rgba(66, 185, 131, 0.9)'\n },\n\n // 段落样式\n p: {\n 'margin': '1.5em 8px',\n 'letter-spacing': '0.1em'\n },\n\n // 引用样式\n blockquote: {\n 'font-style': 'normal',\n 'border-left': 'none',\n 'padding': '1em',\n 'border-radius': '4px',\n 'color': '#FEEEED',\n 'background': 'rgba(27,31,35,.05)',\n 'margin': '2em 8px'\n },\n\n blockquote_p: {\n 'letter-spacing': '0.1em',\n 'color': 'rgb(80, 80, 80)',\n 'font-family': 'PingFangSC-light, PingFangTC-light, Open Sans, Helvetica Neue, sans-serif',\n 'font-size': '1em',\n 'display': 'inline',\n },\n\n code: {\n 'font-size': '80%',\n 'overflow': 'auto',\n 'color': '#333',\n 'background': 'rgb(247, 247, 247)',\n 'border-radius': '2px',\n 'padding': '10px',\n 'line-height': '1.5',\n 'border': '1px solid rgb(236,236,236)',\n 'margin': '20px 0',\n },\n\n image: {\n 'border-radius': '4px',\n 'display': 'block',\n 'margin': '0.1em auto 0.5em',\n 'width': '100% !important',\n },\n\n image_org: {\n 'border-radius': '4px',\n 'display': 'block'\n },\n\n ol: {\n 'margin-left': '0',\n 'padding-left': '1em'\n },\n\n ul: {\n 'margin-left': '0',\n 'padding-left': '1em',\n 'list-style': 'circle'\n },\n\n footnotes: {\n 'margin': '0.5em 8px',\n 'font-size': '80%'\n },\n\n figure: {\n 'margin': '1.5em 8px',\n }\n },\n inline: {\n listitem: {\n 'text-indent': '-1em',\n 'display': 'block',\n 'margin': '0.2em 8px'\n },\n\n codespan: {\n 'font-size': '90%',\n 'color': '#d14',\n 'background': 'rgba(27,31,35,.05)',\n 'padding': '3px 5px',\n 'border-radius': '4px',\n },\n\n link: {\n 'color': '#576b95'\n },\n\n wx_link: {\n 'color': '#576b95',\n 'text-decoration': 'none',\n },\n\n // 字体加粗样式\n strong: {\n 'color': 'rgba(15, 76, 129, 0.9)',\n 'font-weight': 'bold',\n },\n\n table: {\n 'border-collapse': 'collapse',\n 'text-align': 'center',\n 'margin': '1em 8px'\n },\n\n thead: {\n 'background': 'rgba(0, 0, 0, 0.05)',\n 'font-weight': 'bold'\n },\n\n td: {\n 'border': '1px solid #dfdfdf',\n 'padding': '0.25em 0.5em'\n },\n\n footnote: {\n 'font-size': '12px'\n },\n\n figcaption: {\n 'text-align': 'center',\n 'color': '#888',\n 'font-size': '0.8em'\n }\n }\n};\n","import default_theme from \"./themes/default-theme\";\n\n\n// 设置自定义颜色\nexport function setColorWithTemplate (template) {\n return function (color) {\n let custom_theme = JSON.parse(JSON.stringify(template))\n custom_theme.block.h1['border-bottom'] = `2px solid ${color}`\n custom_theme.block.h2['background'] = color\n custom_theme.block.h3['border-left'] = `3px solid ${color}`\n custom_theme.block.h4['color'] = color\n custom_theme.inline.strong['color'] = color\n return custom_theme\n }\n}\n\nexport const setColorWithCustomTemplate = function setColorWithCustomTemplate (\n template,\n color\n) {\n let custom_theme = JSON.parse(JSON.stringify(template))\n custom_theme.block.h1['border-bottom'] = `2px solid ${color}`\n custom_theme.block.h2['background'] = color\n custom_theme.block.h3['border-left'] = `3px solid ${color}`\n custom_theme.block.h4['color'] = color\n custom_theme.inline.strong['color'] = color\n return custom_theme\n}\n\n// 设置自定义字体大小\nexport function setFontSizeWithTemplate (template) {\n return function (fontSize) {\n let custom_theme = JSON.parse(JSON.stringify(template))\n custom_theme.block.h1['font-size'] = `${fontSize * 1.14}px`\n custom_theme.block.h2['font-size'] = `${fontSize * 1.1}px`\n custom_theme.block.h3['font-size'] = `${fontSize}px`\n custom_theme.block.h4['font-size'] = `${fontSize}px`\n return custom_theme\n }\n}\n\nexport const setColor = setColorWithTemplate(default_theme)\nexport const setFontSize = setFontSizeWithTemplate(default_theme)\n\nexport function customCssWithTemplate (jsonString, color, theme) {\n let custom_theme = JSON.parse(JSON.stringify(theme))\n // block\n custom_theme.block.h1['border-bottom'] = `2px solid ${color}`\n custom_theme.block.h2['background'] = color\n custom_theme.block.h3['border-left'] = `3px solid ${color}`\n custom_theme.block.h4['color'] = color\n custom_theme.inline.strong['color'] = color\n\n custom_theme.block.h1 = Object.assign(custom_theme.block.h1, jsonString.h1)\n custom_theme.block.h2 = Object.assign(custom_theme.block.h2, jsonString.h2)\n custom_theme.block.h3 = Object.assign(custom_theme.block.h3, jsonString.h3)\n custom_theme.block.h4 = Object.assign(custom_theme.block.h4, jsonString.h4)\n custom_theme.block.p = Object.assign(custom_theme.block.p, jsonString.p)\n custom_theme.block.blockquote = Object.assign(\n custom_theme.block.blockquote,\n jsonString.blockquote\n )\n custom_theme.block.blockquote_p = Object.assign(\n custom_theme.block.blockquote_p,\n jsonString.blockquote_p\n )\n custom_theme.block.image = Object.assign(\n custom_theme.block.image,\n jsonString.image\n )\n\n // inline\n custom_theme.inline.strong = Object.assign(\n custom_theme.inline.strong,\n jsonString.strong\n )\n custom_theme.inline.codespan = Object.assign(\n custom_theme.inline.codespan,\n jsonString.codespan\n )\n custom_theme.inline.link = Object.assign(\n custom_theme.inline.link,\n jsonString.link\n )\n custom_theme.inline.wx_link = Object.assign(\n custom_theme.inline.wx_link,\n jsonString.wx_link\n )\n\n return custom_theme\n}\n\n/**\n * 将CSS形式的字符串转换为JSON\n *\n * @param {css字符串} css\n */\nexport function css2json (css) {\n // 移除CSS所有注释\n while (\n (open = css.indexOf('/*')) !== -1 &&\n (close = css.indexOf('*/')) !== -1\n ) {\n css = css.substring(0, open) + css.substring(close + 2)\n }\n\n // 初始化返回值\n let json = {}\n\n while (css.length > 0 && css.indexOf('{') !== -1 && css.indexOf('}') !== -1) {\n // 存储第一个左/右花括号的下标\n const lbracket = css.indexOf('{')\n const rbracket = css.indexOf('}')\n\n // 第一步:将声明转换为Object,如:\n // `font: 'Times New Roman' 1em; color: #ff0000; margin-top: 1em;`\n // ==>\n // `{\"font\": \"'Times New Roman' 1em\", \"color\": \"#ff0000\", \"margin-top\": \"1em\"}`\n\n // 辅助方法:将array转为object\n function toObject (array) {\n let ret = {}\n array.forEach(e => {\n const index = e.indexOf(':')\n const property = e.substring(0, index).trim()\n const value = e.substring(index + 1).trim()\n ret[property] = value\n })\n return ret\n }\n\n // 切割声明块并移除空白符,然后放入数组中\n let declarations = css\n .substring(lbracket + 1, rbracket)\n .split(';')\n .map(e => e.trim())\n .filter(e => e.length > 0) // 移除所有\"\"空值\n\n // 转为Object对象\n declarations = toObject(declarations)\n\n // 第二步:选择器处理,每个选择器会与它对应的声明相关联,如:\n // `h1, p#bar {color: red}`\n // ==>\n // {\"h1\": {color: red}, \"p#bar\": {color: red}}\n\n let selectors = css\n .substring(0, lbracket)\n // 以,切割,并移除空格:`\"h1, p#bar, span.foo\"` => [\"h1\", \"p#bar\", \"span.foo\"]\n .split(',')\n .map(selector => selector.trim())\n\n // 迭代赋值\n selectors.forEach(selector => {\n // 若不存在,则先初始化\n if (!json[selector]) json[selector] = {}\n // 赋值到JSON\n Object.keys(declarations).forEach(key => {\n json[selector][key] = declarations[key]\n })\n })\n\n // 继续下个声明块\n css = css.slice(rbracket + 1).trim()\n }\n\n // 返回JSON形式的结果串\n return json\n}\n\n\n/**\n * 将编辑器内容保存到 LocalStorage\n * @param {*} editor \n * @param {*} name \n */\nexport function saveEditorContent(editor, name) {\n const content = editor.getValue(0)\n\n if (content) {\n localStorage.setItem(name, content)\n } else {\n localStorage.removeItem(name)\n }\n}\n\nexport function isImageIllegal(file) {\n if (!/\\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(file.name)) {\n return '请上传 JPG/PNG/GIF 格式的图片';\n }\n if (file.size > 5 * 1024 * 1024) {\n return '由于公众号限制,图片大小不能超过 5.0M';\n }\n return false;\n}","import juice from 'juice'\n\nexport function solveWeChatImage() {\n const clipboardDiv = document.getElementById('output');\n const images = clipboardDiv.getElementsByTagName(\"img\");\n for (let i = 0; i < images.length; i++) {\n const image = images[i];\n const width = image.getAttribute(\"width\");\n const height = image.getAttribute(\"height\");\n image.removeAttribute(\"width\");\n image.removeAttribute(\"height\");\n image.style.width = width;\n image.style.height = height;\n }\n}\nexport function solveHtml(nightMode = false) {\n const element = document.getElementById(\"output-wrapper\");\n let html = element.innerHTML\n let res = \"\";\n res = juice.inlineContent(\n html,\n {\n inlinePseudoElements: true,\n preserveImportant: true\n }\n );\n return res;\n}","export default {\n builtinFonts: [\n {\n label: '无衬线',\n value: '-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif'\n },\n {\n label: '衬线',\n value: \"Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif\"\n }\n ],\n sizeOption: [\n {\n label: '12px',\n value: '12px',\n desc: '更小'\n },\n {\n label: '13px',\n value: '13px',\n desc: '稍小'\n },\n {\n label: '14px',\n value: '14px',\n desc: '推荐'\n },\n {\n label: '15px',\n value: '15px',\n desc: '稍大'\n },\n {\n label: '16px',\n value: '16px',\n desc: '更大'\n }\n ],\n colorOption: [\n {\n label: '经典蓝',\n value: 'rgba(15, 76, 129, 1)',\n hex: '最新流行'\n },\n {\n label: '翡翠绿',\n value: 'rgba(0, 152, 116, 1)',\n hex: '优雅清新'\n },\n {\n label: '活力橘',\n value: 'rgba(250, 81, 81, 1)',\n hex: '热情活泼'\n }\n ],\n form: {\n rows: 1,\n cols: 1\n }\n};","const DEFAULT_CSS_CONTENT =\n`/*\n 按Ctrl+F可格式化\n*/\n/* 一级标题样式 */\nh1 {\n}\n/* 二级标题样式 */\nh2 {\n}\n/* 三级标题样式 */\nh3 {\n}\n/* 四级标题样式 */\nh4 {\n}\n/* 图片样式 */\nimage {\n}\n/* 引用样式 */\nblockquote {\n}\n/* 引用段落样式 */\nblockquote_p {\n}\n/* 段落样式 */\np {\n}\n/* 行内代码样式 */\ncodespan {\n}\n/* 粗体样式 */\nstrong {\n}\n/* 链接样式 */\nlink {\n}\n/* 微信链接样式 */\nwx_link {\n}\n`\nexport default DEFAULT_CSS_CONTENT\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{staticClass:\"reset__dialog\",attrs:{\"title\":\"提示\",\"visible\":_vm.showResetConfirm},on:{\"close\":function($event){return _vm.$emit('close')}}},[_c('div',{staticClass:\"text\"},[_vm._v(\" 此操作将丢失本地缓存的文本和自定义样式,是否继续? \")]),_c('div',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\"},on:{\"click\":function($event){return _vm.$emit('close')}}},[_vm._v(\"取 消\")]),_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\"},on:{\"click\":function($event){return _vm.$emit('confirm')}}},[_vm._v(\"确 定\")])],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./resetDialog.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./resetDialog.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./resetDialog.vue?vue&type=template&id=7fbc8ba6&scoped=true&\"\nimport script from \"./resetDialog.vue?vue&type=script&lang=js&\"\nexport * from \"./resetDialog.vue?vue&type=script&lang=js&\"\nimport style0 from \"./resetDialog.vue?vue&type=style&index=0&id=7fbc8ba6&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7fbc8ba6\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./header.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./header.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./header.vue?vue&type=template&id=7db86454&scoped=true&\"\nimport script from \"./header.vue?vue&type=script&lang=js&\"\nexport * from \"./header.vue?vue&type=script&lang=js&\"\nimport style0 from \"./header.vue?vue&type=style&index=0&id=7db86454&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7db86454\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{staticClass:\"about__dialog\",attrs:{\"title\":\"关于\",\"visible\":_vm.aboutDialogVisible,\"width\":\"30%\",\"center\":\"\"},on:{\"close\":function($event){return _vm.$emit('close')}}},[_c('div',{staticStyle:{\"text-align\":\"center\"}},[_c('h3',[_vm._v(\"一款高度简洁的微信 Markdown 编辑器\")])]),_c('div',{staticStyle:{\"text-align\":\"center\",\"margin-top\":\"10px\"}},[_c('p',[_vm._v(\"扫码关注我的公众号,原创技术文章第一时间推送!\")]),_c('img',{staticStyle:{\"width\":\"40%\",\"display\":\"block\",\"margin\":\"20px auto 10px\"},attrs:{\"src\":\"https://imgkr.cn-bj.ufileos.com/09f8e662-42ed-4731-a0d7-419deb74dfb6.png\"}})]),_c('span',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"type\":\"success\",\"plain\":\"\"},on:{\"click\":function($event){return _vm.onRedirect('https://github.com/doocs/md')}}},[_vm._v(\"GitHub 仓库\")]),_c('el-button',{attrs:{\"type\":\"success\",\"plain\":\"\"},on:{\"click\":function($event){return _vm.onRedirect('https://gitee.com/doocs/md')}}},[_vm._v(\"Gitee 仓库\")])],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./aboutDialog.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./aboutDialog.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./aboutDialog.vue?vue&type=template&id=362063c8&scoped=true&\"\nimport script from \"./aboutDialog.vue?vue&type=script&lang=js&\"\nexport * from \"./aboutDialog.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"362063c8\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{staticClass:\"insert__dialog\",attrs:{\"title\":\"插入表格\",\"visible\":_vm.dialogFormVisible},on:{\"close\":function($event){return _vm.$emit('close')}}},[_c('el-form',{staticClass:\"insert__form\",attrs:{\"model\":_vm.config.form}},[_c('el-form-item',{attrs:{\"label\":\"行数(表头不计入行数)\"}},[_c('el-input',{model:{value:(_vm.config.form.rows),callback:function ($$v) {_vm.$set(_vm.config.form, \"rows\", $$v)},expression:\"config.form.rows\"}})],1),_c('el-form-item',{attrs:{\"label\":\"列数\"}},[_c('el-input',{model:{value:(_vm.config.form.cols),callback:function ($$v) {_vm.$set(_vm.config.form, \"cols\", $$v)},expression:\"config.form.cols\"}})],1)],1),_c('div',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\"},on:{\"click\":function($event){return _vm.$emit('close')}}},[_vm._v(\"取 消\")]),_c('el-button',{attrs:{\"type\":_vm.btnType,\"plain\":\"\"},on:{\"click\":_vm.insertTable}},[_vm._v(\"确 定\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./insertForm.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./insertForm.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./insertForm.vue?vue&type=template&id=0bb71b82&scoped=true&\"\nimport script from \"./insertForm.vue?vue&type=script&lang=js&\"\nexport * from \"./insertForm.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"0bb71b82\",\n null\n \n)\n\nexport default component.exports","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\nimport CodeMirror from \"codemirror/lib/codemirror\";\n(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"));\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = { Backspace: handleBackspace, Enter: handleEnter };\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i),\n key = \"'\" + ch + \"'\";\n if (!keyMap[key]) keyMap[key] = handler(ch);\n }\n }\n ensureBound(defaults.pairs + \"`\");\n\n function handler(ch) {\n return function(cm) {\n return handleChar(cm, ch);\n };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\n \"\",\n Pos(cur.line, cur.ch - 1),\n Pos(cur.line, cur.ch + 1),\n \"+delete\"\n );\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n cm.execCommand(\"goCharLeft\");\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {\n anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))\n };\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf, \"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i],\n cur = range.head,\n curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur)) curType = \"both\";\n else if (\n triples.indexOf(ch) >= 0 &&\n cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch\n )\n curType = \"skipThree\";\n else curType = \"skip\";\n } else if (\n identical &&\n cur.ch > 1 &&\n triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch\n ) {\n if (\n cur.ch > 2 &&\n /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))\n )\n return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev =\n cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur);\n if (\n !CodeMirror.isWordChar(next) &&\n prev != ch &&\n !CodeMirror.isWordChar(prev)\n )\n curType = \"both\";\n else return CodeMirror.Pass;\n } else if (\n opening &&\n (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)\n ) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n cm.execCommand(\"goCharRight\");\n } else if (type == \"skipThree\") {\n for (var i = 0; i < 3; i++) cm.execCommand(\"goCharRight\");\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++) sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n cm.execCommand(\"goCharLeft\");\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n cm.execCommand(\"goCharRight\");\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1), Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1));\n return (\n /\\bstring/.test(token.type) &&\n token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n );\n }\n})(CodeMirror);\n","\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CodemirrorEditor.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CodemirrorEditor.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./CodemirrorEditor.vue?vue&type=template&id=19a01e50&scoped=true&\"\nimport script from \"./CodemirrorEditor.vue?vue&type=script&lang=js&\"\nexport * from \"./CodemirrorEditor.vue?vue&type=script&lang=js&\"\nimport style0 from \"./CodemirrorEditor.vue?vue&type=style&index=0&id=19a01e50&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"19a01e50\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=1407684e&scoped=true&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"1407684e\",\n null\n \n)\n\nexport default component.exports","import marked from 'marked'\nconst WxRenderer = function (opts) {\n this.opts = opts\n let ENV_STRETCH_IMAGE = true\n\n let footnotes = []\n let footnoteIndex = 0\n let styleMapping = null\n\n const CODE_FONT_FAMILY = 'Menlo, Operator Mono, Consolas, Monaco, monospace'\n\n let merge = (base, extend) => Object.assign({}, base, extend)\n\n this.buildTheme = themeTpl => {\n let mapping = {}\n let base = merge(themeTpl.BASE, {\n 'font-family': this.opts.fonts,\n 'font-size': this.opts.size\n })\n let base_block = merge(base, {})\n for (let ele in themeTpl.inline) {\n if (themeTpl.inline.hasOwnProperty(ele)) {\n let style = themeTpl.inline[ele]\n if (ele === 'codespan') {\n style['font-family'] = CODE_FONT_FAMILY\n style['white-space'] = 'normal'\n }\n mapping[ele] = merge(base, style)\n }\n }\n\n for (let ele in themeTpl.block) {\n if (themeTpl.block.hasOwnProperty(ele)) {\n let style = themeTpl.block[ele]\n if (ele === 'code') {\n style['font-family'] = CODE_FONT_FAMILY\n }\n mapping[ele] = merge(base_block, style)\n }\n }\n return mapping\n }\n\n let getStyles = (tokenName, addition) => {\n let arr = []\n let dict = styleMapping[tokenName]\n if (!dict) return ''\n for (const key in dict) {\n arr.push(key + ':' + dict[key])\n }\n return `style=\"${arr.join(';') + (addition || '')}\"`\n }\n\n let addFootnote = (title, link) => {\n footnotes.push([++footnoteIndex, title, link])\n return footnoteIndex\n }\n\n this.buildFootnotes = () => {\n let footnoteArray = footnotes.map(x => {\n if (x[1] === x[2]) {\n return `[${x[0]}]: ${x[1]}
    `\n }\n return `[${x[0]}] ${x[1]}: ${x[2]}
    `\n })\n return `

    引用链接

    ${footnoteArray.join('\\n')}

    `\n }\n\n this.buildAddition = () => {\n return `\n \n `\n }\n\n this.setOptions = newOpts => {\n this.opts = merge(this.opts, newOpts)\n }\n\n this.hasFootnotes = () => footnotes.length !== 0\n\n this.getRenderer = (status) => {\n footnotes = []\n footnoteIndex = 0\n\n styleMapping = this.buildTheme(this.opts.theme)\n let renderer = new marked.Renderer()\n\n renderer.heading = (text, level) => {\n switch (level) {\n case 1:\n return `

    ${text}

    `\n case 2:\n return `

    ${text}

    `\n case 3:\n return `

    ${text}

    `\n default:\n return `

    ${text}

    `\n }\n }\n renderer.paragraph = text => `

    ${text}

    `\n\n renderer.blockquote = text => {\n text = text.replace(//, `

    `)\n return `

    ${text}
    `\n }\n renderer.code = (text, infoString) => {\n text = text.replace(//g, '>')\n\n let lines = text.split('\\n')\n let codeLines = []\n let numbers = []\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n codeLines.push(`${(line || '
    ')}
    `)\n numbers.push('
  • ')\n }\n let lang = infoString || ''\n\n return `\n
    \n
      ${numbers.join('')}
    \n
    \n                ${codeLines.join('')}\n            
    \n
    \n `\n }\n renderer.codespan = (text, infoString) => `${text}`\n renderer.listitem = text => `<%s/>${text}`\n\n renderer.list = (text, ordered, start) => {\n text = text.replace(/<\\/*p.*?>/g, '')\n let segments = text.split(`<%s/>`)\n if (!ordered) {\n text = segments.join('•')\n return `

    ${text}

    `\n }\n text = segments[0]\n for (let i = 1; i < segments.length; i++) {\n text = text + i + '.' + segments[i]\n }\n return `

    ${text}

    `\n }\n renderer.image = (href, title, text) => {\n let subText = ''\n if (text) {\n subText = `
    ${text}
    `\n }\n let figureStyles = getStyles('figure')\n let imgStyles = getStyles(ENV_STRETCH_IMAGE ? 'image' : 'image_org')\n return `
    \"${text}\"/${subText}
    `\n }\n renderer.link = (href, title, text) => {\n if (href.indexOf('https://mp.weixin.qq.com') === 0) {\n return `${text}`\n } else if (href === text) {\n return text\n } else {\n if (status) {\n let ref = addFootnote(title || text, href)\n return `${text}[${ref}]`\n } else {\n return text\n }\n }\n }\n renderer.strong = text => `${text}`\n renderer.em = text => `

    ${text}

    `\n renderer.table = (header, body) => `
    ${header}${body}
    `\n // renderer.tablerow = (text) => `${text}`;\n renderer.tablecell = (text, flags) => `${text}`\n renderer.hr = () => `
    `\n return renderer\n }\n}\nexport default WxRenderer\n","const DEFAULT_CONTENT =\n`# 示例文章:Google 搜索的即时自动补全功能究竟是如何“工作”的?\n> Google 搜索**自动补全功能**的强大,相信不少朋友都能感受到,它帮助我们更快地“补全”我们所要输入的搜索关键字。那么,它怎么知道我们要输入什么内容?它又是如何工作的?在这篇文章里,我们一起来看看。\n\n## 使用自动补全\nGoogle 搜索的自动补全功能可以在 Google 搜索应用的大多数位置使用,包括 [Google](https://www.google.com/) 主页、适用于 IOS 和 Android 的 Google 应用,我们只需要在 Google 搜索框上开始键入关键字,就可以看到联想词了。\n\n![](https://imgkr.cn-bj.ufileos.com/17ed83bf-e028-4db2-9503-5a3b4e64deee.gif)\n\n在上图示例中,我们可以看到,输入关键字 \\`juej\\`,Google 搜索会联想到“掘金”、“掘金小册”、“绝句”等等,好处就是,我们无须输入完整的关键字即可轻松完成针对这些 topics 的搜索。\n\n谷歌搜索的自动补全功能对于使用移动设备的用户来说特别有用,用户可以轻松在难以键入的小屏幕上完成搜索。当然,对于移动设备用户和台式机用户而言,这都节省了大量的时间。根据 Google 官方报告,自动补全功能可以减少大约 25% 的打字,累积起来,预计每天可以节省 200 多年的打字时间。是的,每天!\n\n> 注意,本文所提到的“**联想词**”与“**预测**”,是同一个意思。\n\n## 基于“预测”而非“建议”\nGoogle 官方将自动补全功能称之为“预测”,而不是“建议”,为什么呢?其实是有充分理由的。自动补全功能是为了**帮助用户完成他们打算进行的搜索**,而不是建议用户要执行什么搜索。\n\n那么,Google 是如何确定这些“预测”的?其实,Google 会根据趋势搜索 [trends](https://trends.google.com/trends/?geo=US) 给到我们这些“预测”。简单来说,哪个热门、哪个搜索频率高,就更可能推给我们。当然,这也与我们当前所处的位置以及我们的搜索历史相关。\n\n另外,这些“预测”也会随着我们键入的关键字的变更而更改。例如,当我们把键入的关键字从 \\`juej\\` 更改为 \\`juex\\` 时,与“掘金”相关的预测会“消失”,同时,与“觉醒”、“决心”相关联的词会出现。\n\n![](https://imgkr.cn-bj.ufileos.com/5b17dc99-606d-42c1-9f86-e09e88aaa822.gif)\n\n## 为什么看不到某些联想词?\n如果我们在输入某个关键字时看不到联想词,那么表明 Google 的算法可能检测到:\n\n- 这个关键字不是热门字词;\n- 搜索的字词太新了,我们可能需要等待几天或几周才能看到联想词;\n- 这是一个侮辱性或敏感字词,这个搜索字词违反了 Google 的相关政策。更加详细的情况,可以了解 [Google 搜索自动补全政策](https://support.google.com/websearch/answer/7368877)。\n\n## 为什么会看到某些不当的联想词?\nGoogle 拥有专门设计的系统,可以自动捕获不适当的预测结果而不显示出来。然而,Google 每天需要处理数十亿次搜索,这意味着 Google 每天会显示数十亿甚至上百亿条预测。再好的系统,也可能存在缺陷,不正确的预测也可能随时会出现。\n\n我们作为 Google 搜索的用户,如果认定某条预测违反了相关的搜索自动补全政策,可以进行举报反馈,点击右下角“**举报不当的联想查询**”并勾选相关选项即可。\n\n![](https://imgkr.cn-bj.ufileos.com/6ca8185d-12c6-4550-bb4e-e49cfbf56db7.gif)\n\n## 如何实现自动补全算法?\n目前,Google 官方似乎并没有公开搜索自动补全的算法实现,但是业界在这方面已经有了不少研究。\n\n一个好的自动补全器必须是快速的,并且在用户键入下一个字符后立即更新联想词列表。**自动补全器的核心是一个函数,它接受输入的前缀,并搜索以给定前缀开头的词汇或语句列表**。通常来说,只需要返回少量的数目即可。\n\n接下来,我们先从一个简单且低效的实现开始,并在此基础上逐步构建更高效的方法。\n\n### 词汇表实现\n一个**简单粗暴的实现方式**是:顺序查找词汇表,依次检查每个词汇,看它是否以给定的前缀开头。\n\n但是,此方法需要将前缀与每个词汇进行匹配检查,若词汇量较少,这种方式可能勉强行得通。但是,如果词汇量规模较大,效率就太低了。\n\n一个**更好的实现方式是**:让词汇按字典顺序排序。借助二分搜索算法,可以快速搜索有序词汇表中的前缀。由于二分搜索的每一步都会将搜索的范围减半,因此,总的搜索时间与词汇表中单词数量的对数成正比,即时间复杂度是 \\`O(log N)\\`。二分搜索的性能很好,但有没有更好的实现呢?当然有,往下看。\n\n### 前缀树实现\n通常来说,许多词汇都以相同的前缀开头,比如 \\`need\\`、\\`nested\\` 都以 \\`ne\\` 开头,\\`seed\\`、\\`speed\\` 都以 \\`s\\` 开头。要是为每个单词分别存储公共前缀似乎很浪费。\n\n![](https://imgkr.cn-bj.ufileos.com/7cc3cf37-040a-420e-8ef9-d05e92c82cfd.png)\n\n前缀树是一种利用公共前缀来加速补全速度的数据结构。前缀树在节点树中排列一组单词,单词沿着从根节点到叶子节点的路径存储,树的层次对应于前缀的字母位置。\n\n前缀的补全是顺着前缀定义的路径来查找的。例如,在上图的前缀树中,前缀 \\`ne\\` 对应于从子节点取左边缘 \\`N\\` 和唯一边缘 \\`E\\` 的路径。然后可以通过继续遍历从 \\`E\\` 节点可以达到的所有叶节点来生成补全列表。在图中,\\`ne\\` 的补全可以是两个分支:\\`-ed\\` 和 \\`-sted\\`。如果在数中找不到由前缀定义的路径,则说明词汇表中不包含以该前缀开头的单词。\n\n### 有限状态自动机(DFA)实现\n前缀树可以有效处理公共前缀,但是,对于其他共享词部分,仍会分别存储在每个分支中。比如,后缀 \\`ed\\`、\\`ing\\`、\\`tion\\` 在英文单词中特别常见。在上一个例子中,\\`e\\`、\\`d\\` 分别存放在了每一个分支上。\n\n有没有一种方法可以更加节省存储空间呢?有的,那就是 DFA。\n\n
    \n
    \n\n在上面的例子中,单词 \\`need\\`、\\`nested\\`、\\`seed\\` 和 \\`speed\\` 仅由 9 个节点组成,而上一张图中的前缀树包含了 17 个节点。\n\n可以看出,最小化前缀树 DFA 可以在很大程度上减少数据结构的大小。即使词汇量很大,最小化 DFA 通常也适合在内存中存储,避免昂贵的磁盘访问是实现快速自动补全的关键。\n\n### 一些扩展\n上面介绍了如何利用合理的数据结构实现基本的自动补全功能。这些数据结构可以通过多种方式进行扩展,从而改善用户体验。\n\n通常,满足特定前缀的词汇可能很多,而用户界面上能够显示的却不多,我们更希望能显示最常搜索或者最有价值的词汇。这通常可以通过为词汇表中的每个单词增加一个代表单词值的**权重** \\`weight\\`,并且按照权重高低来排序自动补全列表。\n\n- 对于排序后的词汇表来说,在词汇表每个元素上增加 \\`weight\\` 属性并不难;\n- 对于前缀树来说,将 \\`weight\\` 存储在叶子节点中,也是很简单的一个实现;\n- 对于 \\`DFA\\` 来说,则较为复杂。因为一个叶子节点可以通过多条路径到达。一种解决方案是将权重关联到路径而不是叶子节点。\n\n目前有不少开源库都提供了这个功能,比如主流的搜索引擎框架 [Elasticsearch](https://www.elastic.co/products/elasticsearch)、[Solr](https://lucene.apache.org/solr/) 等,基于此,我们可以实现高效而强大的自动补全功能。\n\n#### 推荐阅读\n- [阿里又一个 20k+ stars 开源项目诞生,恭喜 fastjson!](https://mp.weixin.qq.com/s/RNKDCK2KoyeuMeEs6GUrow)\n- [刷掉 90% 候选人的互联网大厂海量数据面试题(附题解 + 方法总结)](https://mp.weixin.qq.com/s/rjGqxUvrEqJNlo09GrT1Dw)\n- [好用!期待已久的文本块功能究竟如何在 Java 13 中发挥作用?](https://mp.weixin.qq.com/s/kalGv5T8AZGxTnLHr2wDsA)\n- [2019 GitHub 开源贡献排行榜新鲜出炉!微软谷歌领头,阿里跻身前 12!](https://mp.weixin.qq.com/s/_q812aGD1b9QvZ2WFI0Qgw)\n\n---\n\n欢迎关注我的公众号“**Doocs开源社区**”,原创技术文章第一时间推送。\n\n
    \n \n
    \n\n`\nexport default DEFAULT_CONTENT\n","import Vue from 'vue'\nimport Vuex from 'vuex'\nimport config from '../scripts/config';\nimport WxRenderer from '../scripts/renderers/wx-renderer'\nimport marked from 'marked'\nimport CodeMirror from 'codemirror/lib/codemirror'\nimport DEFAULT_CONTENT from '../scripts/default-content'\nimport DEFAULT_CSS_CONTENT from '../scripts/themes/default-theme-css'\nimport {\n setColor\n} from '../scripts/util'\n\nVue.use(Vuex)\n\nconst state = {\n wxRenderer: null,\n output: '',\n editor: null,\n cssEditor: null,\n html: '',\n currentFont: '',\n currentSize: '',\n currentColor: '',\n citeStatus: 0,\n nightMode: false\n};\nconst mutations = {\n setHtml(state, data) {\n state.html = data;\n },\n setEditorValue(state, data) {\n state.editor.setValue(data)\n },\n setCssEditorValue(state, data) {\n state.cssEditor.setValue(data)\n },\n setWxRendererOptions(state, data) {\n state.wxRenderer.setOptions(data);\n },\n setCiteStatus(state, data) {\n state.citeStatus = data;\n localStorage.setItem('citeStatus', data)\n },\n setCurrentFont(state, data) {\n state.currentFont = data;\n localStorage.setItem('fonts', data)\n },\n setCurrentSize(state, data) {\n state.currentSize = data;\n localStorage.setItem('size', data)\n },\n setCurrentColor(state, data) {\n state.currentColor = data;\n localStorage.setItem('color', data)\n },\n themeChanged(state) {\n state.nightMode = !state.nightMode;\n },\n initEditorState(state) {\n state.currentFont = localStorage.getItem('fonts') || config.builtinFonts[0].value\n state.currentColor = localStorage.getItem('color') || config.colorOption[1].value\n state.currentSize = localStorage.getItem('size') || config.sizeOption[2].value\n state.citeStatus = localStorage.getItem('citeStatus') === 'true'\n state.wxRenderer = new WxRenderer({\n theme: setColor(state.currentColor),\n fonts: state.currentFont,\n size: state.currentSize,\n status: state.citeStatus\n })\n },\n initEditorEntity(state) {\n state.editor = CodeMirror.fromTextArea(\n document.getElementById('editor'), \n {\n value: '',\n mode: 'text/x-markdown',\n theme: 'xq-light',\n lineNumbers: false,\n lineWrapping: true,\n styleActiveLine: true,\n autoCloseBrackets: true\n }\n )\n // 如果有编辑器内容被保存则读取,否则加载默认内容\n if (localStorage.getItem('__editor_content')) {\n state.editor.setValue(localStorage.getItem('__editor_content'))\n } else {\n state.editor.setValue(DEFAULT_CONTENT)\n }\n },\n initCssEditorEntity(state) {\n state.cssEditor = CodeMirror.fromTextArea(\n document.getElementById('cssEditor'), {\n value: '',\n mode: 'css',\n theme: 'style-mirror',\n lineNumbers: false,\n lineWrapping: true,\n matchBrackets: true,\n autofocus: true,\n extraKeys: {\n 'Ctrl-F': function autoFormat(editor) {\n const totalLines = editor.lineCount()\n\n editor.autoFormatRange({\n line: 0,\n ch: 0\n }, {\n line: totalLines\n })\n }\n }\n }\n )\n\n // 如果有编辑器内容被保存则读取,否则加载默认内容\n if (localStorage.getItem('__css_content')) {\n state.cssEditor.setValue(localStorage.getItem('__css_content'))\n } else {\n state.cssEditor.setValue(DEFAULT_CSS_CONTENT)\n }\n },\n editorRefresh(state) {\n let output = marked(state.editor.getValue(0), {\n renderer: state.wxRenderer.getRenderer(state.citeStatus)\n })\n // 去除第一行的 margin-top\n output = output.replace(/(style=\".*?)\"/, '$1;margin-top: 0\"')\n if (state.citeStatus) {\n // 引用脚注\n output += state.wxRenderer.buildFootnotes()\n // 附加的一些 style\n output += state.wxRenderer.buildAddition()\n }\n state.output = output\n },\n clearEditorToDefault(state) {\n state.editor.setValue(DEFAULT_CONTENT)\n state.cssEditor.setValue(DEFAULT_CSS_CONTENT)\n }\n}\n\nexport default new Vuex.Store({\n state,\n mutations,\n actions: {},\n modules: {}\n})\n","import Vue from 'vue'\nimport {\n Container,\n Header,\n Upload,\n Tooltip,\n Form,\n FormItem,\n Select,\n Option,\n ColorPicker,\n Switch,\n Button,\n Main,\n Col,\n Row,\n Dialog,\n Loading,\n Message\n} from 'element-ui'\n\nVue.use(Container)\nVue.use(Header)\nVue.use(Upload)\nVue.use(Tooltip)\nVue.use(Form)\nVue.use(FormItem)\nVue.use(Select)\nVue.use(Option)\nVue.use(ColorPicker)\nVue.use(Switch)\nVue.use(Button)\nVue.use(Main)\nVue.use(Col)\nVue.use(Row)\nVue.use(Dialog)\nVue.use(Loading)\nVue.component(Message.name, Message)\n\nVue.prototype.$loading = Loading.service\nVue.prototype.$message = Message\n","import Vue from 'vue'\nimport App from './App.vue'\nimport store from './store'\nimport ElementUI from 'element-ui'\nimport 'element-ui/lib/theme-chalk/index.css'\nimport './element'\nimport 'codemirror/lib/codemirror.css';\nimport \"codemirror/theme/ambiance.css\";\nimport \"codemirror/addon/hint/show-hint.css\";\nimport \"codemirror/theme/xq-light.css\";\nimport \"./assets/less/theme.less\";\nVue.use(ElementUI)\n\nVue.config.productionTip = false\n\nnew Vue({\n store,\n render: h => h(App)\n}).$mount('#app')\n","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./header.vue?vue&type=style&index=0&id=7db86454&lang=less&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./header.vue?vue&type=style&index=0&id=7db86454&lang=less&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CodemirrorEditor.vue?vue&type=style&index=0&id=19a01e50&lang=less&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CodemirrorEditor.vue?vue&type=style&index=0&id=19a01e50&lang=less&scoped=true&\"","!function(){/*\n\n Copyright (C) 2006 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\"undefined\"!==typeof window&&(window.PR_SHOULD_USE_CONTINUATION=!0);\n(function(){function T(a){function d(e){var a=e.charCodeAt(0);if(92!==a)return a;var c=e.charAt(1);return(a=w[c])?a:\"0\"<=c&&\"7\">=c?parseInt(e.substring(1),8):\"u\"===c||\"x\"===c?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?\"\\\\x0\":\"\\\\x\")+e.toString(16);e=String.fromCharCode(e);return\"\\\\\"===e||\"-\"===e||\"]\"===e||\"^\"===e?\"\\\\\"+e:e}function c(e){var c=e.substring(1,e.length-1).match(RegExp(\"\\\\\\\\u[0-9A-Fa-f]{4}|\\\\\\\\x[0-9A-Fa-f]{2}|\\\\\\\\[0-3][0-7]{0,2}|\\\\\\\\[0-7]{1,2}|\\\\\\\\[\\\\s\\\\S]|-|[^-\\\\\\\\]\",\"g\"));\ne=[];var a=\"^\"===c[0],b=[\"[\"];a&&b.push(\"^\");for(var a=a?1:0,g=c.length;ak||122k||90k||122h[0]&&(h[1]+1>h[0]&&b.push(\"-\"),b.push(f(h[1])));b.push(\"]\");return b.join(\"\")}function m(e){for(var a=e.source.match(RegExp(\"(?:\\\\[(?:[^\\\\x5C\\\\x5D]|\\\\\\\\[\\\\s\\\\S])*\\\\]|\\\\\\\\u[A-Fa-f0-9]{4}|\\\\\\\\x[A-Fa-f0-9]{2}|\\\\\\\\[0-9]+|\\\\\\\\[^ux0-9]|\\\\(\\\\?[:!=]|[\\\\(\\\\)\\\\^]|[^\\\\x5B\\\\x5C\\\\(\\\\)\\\\^]+)\",\"g\")),b=a.length,d=[],g=0,h=0;g/,null])):d.push([\"com\",/^#[^\\r\\n]*/,null,\"#\"]));a.cStyleComments&&(f.push([\"com\",/^\\/\\/[^\\r\\n]*/,null]),f.push([\"com\",/^\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,null]));if(c=a.regexLiterals){var m=(c=1|\\\\/=?|::?|<>?>?=?|,|;|\\\\?|@|\\\\[|~|{|\\\\^\\\\^?=?|\\\\|\\\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\\\s*(\"+\n(\"/(?=[^/*\"+c+\"])(?:[^/\\\\x5B\\\\x5C\"+c+\"]|\\\\x5C\"+m+\"|\\\\x5B(?:[^\\\\x5C\\\\x5D\"+c+\"]|\\\\x5C\"+m+\")*(?:\\\\x5D|$))+/\")+\")\")])}(c=a.types)&&f.push([\"typ\",c]);c=(\"\"+a.keywords).replace(/^ | $/g,\"\");c.length&&f.push([\"kwd\",new RegExp(\"^(?:\"+c.replace(/[\\s,]+/g,\"|\")+\")\\\\b\"),null]);d.push([\"pln\",/^\\s+/,null,\" \\r\\n\\t\\u00a0\"]);c=\"^.[^\\\\s\\\\w.$@'\\\"`/\\\\\\\\]*\";a.regexLiterals&&(c+=\"(?!s*/)\");f.push([\"lit\",/^@[a-z_$][a-z_$@0-9]*/i,null],[\"typ\",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\\w+_t\\b)/,null],[\"pln\",/^[a-z_$][a-z_$@0-9]*/i,\nnull],[\"lit\",/^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*/i,null,\"0123456789\"],[\"pln\",/^\\\\[\\s\\S]?/,null],[\"pun\",new RegExp(c),null]);return G(d,f)}function L(a,d,f){function c(a){var b=a.nodeType;if(1==b&&!t.test(a.className))if(\"br\"===a.nodeName.toLowerCase())m(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)c(a);else if((3==b||4==b)&&f){var e=a.nodeValue,d=e.match(q);d&&(b=e.substring(0,d.index),a.nodeValue=b,(e=e.substring(d.index+\nd[0].length))&&a.parentNode.insertBefore(l.createTextNode(e),a.nextSibling),m(a),b||a.parentNode.removeChild(a))}}function m(a){function c(a,b){var e=b?a.cloneNode(!1):a,k=a.parentNode;if(k){var k=c(k,1),d=a.nextSibling;k.appendChild(e);for(var f=d;f;f=d)d=f.nextSibling,k.appendChild(f)}return e}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=c(a.nextSibling,0);for(var e;(e=a.parentNode)&&1===e.nodeType;)a=e;b.push(a)}for(var t=/(?:^|\\s)nocode(?:\\s|$)/,q=/\\r\\n?|\\n/,l=a.ownerDocument,n=l.createElement(\"li\");a.firstChild;)n.appendChild(a.firstChild);\nfor(var b=[n],p=0;p=+m[1],d=/\\n/g,t=a.a,q=t.length,f=0,l=a.c,n=l.length,c=0,b=a.g,p=b.length,w=0;b[p]=q;var r,e;for(e=r=0;e=h&&(c+=2);f>=k&&(w+=2)}}finally{g&&(g.style.display=a)}}catch(y){D.console&&console.log(y&&y.stack||y)}}var D=\"undefined\"!==typeof window?\nwindow:{},B=[\"break,continue,do,else,for,if,return,while\"],F=[[B,\"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile\"],\"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof\"],H=[F,\"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where\"],\nO=[F,\"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient\"],P=[F,\"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield\"],\nF=[F,\"abstract,async,await,constructor,debugger,enum,eval,export,from,function,get,import,implements,instanceof,interface,let,null,of,set,undefined,var,with,yield,Infinity,NaN\"],Q=[B,\"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None\"],R=[B,\"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END\"],\nB=[B,\"case,done,elif,esac,eval,fi,function,in,local,set,then,until\"],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,W=/\\S/,X=x({keywords:[H,P,O,F,\"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END\",Q,R,B],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),\nI={};t(X,[\"default-code\"]);t(G([],[[\"pln\",/^[^]*(?:>|$)/],[\"com\",/^<\\!--[\\s\\S]*?(?:-\\->|$)/],[\"lang-\",/^<\\?([\\s\\S]+?)(?:\\?>|$)/],[\"lang-\",/^<%([\\s\\S]+?)(?:%>|$)/],[\"pun\",/^(?:<[%?]|[%?]>)/],[\"lang-\",/^]*>([\\s\\S]+?)<\\/xmp\\b[^>]*>/i],[\"lang-js\",/^]*>([\\s\\S]*?)(<\\/script\\b[^>]*>)/i],[\"lang-css\",/^]*>([\\s\\S]*?)(<\\/style\\b[^>]*>)/i],[\"lang-in.tag\",/^(<\\/?[a-z][^<>]*>)/i]]),\"default-markup htm html mxml xhtml xml xsl\".split(\" \"));t(G([[\"pln\",/^[\\s]+/,\nnull,\" \\t\\r\\n\"],[\"atv\",/^(?:\\\"[^\\\"]*\\\"?|\\'[^\\']*\\'?)/,null,\"\\\"'\"]],[[\"tag\",/^^<\\/?[a-z](?:[\\w.:-]*\\w)?|\\/?>$/i],[\"atn\",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],[\"lang-uq.val\",/^=\\s*([^>\\'\\\"\\s]*(?:[^>\\'\\\"\\s\\/]|\\/(?=\\s)))/],[\"pun\",/^[=<>\\/]+/],[\"lang-js\",/^on\\w+\\s*=\\s*\\\"([^\\\"]+)\\\"/i],[\"lang-js\",/^on\\w+\\s*=\\s*\\'([^\\']+)\\'/i],[\"lang-js\",/^on\\w+\\s*=\\s*([^\\\"\\'>\\s]+)/i],[\"lang-css\",/^style\\s*=\\s*\\\"([^\\\"]+)\\\"/i],[\"lang-css\",/^style\\s*=\\s*\\'([^\\']+)\\'/i],[\"lang-css\",/^style\\s*=\\s*([^\\\"\\'>\\s]+)/i]]),[\"in.tag\"]);\nt(G([],[[\"atv\",/^[\\s\\S]+/]]),[\"uq.val\"]);t(x({keywords:H,hashComments:!0,cStyleComments:!0,types:S}),\"c cc cpp cxx cyc m\".split(\" \"));t(x({keywords:\"null,true,false\"}),[\"json\"]);t(x({keywords:P,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),[\"cs\"]);t(x({keywords:O,cStyleComments:!0}),[\"java\"]);t(x({keywords:B,hashComments:!0,multiLineStrings:!0}),[\"bash\",\"bsh\",\"csh\",\"sh\"]);t(x({keywords:Q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),[\"cv\",\"py\",\"python\"]);t(x({keywords:\"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END\",\nhashComments:!0,multiLineStrings:!0,regexLiterals:2}),[\"perl\",\"pl\",\"pm\"]);t(x({keywords:R,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),[\"rb\",\"ruby\"]);t(x({keywords:F,cStyleComments:!0,regexLiterals:!0}),[\"javascript\",\"js\",\"ts\",\"typescript\"]);t(x({keywords:\"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes\",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,\nregexLiterals:!0}),[\"coffee\"]);t(G([],[[\"str\",/^[\\s\\S]+/]]),[\"regex\"]);var Y=D.PR={createSimpleLexer:G,registerLangHandler:t,sourceDecorator:x,PR_ATTRIB_NAME:\"atn\",PR_ATTRIB_VALUE:\"atv\",PR_COMMENT:\"com\",PR_DECLARATION:\"dec\",PR_KEYWORD:\"kwd\",PR_LITERAL:\"lit\",PR_NOCODE:\"nocode\",PR_PLAIN:\"pln\",PR_PUNCTUATION:\"pun\",PR_SOURCE:\"src\",PR_STRING:\"str\",PR_TAG:\"tag\",PR_TYPE:\"typ\",prettyPrintOne:D.prettyPrintOne=function(a,d,f){f=f||!1;d=d||null;var c=document.createElement(\"div\");c.innerHTML=\"
    \"+a+\"
    \";\nc=c.firstChild;f&&L(c,f,!0);M({j:d,m:f,h:c,l:1,a:null,i:null,c:null,g:null});return c.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function f(){for(var c=D.PR_SHOULD_USE_CONTINUATION?b.now()+250:Infinity;pl)i(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},"051a":function(e,t,n){var i=s(n("64b2")),r=l(i);t.XML=f(i,r);var o=s(n("f0f2")),a=l(o);function s(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function l(e){var t=[],n=[];return Object.keys(e).forEach((function(e){1===e.length?t.push("\\"+e):n.push(e)})),n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}t.HTML=f(o,a);var c=/[^\0-\x7F]/g,u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function h(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function d(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),i=1024*(t-55296)+n-56320+65536;return"&#x"+i.toString(16).toUpperCase()+";"}function f(e,t){function n(t){return e[t]}return function(e){return e.replace(t,n).replace(u,d).replace(c,h)}}var p=l(i);function m(e){return e.replace(p,h).replace(u,d).replace(c,h)}t.escape=m},"051b":function(e,t,n){var i=n("1a14"),r=n("10db");e.exports=n("0bad")?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},"057f":function(e,t,n){var i=n("fc6a"),r=n("241c").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return r(e)}catch(t){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):r(i(e))}},"05f5":function(e,t,n){var i=n("7a41"),r=n("ef08").document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},"06cf":function(e,t,n){var i=n("83ab"),r=n("d1e7"),o=n("5c6c"),a=n("fc6a"),s=n("c04e"),l=n("5135"),c=n("0cfb"),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(e,t){if(e=a(e),t=s(t,!0),c)try{return u(e,t)}catch(n){}if(l(e,t))return o(!r.f.call(e,t),e[t])}},"072d":function(e,t,n){"use strict";var i=n("0bad"),r=n("9876"),o=n("fed5"),a=n("1917"),s=n("0983"),l=n("9fbb"),c=Object.assign;e.exports=!c||n("4b8b")((function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=i}))?function(e,t){var n=s(e),c=arguments.length,u=1,h=o.f,d=a.f;while(c>u){var f,p=l(arguments[u++]),m=h?r(p).concat(h(p)):r(p),v=m.length,g=0;while(v>g)f=m[g++],i&&!d.call(p,f)||(n[f]=p[f])}return n}:c},"0983":function(e,t,n){var i=n("c901");e.exports=function(e){return Object(i(e))}},"0a06":function(e,t,n){"use strict";var i=n("c532"),r=n("30b5"),o=n("f6b4"),a=n("5270"),s=n("4a7b");function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=s(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));while(t.length)n=n.then(t.shift(),t.shift());return n},l.prototype.getUri=function(e){return e=s(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}})),i.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}))}})),e.exports=l},"0ae2":function(e,t,n){var i=n("9876"),r=n("fed5"),o=n("1917");e.exports=function(e){var t=i(e),n=r.f;if(n){var a,s=n(e),l=o.f,c=0;while(s.length>c)l.call(e,a=s[c++])&&t.push(a)}return t}},"0b99":function(e,t,n){"use strict";var i=n("19fa")(!0);n("393a")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})}))},"0bad":function(e,t,n){e.exports=!n("4b8b")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"0bfb":function(e,t,n){var i,r,o,a,s=!1,l=!1,c=n("115b")("parse"),u=n("c415");function h(e,t){var n,s;t||(t={}),i=!!t.comments,o=!!t.position,r=0,a=Array.isArray(e)?e.slice():u(e);var h,d=[];l&&(n=Date.now());while(h=f())s=w(h),s&&d.push(s);return l&&c("ran in",Date.now()-n+"ms"),{type:"stylesheet",stylesheet:{rules:d}}}function d(e,t){var n;t||(t={});for(var i=["type","name","value"],r={},a=0;a-1}function Xe(e,t){var n=this.__data__,i=ft(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}function Ze(e){var t=-1,n=e?e.length:0;this.clear();while(++tc))return!1;var h=o.get(e);if(h&&o.get(t))return h==t;var d=-1,f=!0,p=r&a?new it:void 0;o.set(e,t),o.set(t,e);while(++d-1&&e%1==0&&e-1&&e%1==0&&e<=c}function un(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function hn(e){return!!e&&"object"==typeof e}function dn(e){return"symbol"==typeof e||hn(e)&&ye.call(e)==C}var fn=ee?oe(ee):St;function pn(e){return null==e?"":jt(e)}function mn(e,t,n){var i=null==e?void 0:yt(e,t);return void 0===i?n:i}function vn(e,t){return null!=e&&Vt(e,t,xt)}function gn(e){return an(e)?dt(e):Et(e)}function yn(e){return e}function bn(e){return qt(e)?ie(Zt(e)):At(e)}n.exports=Qt}).call(this,n("c8ba"),n("62e4")(e))},"0df6":function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"0e15":function(e,t,n){var i=n("597f");e.exports=function(e,t,n){return void 0===n?i(e,t,!1):i(e,n,!1!==t)}},"0f7c":function(e,t,n){},"0f94":function(e,t,n){var i=e.exports;[n("68b4"),n("26f9"),n("7a39"),n("733c"),n("9f20"),n("f67e")].forEach((function(e){Object.keys(e).forEach((function(t){i[t]=e[t].bind(i)}))}))},"0fae":function(e,t,n){},1098:function(e,t,n){"use strict";t.__esModule=!0;var i=n("17ed"),r=l(i),o=n("f893"),a=l(o),s="function"===typeof a.default&&"symbol"===typeof r.default?function(e){return typeof e}:function(e){return e&&"function"===typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":typeof e};function l(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof a.default&&"symbol"===s(r.default)?function(e){return"undefined"===typeof e?"undefined":s(e)}:function(e){return e&&"function"===typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":"undefined"===typeof e?"undefined":s(e)}},"10db":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"111b":function(e,t,n){(function(e){e(n("56b3"),n("7b00"))})((function(e){"use strict";var t={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};e.registerHelper("hint","css",(function(n){var i=n.getCursor(),r=n.getTokenAt(i),o=e.innerMode(n.getMode(),r.state);if("css"==o.mode.name){if("keyword"==r.type&&0=="!important".indexOf(r.string))return{list:["!important"],from:e.Pos(i.line,r.start),to:e.Pos(i.line,r.end)};var a=r.start,s=i.ch,l=r.string.slice(0,s-a);/[^\w$_-]/.test(l)&&(l="",a=s=i.ch);var c=e.resolveMode("text/css"),u=[],h=o.state.state;return"pseudo"==h||"variable-3"==r.type?d(t):"block"==h||"maybeprop"==h?d(c.propertyKeywords):"prop"==h||"parens"==h||"at"==h||"params"==h?(d(c.valueKeywords),d(c.colorKeywords)):"media"!=h&&"media_parens"!=h||(d(c.mediaTypes),d(c.mediaFeatures)),u.length?{list:u,from:e.Pos(i.line,a),to:e.Pos(i.line,s)}:void 0}function d(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||u.push(t)}}))}))},1157:function(e,t,n){var i,r; +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2020-05-04T22:49Z + */(function(t,n){"use strict";"object"===typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)})("undefined"!==typeof window?window:this,(function(n,o){"use strict";var a=[],s=Object.getPrototypeOf,l=a.slice,c=a.flat?function(e){return a.flat.call(e)}:function(e){return a.concat.apply([],e)},u=a.push,h=a.indexOf,d={},f=d.toString,p=d.hasOwnProperty,m=p.toString,v=m.call(Object),g={},y=function(e){return"function"===typeof e&&"number"!==typeof e.nodeType},b=function(e){return null!=e&&e===e.window},x=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function _(e,t,n){n=n||x;var i,r,o=n.createElement("script");if(o.text=e,t)for(i in w)r=t[i]||t.getAttribute&&t.getAttribute(i),r&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function k(e){return null==e?e+"":"object"===typeof e||"function"===typeof e?d[f.call(e)]||"object":typeof e}var C="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function O(e){var t=!!e&&"length"in e&&e.length,n=k(e);return!y(e)&&!b(e)&&("array"===n||0===t||"number"===typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:C,constructor:S,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+I+")"+I+"*"),W=new RegExp(I+"|>"),U=new RegExp(R),G=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{M.apply(A=L.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(Ee){M={apply:A.length?function(e,t){$.apply(e,L.call(t))}:function(e,t){var n=e.length,i=0;while(e[n++]=t[i++]);e.length=n-1}}}function se(e,t,i,r){var o,s,c,u,h,p,g,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(i=i||[],"string"!==typeof e||!e||1!==w&&9!==w&&11!==w)return i;if(!r&&(d(t),t=t||f,m)){if(11!==w&&(h=Q.exec(e)))if(o=h[1]){if(9===w){if(!(c=t.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(y&&(c=y.getElementById(o))&&b(t,c)&&c.id===o)return i.push(c),i}else{if(h[2])return M.apply(i,t.getElementsByTagName(e)),i;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!E[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===w&&(W.test(e)||q.test(e))){y=ee.test(e)&&ge(t.parentNode)||t,y===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(ie,re):t.setAttribute("id",u=x)),p=a(e),s=p.length;while(s--)p[s]=(u?"#"+u:":scope")+" "+be(p[s]);g=p.join(",")}try{return M.apply(i,y.querySelectorAll(g)),i}catch(_){E(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(V,"$1"),t,i,r)}function le(){var e=[];function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}return t}function ce(e){return e[x]=!0,e}function ue(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(Ee){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){var n=e.split("|"),r=n.length;while(r--)i.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return ce((function(t){return t=+t,ce((function(n,i){var r,o=e([],n.length,t),a=o.length;while(a--)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))}))}))}function ge(e){return e&&"undefined"!==typeof e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=se.setDocument=function(e){var t,r,a=e?e.ownerDocument||e:w;return a!=f&&9===a.nodeType&&a.documentElement?(f=a,p=f.documentElement,m=!o(f),w!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.scope=ue((function(e){return p.appendChild(e).appendChild(f.createElement("div")),"undefined"!==typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ue((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(i.filter["ID"]=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find["ID"]=function(e,t){if("undefined"!==typeof t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter["ID"]=function(e){var t=e.replace(te,ne);return function(e){var n="undefined"!==typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find["ID"]=function(e,t){if("undefined"!==typeof t.getElementById&&m){var n,i,r,o=t.getElementById(e);if(o){if(n=o.getAttributeNode("id"),n&&n.value===e)return[o];r=t.getElementsByName(e),i=0;while(o=r[i++])if(n=o.getAttributeNode("id"),n&&n.value===e)return[o]}return[]}}),i.find["TAG"]=n.getElementsByTagName?function(e,t){return"undefined"!==typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[r++])1===n.nodeType&&i.push(n);return i}return o},i.find["CLASS"]=n.getElementsByClassName&&function(e,t){if("undefined"!==typeof t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(n.qsa=J.test(f.querySelectorAll))&&(ue((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+I+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+I+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),t=f.createElement("input"),t.setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+I+"*name"+I+"*="+I+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+I+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=J.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",R)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(p.compareDocumentPosition),b=t||J.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return h=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?N(u,e)-N(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!r||!o)return e==f?-1:t==f?1:r?-1:o?1:u?N(u,e)-N(u,t):0;if(r===o)return de(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[i]===s[i])i++;return i?de(a[i],s[i]):a[i]==w?-1:s[i]==w?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!E[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(Ee){E(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var r=i.attrHandle[t.toLowerCase()],o=r&&D.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(ie,re)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,i=[],r=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(T),h){while(t=e[o++])t===e[o]&&(r=i.push(o));while(r--)e.splice(i[r],1)}return u=null,e},r=se.getText=function(e){var t,n="",i=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[i++])n+=r(t);return n},i=se.selectors={cacheLength:50,createPseudo:ce,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y["CHILD"].test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&C(e,(function(e){return t.test("string"===typeof e.className&&e.className||"undefined"!==typeof e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=se.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,d,f,p,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(v){if(o){while(m){d=t;while(d=d[m])if(s?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?v.firstChild:v.lastChild],a&&y){d=v,h=d[x]||(d[x]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),c=u[e]||[],f=c[0]===_&&c[1],b=f&&c[2],d=f&&v.childNodes[f];while(d=++f&&d&&d[m]||(b=f=0)||p.pop())if(1===d.nodeType&&++b&&d===t){u[e]=[_,f,b];break}}else if(y&&(d=t,h=d[x]||(d[x]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),c=u[e]||[],f=c[0]===_&&c[1],b=f),!1===b)while(d=++f&&d&&d[m]||(b=f=0)||p.pop())if((s?d.nodeName.toLowerCase()===g:1===d.nodeType)&&++b&&(y&&(h=d[x]||(d[x]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),u[e]=[_,b]),d===t))break;return b-=r,b===i||b%i===0&&b/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=N(e,o[a]),e[i]=!(n[i]=o[a])})):function(e){return r(e,0,n)}):r}},pseudos:{not:ce((function(e){var t=[],n=[],i=s(e.replace(V,"$1"));return i[x]?ce((function(e,t,n,r){var o,a=i(e,null,r,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return se(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}})),lang:ce((function(e){return G.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos["empty"](e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve((function(){return[0]})),last:ve((function(e,t){return[t-1]})),eq:ve((function(e,t,n){return[n<0?n+t:n]})),even:ve((function(e,t){for(var n=0;nt?t:n;--i>=0;)e.push(i);return e})),gt:ve((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){var r=e.length;while(r--)if(!e[r](t,n,i))return!1;return!0}:e[0]}function _e(e,t,n){for(var i=0,r=t.length;i-1&&(o[c]=!(a[c]=h))}}else g=ke(g===a?g.splice(p,g.length):g),r?r(null,a,g,l):M.apply(a,g)}))}function Se(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],l=a?1:0,u=xe((function(e){return e===t}),s,!0),h=xe((function(e){return N(t,e)>-1}),s,!0),d=[function(e,n,i){var r=!a&&(i||n!==c)||((t=n).nodeType?u(e,n,i):h(e,n,i));return t=null,r}];l1&&we(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(V,"$1"),n,l0,r=e.length>0,o=function(o,a,s,l,u){var h,p,v,g=0,y="0",b=o&&[],x=[],w=c,k=o||r&&i.find["TAG"]("*",u),C=_+=null==w?1:Math.random()||.1,S=k.length;for(u&&(c=a==f||a||u);y!==S&&null!=(h=k[y]);y++){if(r&&h){p=0,a||h.ownerDocument==f||(d(h),s=!m);while(v=e[p++])if(v(h,a||f,s)){l.push(h);break}u&&(_=C)}n&&((h=!v&&h)&&g--,o&&b.push(h))}if(g+=y,n&&y!==g){p=0;while(v=t[p++])v(b,x,a,s);if(o){if(g>0)while(y--)b[y]||x[y]||(x[y]=j.call(l));x=ke(x)}M.apply(l,x),u&&!o&&x.length>0&&g+t.length>1&&se.uniqueSort(l)}return u&&(_=C,c=w),b};return n?ce(o):o}return ye.prototype=i.filters=i.pseudos,i.setFilters=new ye,a=se.tokenize=function(e,t){var n,r,o,a,s,l,c,u=S[e+" "];if(u)return t?0:u.slice(0);s=e,l=[],c=i.preFilter;while(s){for(a in n&&!(r=H.exec(s))||(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),n=!1,(r=q.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(V," ")}),s=s.slice(n.length)),i.filter)!(r=Y[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):S(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],r=[],o=O[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)o=Se(t[n]),o[x]?i.push(o):r.push(o);o=O(e,Oe(r,i)),o.selector=e}return o},l=se.select=function(e,t,n,r){var o,l,c,u,h,d="function"===typeof e&&e,f=!r&&a(e=d.selector||e);if(n=n||[],1===f.length){if(l=f[0]=f[0].slice(0),l.length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&i.relative[l[1].type]){if(t=(i.find["ID"](c.matches[0].replace(te,ne),t)||[])[0],!t)return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}o=Y["needsContext"].test(e)?0:l.length;while(o--){if(c=l[o],i.relative[u=c.type])break;if((h=i.find[u])&&(r=h(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ge(t.parentNode)||t))){if(l.splice(o,1),e=r.length&&be(l),!e)return M.apply(n,r),n;break}}}return(d||s(e,f))(r,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=x.split("").sort(T).join("")===x,n.detectDuplicates=!!h,d(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||he("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ue((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||he("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ue((function(e){return null==e.getAttribute("disabled")}))||he(P,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),se}(n);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var T=function(e,t,n){var i=[],r=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(r&&S(e).is(n))break;i.push(e)}return i},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=S.expr.match.needsContext;function j(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var $=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function M(e,t,n){return y(t)?S.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!==typeof t?S.grep(e,(function(e){return h.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?S.find.matchesSelector(i,e)?[i]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!==typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(M(this,e||[],!1))},not:function(e){return this.pushStack(M(this,e||[],!0))},is:function(e){return!!M(this,"string"===typeof e&&A.test(e)?S(e):e||[],!1).length}});var L,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,P=S.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||L,"string"===typeof e){if(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:x,!0)),$.test(i[1])&&S.isPlainObject(t))for(i in t)y(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return r=x.getElementById(i[2]),r&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)};P.prototype=S.fn,L=S(x);var I=/^(?:parents|prev(?:Until|All))/,F={children:!0,contents:!0,next:!0,prev:!0};function B(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"===typeof e?h.call(S(e),this[0]):h.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return B(e,"nextSibling")},prev:function(e){return B(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(j(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,i){var r=S.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"===typeof i&&(r=S.filter(i,r)),this.length>1&&(F[e]||S.uniqueSort(r),I.test(e)&&r.reverse()),this.pushStack(r)}}));var R=/[^\x20\t\r\n\f]+/g;function z(e){var t={};return S.each(e.match(R)||[],(function(e,n){t[n]=!0})),t}function V(e){return e}function H(e){throw e}function q(e,t,n,i){var r;try{e&&y(r=e.promise)?r.call(e).done(t).fail(n):e&&y(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"===typeof e?z(e):S.extend({},e);var t,n,i,r,o=[],a=[],s=-1,l=function(){for(r=r||e.once,i=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=a=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(n){S.each(t,(function(t,i){var r=y(e[i[4]])&&e[i[4]];o[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(e,i,r){var o=0;function a(e,t,i,r){return function(){var s=this,l=arguments,c=function(){var n,c;if(!(e=o&&(i!==H&&(s=void 0,l=[n]),t.rejectWith(s,l))}};e?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),n.setTimeout(u))}}return S.Deferred((function(n){t[0][3].add(a(0,n,y(r)?r:V,n.notifyWith)),t[1][3].add(a(0,n,y(e)?e:V)),t[2][3].add(a(0,n,y(i)?i:H))})).promise()},promise:function(e){return null!=e?S.extend(e,r):r}},o={};return S.each(t,(function(e,n){var a=n[2],s=n[5];r[n[1]]=a.add,s&&a.add((function(){i=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),r.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),r=l.call(arguments),o=S.Deferred(),a=function(e){return function(n){i[e]=this,r[e]=arguments.length>1?l.call(arguments):n,--t||o.resolveWith(i,r)}};if(t<=1&&(q(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();while(n--)q(r[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&W.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){n.setTimeout((function(){throw e}))};var U=S.Deferred();function G(){x.removeEventListener("DOMContentLoaded",G),n.removeEventListener("load",G),S.ready()}S.fn.ready=function(e){return U.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||U.resolveWith(x,[S]))}}),S.ready.then=U.then,"complete"===x.readyState||"loading"!==x.readyState&&!x.documentElement.doScroll?n.setTimeout(S.ready):(x.addEventListener("DOMContentLoaded",G),n.addEventListener("load",G));var Y=function(e,t,n,i,r,o,a){var s=0,l=e.length,c=null==n;if("object"===k(n))for(s in r=!0,n)Y(e,t,s,n[s],!0,o,a);else if(void 0!==i&&(r=!0,y(i)||(a=!0),c&&(a?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(S(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){ne.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=te.get(e,t),n&&(!i||Array.isArray(n)?i=te.access(e,t,S.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),i=n.length,r=n.shift(),o=S._queueHooks(e,t),a=function(){S.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,a,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return te.get(e,n)||te.access(e,n,{empty:S.Callbacks("once memory").add((function(){te.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!==typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,xe=/^$|^module$|\/(?:java|ecma)script/i;(function(){var e=x.createDocumentFragment(),t=e.appendChild(x.createElement("div")),n=x.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),g.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",g.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,t.innerHTML="",g.option=!!t.lastChild})();var we={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function _e(e,t){var n;return n="undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!==typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&j(e,t)?S.merge([e],n):n}function ke(e,t){for(var n=0,i=e.length;n",""]);var Ce=/<|&#?\w+;/;function Se(e,t,n,i,r){for(var o,a,s,l,c,u,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f-1)r&&r.push(o);else if(c=he(o),a=_e(h.appendChild(o),"script"),c&&ke(a),n){u=0;while(o=a[u++])xe.test(o.type||"")&&n.push(o)}return h}var Oe=/^key/,Ee=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function De(){return!0}function Ae(){return!1}function je(e,t){return e===$e()===("focus"===t)}function $e(){try{return x.activeElement}catch(e){}}function Me(e,t,n,i,r,o){var a,s;if("object"===typeof t){for(s in"string"!==typeof n&&(i=i||n,n=void 0),t)Me(e,s,n,i,t[s],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"===typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Ae;else if(!r)return e;return 1===o&&(a=r,r=function(e){return S().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,r,i,n)}))}function Le(e,t,n){n?(te.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var i,r,o=te.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),te.set(this,t,o),i=n(this,t),this[t](),r=te.get(this,t),o!==r||i?te.set(this,t,!1):r={},o!==r)return e.stopImmediatePropagation(),e.preventDefault(),r.value}else o.length&&(te.set(this,t,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===te.get(e,t)&&S.event.add(e,t,De)}S.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,c,u,h,d,f,p,m,v=te.get(e);if(Q(e)){n.handler&&(o=n,n=o.handler,r=o.selector),r&&S.find.matchesSelector(ue,r),n.guid||(n.guid=S.guid++),(l=v.events)||(l=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return"undefined"!==typeof S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(R)||[""],c=t.length;while(c--)s=Te.exec(t[c])||[],f=m=s[1],p=(s[2]||"").split(".").sort(),f&&(h=S.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=S.event.special[f]||{},u=S.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||(d=l[f]=[],d.delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,a)||e.addEventListener&&e.addEventListener(f,a)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),S.event.global[f]=!0)}},remove:function(e,t,n,i,r){var o,a,s,l,c,u,h,d,f,p,m,v=te.hasData(e)&&te.get(e);if(v&&(l=v.events)){t=(t||"").match(R)||[""],c=t.length;while(c--)if(s=Te.exec(t[c])||[],f=m=s[1],p=(s[2]||"").split(".").sort(),f){h=S.event.special[f]||{},f=(i?h.delegateType:h.bindType)||f,d=l[f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;while(o--)u=d[o],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(e,u));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,v.handle)||S.removeEvent(e,f,v.handle),delete l[f])}else for(f in l)S.event.remove(e,f+t[c],n,i,!0);S.isEmptyObject(l)&&te.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,a,s=new Array(arguments.length),l=S.event.fix(e),c=(te.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:S.find(r,this,null,[c]).length),a[r]&&o.push(i);o.length&&s.push({elem:c,handlers:o})}return c=this,l\s*$/g;function Fe(e,t){return j(e,"table")&&j(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Be(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ze(e,t){var n,i,r,o,a,s,l;if(1===t.nodeType){if(te.hasData(e)&&(o=te.get(e),l=o.events,l))for(r in te.remove(t,"handle events"),l)for(n=0,i=l[r].length;n1&&"string"===typeof p&&!g.checkClone&&Pe.test(p))return e.each((function(r){var o=e.eq(r);m&&(t[0]=p.call(this,r,o.html())),He(o,t,n,i)}));if(d&&(r=Se(t,e[0].ownerDocument,!1,e,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=S.map(_e(r,"script"),Be),s=a.length;h0&&ke(a,!l&&_e(e,"script")),s},cleanData:function(e){for(var t,n,i,r=S.event.special,o=0;void 0!==(n=e[o]);o++)if(Q(n)){if(t=n[te.expando]){if(t.events)for(i in t.events)r[i]?S.event.remove(n,i):S.removeEvent(n,i,t.handle);n[te.expando]=void 0}n[ne.expando]&&(n[ne.expando]=void 0)}}}),S.fn.extend({detach:function(e){return qe(this,e,!0)},remove:function(e){return qe(this,e)},text:function(e){return Y(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return He(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.appendChild(e)}}))},prepend:function(){return He(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(_e(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return Y(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"===typeof e&&!Ne.test(e)&&!we[(be.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n3,ue.removeChild(e)),s}}))})();var Ze=["Webkit","Moz","ms"],Je=x.createElement("div").style,Qe={};function et(e){var t=e[0].toUpperCase()+e.slice(1),n=Ze.length;while(n--)if(e=Ze[n]+t,e in Je)return e}function tt(e){var t=S.cssProps[e]||Qe[e];return t||(e in Je?e:Qe[e]=et(e)||e)}var nt=/^(none|table(?!-c[ea]).+)/,it=/^--/,rt={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function at(e,t,n){var i=le.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function st(e,t,n,i,r,o){var a="width"===t?1:0,s=0,l=0;if(n===(i?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=S.css(e,n+ce[a],!0,r)),i?("content"===n&&(l-=S.css(e,"padding"+ce[a],!0,r)),"margin"!==n&&(l-=S.css(e,"border"+ce[a]+"Width",!0,r))):(l+=S.css(e,"padding"+ce[a],!0,r),"padding"!==n?l+=S.css(e,"border"+ce[a]+"Width",!0,r):s+=S.css(e,"border"+ce[a]+"Width",!0,r));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function lt(e,t,n){var i=Ue(e),r=!g.boxSizingReliable()||n,o=r&&"border-box"===S.css(e,"boxSizing",!1,i),a=o,s=Ke(e,t,i),l="offset"+t[0].toUpperCase()+t.slice(1);if(We.test(s)){if(!n)return s;s="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&j(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===S.css(e,"display",!1,i))&&e.getClientRects().length&&(o="border-box"===S.css(e,"boxSizing",!1,i),a=l in e,a&&(s=e[l])),s=parseFloat(s)||0,s+st(e,t,n||(o?"border":"content"),a,i,s)+"px"}function ct(e,t,n,i,r){return new ct.prototype.init(e,t,n,i,r)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ke(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,a,s=J(t),l=it.test(t),c=e.style;if(l||(t=tt(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(r=a.get(e,!1,i))?r:c[t];o=typeof n,"string"===o&&(r=le.exec(n))&&r[1]&&(n=pe(e,t,r),o="number"),null!=n&&n===n&&("number"!==o||l||(n+=r&&r[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var r,o,a,s=J(t),l=it.test(t);return l||(t=tt(s)),a=S.cssHooks[t]||S.cssHooks[s],a&&"get"in a&&(r=a.get(e,!0,n)),void 0===r&&(r=Ke(e,t,i)),"normal"===r&&t in ot&&(r=ot[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,i){if(n)return!nt.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?lt(e,t,i):Ge(e,rt,(function(){return lt(e,t,i)}))},set:function(e,n,i){var r,o=Ue(e),a=!g.scrollboxSize()&&"absolute"===o.position,s=a||i,l=s&&"border-box"===S.css(e,"boxSizing",!1,o),c=i?st(e,t,i,l,o):0;return l&&a&&(c-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-st(e,t,"border",!1,o)-.5)),c&&(r=le.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),at(e,n,c)}}})),S.cssHooks.marginLeft=Xe(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ke(e,"marginLeft"))||e.getBoundingClientRect().left-Ge(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"===typeof n?n.split(" "):[n];i<4;i++)r[e+ce[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(S.cssHooks[e+t].set=at)})),S.fn.extend({css:function(e,t){return Y(this,(function(e,t,n){var i,r,o={},a=0;if(Array.isArray(t)){for(i=Ue(e),r=t.length;a1)}}),S.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,n=ct.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[tt(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=ct.prototype.init,S.fx.step={};var ut,ht,dt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function pt(){ht&&(!1===x.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(pt):n.setTimeout(pt,S.fx.interval),S.fx.tick())}function mt(){return n.setTimeout((function(){ut=void 0})),ut=Date.now()}function vt(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)n=ce[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function gt(e,t,n){for(var i,r=(xt.tweeners[t]||[]).concat(xt.tweeners["*"]),o=0,a=r.length;o1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"===typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(r=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=S.find.attr(e,t),null==i?void 0:i))},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&j(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(R);if(r&&1===e.nodeType)while(n=r[i++])e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=_t[t]||S.find.attr;_t[t]=function(e,t,i){var r,o,a=t.toLowerCase();return i||(o=_t[a],_t[a]=r,r=null!=n(e,t,i)?a:null,_t[a]=o),r}}));var kt=/^(?:input|select|textarea|button)$/i,Ct=/^(?:a|area)$/i;function St(e){var t=e.match(R)||[];return t.join(" ")}function Ot(e){return e.getAttribute&&e.getAttribute("class")||""}function Et(e){return Array.isArray(e)?e:"string"===typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return Y(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,r=S.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||Ct.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,i,r,o,a,s,l=0;if(y(e))return this.each((function(t){S(this).addClass(e.call(this,t,Ot(this)))}));if(t=Et(e),t.length)while(n=this[l++])if(r=Ot(n),i=1===n.nodeType&&" "+St(r)+" ",i){a=0;while(o=t[a++])i.indexOf(" "+o+" ")<0&&(i+=o+" ");s=St(i),r!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,i,r,o,a,s,l=0;if(y(e))return this.each((function(t){S(this).removeClass(e.call(this,t,Ot(this)))}));if(!arguments.length)return this.attr("class","");if(t=Et(e),t.length)while(n=this[l++])if(r=Ot(n),i=1===n.nodeType&&" "+St(r)+" ",i){a=0;while(o=t[a++])while(i.indexOf(" "+o+" ")>-1)i=i.replace(" "+o+" "," ");s=St(i),r!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,i="string"===n||Array.isArray(e);return"boolean"===typeof t&&i?t?this.addClass(e):this.removeClass(e):y(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,Ot(this),t),t)})):this.each((function(){var t,r,o,a;if(i){r=0,o=S(this),a=Et(e);while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||(t=Ot(this),t&&te.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":te.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;t=" "+e+" ";while(n=this[i++])if(1===n.nodeType&&(" "+St(Ot(n))+" ").indexOf(t)>-1)return!0;return!1}});var Tt=/\r/g;S.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=y(e),this.each((function(n){var r;1===this.nodeType&&(r=i?e.call(this,n,S(this).val()):e,null==r?r="":"number"===typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(e){return null==e?"":e+""}))),t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:(n=r.value,"string"===typeof n?n.replace(Tt,""):null==n?"":n)):void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:St(S.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:r.length;for(i=o<0?l:a?o:0;i-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},g.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in n;var Dt=/^(?:focusinfocus|focusoutblur)$/,At=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,i,r){var o,a,s,l,c,u,h,d,f=[i||x],m=p.call(e,"type")?e.type:e,v=p.call(e,"namespace")?e.namespace.split("."):[];if(a=d=s=i=i||x,3!==i.nodeType&&8!==i.nodeType&&!Dt.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,e=e[S.expando]?e:new S.Event(m,"object"===typeof e&&e),e.isTrigger=r?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:S.makeArray(t,[e]),h=S.event.special[m]||{},r||!h.trigger||!1!==h.trigger.apply(i,t))){if(!r&&!h.noBubble&&!b(i)){for(l=h.delegateType||m,Dt.test(l+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(i.ownerDocument||x)&&f.push(s.defaultView||s.parentWindow||n)}o=0;while((a=f[o++])&&!e.isPropagationStopped())d=a,e.type=o>1?l:h.bindType||m,u=(te.get(a,"events")||Object.create(null))[e.type]&&te.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&Q(a)&&(e.result=u.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,r||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(f.pop(),t)||!Q(i)||c&&y(i[m])&&!b(i)&&(s=i[c],s&&(i[c]=null),S.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,At),i[m](),e.isPropagationStopped()&&d.removeEventListener(m,At),S.event.triggered=void 0,s&&(i[c]=s)),e.result}},simulate:function(e,t,n){var i=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(i,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,r=te.access(i,t);r||i.addEventListener(e,n,!0),te.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=te.access(i,t)-1;r?te.access(i,t,r):(i.removeEventListener(e,n,!0),te.remove(i,t))}}}));var jt=n.location,$t={guid:Date.now()},Mt=/\?/;S.parseXML=function(e){var t;if(!e||"string"!==typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(i){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var Lt=/\[\]$/,Nt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;function Ft(e,t,n,i){var r;if(Array.isArray(t))S.each(t,(function(t,r){n||Lt.test(e)?i(e,r):Ft(e+"["+("object"===typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==k(t))i(e,t);else for(r in t)Ft(e+"["+r+"]",t[r],n,i)}S.param=function(e,t){var n,i=[],r=function(e,t){var n=y(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){r(this.name,this.value)}));else for(n in e)Ft(n,e[n],t,r);return i.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&It.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!ye.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}});var Bt=/%20/g,Rt=/#.*$/,zt=/([?&])_=[^&]*/,Vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qt=/^(?:GET|HEAD)$/,Wt=/^\/\//,Ut={},Gt={},Yt="*/".concat("*"),Kt=x.createElement("a");function Xt(e){return function(t,n){"string"!==typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(R)||[];if(y(n))while(i=o[r++])"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Zt(e,t,n,i){var r={},o=e===Gt;function a(s){var l;return r[s]=!0,S.each(e[s]||[],(function(e,s){var c=s(t,n,i);return"string"!==typeof c||o||r[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),a(c),!1)})),l}return a(t.dataTypes[0])||!r["*"]&&a("*")}function Jt(e,t){var n,i,r=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&S.extend(!0,e,i),e}function Qt(e,t,n){var i,r,o,a,s=e.contents,l=e.dataTypes;while("*"===l[0])l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}function en(e,t,n,i){var r,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];o=u.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift(),o)if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=c[l+" "+o]||c["* "+o],!a)for(r in c)if(s=r.split(" "),s[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]],a)){!0===a?a=c[r]:!0!==c[r]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(h){return{state:"parsererror",error:a?h:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}Kt.href=jt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jt.href,type:"GET",isLocal:Ht.test(jt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Yt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Jt(Jt(e,S.ajaxSettings),t):Jt(S.ajaxSettings,e)},ajaxPrefilter:Xt(Ut),ajaxTransport:Xt(Gt),ajax:function(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};var i,r,o,a,s,l,c,u,h,d,f=S.ajaxSetup({},t),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?S(p):S.event,v=S.Deferred(),g=S.Callbacks("once memory"),y=f.statusCode||{},b={},w={},_="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a){a={};while(t=Vt.exec(o))a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||_;return i&&i.abort(t),C(0,t),this}};if(v.promise(k),f.url=((e||f.url||jt.href)+"").replace(Wt,jt.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){l=x.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Kt.protocol+"//"+Kt.host!==l.protocol+"//"+l.host}catch(O){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!==typeof f.data&&(f.data=S.param(f.data,f.traditional)),Zt(Ut,f,t,k),c)return k;for(h in u=S.event&&f.global,u&&0===S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!qt.test(f.type),r=f.url.replace(Rt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Bt,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"===typeof f.data)&&(r+=(Mt.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(zt,"$1"),d=(Mt.test(r)?"&":"?")+"_="+$t.guid+++d),f.url=r+d),f.ifModified&&(S.lastModified[r]&&k.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&k.setRequestHeader("If-None-Match",S.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Yt+"; q=0.01":""):f.accepts["*"]),f.headers)k.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,k,f)||c))return k.abort();if(_="abort",g.add(f.complete),k.done(f.success),k.fail(f.error),i=Zt(Gt,f,t,k),i){if(k.readyState=1,u&&m.trigger("ajaxSend",[k,f]),c)return k;f.async&&f.timeout>0&&(s=n.setTimeout((function(){k.abort("timeout")}),f.timeout));try{c=!1,i.send(b,C)}catch(O){if(c)throw O;C(-1,O)}}else C(-1,"No Transport");function C(e,t,a,l){var h,d,b,x,w,_=t;c||(c=!0,s&&n.clearTimeout(s),i=void 0,o=l||"",k.readyState=e>0?4:0,h=e>=200&&e<300||304===e,a&&(x=Qt(f,k,a)),!h&&S.inArray("script",f.dataTypes)>-1&&(f.converters["text script"]=function(){}),x=en(f,x,k,h),h?(f.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(S.lastModified[r]=w),w=k.getResponseHeader("etag"),w&&(S.etag[r]=w)),204===e||"HEAD"===f.type?_="nocontent":304===e?_="notmodified":(_=x.state,d=x.data,b=x.error,h=!b)):(b=_,!e&&_||(_="error",e<0&&(e=0))),k.status=e,k.statusText=(t||_)+"",h?v.resolveWith(p,[d,_,k]):v.rejectWith(p,[k,_,b]),k.statusCode(y),y=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[k,f,h?d:b]),g.fireWith(p,[k,_]),u&&(m.trigger("ajaxComplete",[k,f]),--S.active||S.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,n,i,r){return y(n)&&(r=r||i,i=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:r,data:n,success:i},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var tn={0:200,1223:204},nn=S.ajaxSettings.xhr();g.cors=!!nn&&"withCredentials"in nn,g.ajax=nn=!!nn,S.ajaxTransport((function(e){var t,i;if(g.cors||nn&&!e.crossDomain)return{send:function(r,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);t=function(e){return function(){t&&(t=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!==typeof s.status?o(0,"error"):o(s.status,s.statusText):o(tn[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!==typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),i=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){t&&i()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(l){if(t)throw l}},abort:function(){t&&t()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=S("