!function(){var e={819:function(){StackExchange=window.StackExchange=window.StackExchange||{},StackOverflow=window.StackOverflow=window.StackOverflow||{},StackExchange.imageUploader=function(){var e=window.URL||window.webkitURL,t={},n={uploadUrl:"/upload/image",showLowRepWarning:!1};return{createImageUploadBackground:function(){var e=window.document,t=(window.navigator,e.createElement("div")),n=t.style;t.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",n.opacity="0.5";var a=function(){var e,t,n,a,i=window.document,r=window.self;return r.innerHeight&&r.scrollMaxY?(e=i.body.scrollWidth,t=r.innerHeight+r.scrollMaxY):i.body.scrollHeight>i.body.offsetHeight?(e=i.body.scrollWidth,t=i.body.scrollHeight):(e=i.body.offsetWidth,t=i.body.offsetHeight),r.innerHeight?(n=r.innerWidth,a=r.innerHeight):i.documentElement&&i.documentElement.clientHeight?(n=i.documentElement.clientWidth,a=i.documentElement.clientHeight):i.body&&(n=i.body.clientWidth,a=i.body.clientHeight),[Math.max(e,n),Math.max(t,a),n,a]}();return n.height=a[1]+"px",n.left="0",n.width="100%",e.body.appendChild(t),t},removeImageUploadBackground:function(){$(".wmd-prompt-background").remove()},enableLowRepWarning:function(){n.showLowRepWarning=!0},uploadImageDialog:function(a,i){"string"===$.type(i)&&(i={uploadUrl:i}),i=$.extend(n,i);var r,o="upload-iframe-"+(new Date).getTime(),s="/render/image-upload?uploadUrl={0}&showLowRepWarning={2}".formatUnicorn(encodeURIComponent(i.uploadUrl),i.showLowRepWarning?"true":"false"),l=$('
').addClass("async-load").data("load-url",s),c=0,d=function(e){l&&l.fadeOutAndRemove(),$("body").off("keydown",h.checkEscape).off("paste",h.paste),void 0!==e&&a(e)},u=function(e){return 0===e.type.indexOf("image/")},p=function(e,t){var n=l.find("."+e);n.find(".tab-page").hide(),n.find("."+e+"-"+t).show(),n.data("active-tab",t)},f=function(){window.closeDialog=d,window.displayUploadError=g.uploadError},g={resetInputs:function(){l.find(".js-modal-input-file, .js-modal-input-url").prop("disabled",!1).attr("value","")},uploadError:function(e){g.resetInputs(),l.find(".modal-options-error .modal-options-error-message").text(e),p("modal-options","error")},ajaxResult:function(e){$("#"+o).contents().find("html").html(e)},ajaxError:function(e,t,n){g.uploadError((function(n){return"Request returned an error: ["+n.status+"] "+n.error})({status:t,error:n}))}},h={showLink:function(e){e&&e.preventDefault(),p("modal-options","url"),l.find(".js-modal-input-url").focus()},resetView:function(e){e&&e.preventDefault(),p("modal-dropzone","default"),p("modal-options","default"),l.find(".js-modal-cta-submit").prop("disabled",!0),l.find(".modal-dropzone-preview").empty(),l.find(".js-modal-input-file").val(""),g.resetInputs(),c=0,r.removeClass("hover"),l.find("form").off("submit").on("submit",h.oldSchoolSubmit),l.find("form input[name=fkey]").val(StackExchange.options.user.fkey)},inputFileOrUrl:function(){var e=!!l.find(".js-user-input").filter((function(){return this.value.length})).length;l.find(".js-modal-cta-submit").prop("disabled",!e)},disablePasteHandling:function(){$("body").off("paste",h.previewImage)},enablePasteHandling:function(){$("body").on("paste",{property:"clipboardData"},h.previewImage)},selectFile:function(e){e.preventDefault(),l.find(".js-modal-input-file").click()},clickFile:function(e){e.stopPropagation()},previewImage:function(t){var n,a,i;t.preventDefault();var r,o,s=(r=t.originalEvent[t.data.property]).items&&(o=$.grep(r.items,u)).length>0?o[0].getAsFile():r.files&&(o=$.grep(r.files,u)).length>0?o[0]:void 0;s&&(n=s.size>=2097152,(a=l.find(".modal-dropzone-preview")).empty(),i=e.createObjectURL(s),$("").attr("src",i).css({maxWidth:a.css("width"),maxHeight:a.css("height")}).on("load",{url:i},h.loadPreviewImage).appendTo(a),l.find("form").off("submit").on("submit",s,h.ajaxSubmit),l.find(".js-modal-cta-submit").prop("disabled",n),p("modal-dropzone","preview"),p("modal-options",n?"toobig":"preview"))},dragEnter:function(e){e.preventDefault(),c++,r.addClass("hover")},dragLeave:function(){0==--c&&r.removeClass("hover")},clickClose:function(e){e.preventDefault(),d(null)},loadPreviewImage:function(t){e.revokeObjectURL(t.data.url)},oldSchoolSubmit:function(e){var t,n="url"===(t="modal-options",l.find("."+t).data("active-tab"));p("modal-options","uploading"),l.find(".js-modal-input-file").prop("disabled",n),l.find(".js-modal-input-url").prop("disabled",!n),e.target.target=o,f()},ajaxSubmit:function(e){e.preventDefault(),p("modal-options","uploading");var t=new window.FormData;t.append("file",e.data),t.append("fkey",StackExchange.options.user.fkey),f(),$.ajax({url:i.uploadUrl,data:t,cache:!1,contentType:!1,processData:!1,type:"POST",success:g.ajaxResult,error:g.ajaxError})},checkEscape:function(e){27===e.which&&(e.preventDefault(),d(null))}},m=function(e){$('').attr("id",o).attr("name",o).appendTo(e)};return l.appendTo("body").center().fadeIn("fast").promise().done((function(){l.asyncLoad({callback:function(){m(l),function(){l.css("height","auto"),l.find(".modal-options-uploading p").addSpinner(),l.find(".modal-options-default a").click(h.showLink),l.find(".modal-options-cancel").click(h.resetView),l.find(".js-modal-input-file").on("click",h.clickFile).on("change",h.inputFileOrUrl);var e=l.find(".js-modal-input-url").on("input keydown",h.inputFileOrUrl);l.find(".modal-dropzone-default").click(h.selectFile),l.find(".js-modal-input-file").change({property:"target"},h.previewImage),l.find(".js-modal-input-url").focus(h.disablePasteHandling).blur(h.enablePasteHandling),h.enablePasteHandling(),r=l.find(".modal-dropzone-default").on("dragenter",h.dragEnter).on("dragleave",h.dragLeave).on("dragover",!1).on("drop",{property:"dataTransfer"},h.previewImage),l.find(".js-modal-close").click(h.clickClose),h.resetView(),l.focus(),i.imageUrl&&(h.showLink(),e.val(i.imageUrl),h.inputFileOrUrl())}()},cache:t})})),l.on("popupClose",h.disablePasteHandling),$("body").on("keydown",h.checkEscape),!0}}}()},4466:function(){StackExchange=window.StackExchange=window.StackExchange||{},StackOverflow=window.StackOverflow=window.StackOverflow||{};var e=window.Commonmark=window.Commonmark||{};!function(){function t(e){return e}function n(e){return!1}function a(){}a.prototype={chain:function(e,n){var a=this[e];if(!a)throw new Error("unknown hook "+e);this[e]=a===t?n:function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=a.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(e){this[e]=t},addFalse:function(e){this[e]=n}},e.HookCollection=a,e.Converter=function(t){t=t||{},e.markdownit=null;var n=this.hooks=new a;n.addNoop("plainLinkText"),n.addNoop("preConversion"),n.addNoop("postNormalization"),n.addNoop("preBlockGamut"),n.addNoop("postBlockGamut"),n.addNoop("preSpanGamut"),n.addNoop("postSpanGamut"),n.addNoop("postConversion"),this.makeHtmlAsync=function(t){var n=$.Deferred();if(!t)return n.resolve(t),n.promise();if(null===e.markdownit){var a=this.makeHtml;return this.loadMarkdownRendererAsync().then((function(){return a(t)}))}return n.resolve(this.makeHtml(t)),n.promise()},this.loadMarkdownRendererAsync=function(){var n=$.Deferred();return null===e.markdownit&&StackExchange.using("markdownit",(function(){return e.markdownit=StackExchange.markdownit.init(t),n.resolve()})),n.promise()},this.makeHtml=function(t){if(null===e.markdownit)throw new Error("Markdown renderer is not initialized");return t=(t=function(e){if(!/\t/.test(e))return e;var t,n=[" "," "," "," "],a=0;return e.replace(/[\n\t]/g,(function(e,i){return"\n"===e?(a=i+1,e):(t=(i-a)%4,a=i+1,n[t])}))}(t=n.preConversion(t))).replace(/^[ \t]+$/gm,""),t=n.postNormalization(t),t=e.markdownit.render(t),t=t.replace(i,"\x3c!-- language: $1 --\x3e"),t=n.postConversion(t)}};var i=//gi}()},7152:function(){StackExchange=window.StackExchange=window.StackExchange||{},StackOverflow=window.StackOverflow=window.StackOverflow||{};var e=window.Markdown=window.Markdown||{};!function(){function t(e){return e}function n(e){return!1}function a(){}a.prototype={chain:function(e,n){var a=this[e];if(!a)throw new Error("unknown hook "+e);this[e]=a===t?n:function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=a.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(e){this[e]=t},addFalse:function(e){this[e]=n}},e.HookCollection=a}()},3259:function(){StackExchange=window.StackExchange=window.StackExchange||{},StackOverflow=window.StackOverflow=window.StackOverflow||{};var e=window.Markdown=window.Markdown||{};!function(){var t={},n={},a={},i=window.document,r=window.RegExp,o=window.navigator,s=72,l=/msie/.test(o.userAgent.toLowerCase()),c=/msie 6/.test(o.userAgent.toLowerCase())||/msie 5/.test(o.userAgent.toLowerCase()),d=/opera/.test(o.userAgent.toLowerCase()),u={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'Insert Hyperlink
http://example.com/ "optional title"
',quote:"Blockquote Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample Ctrl+K",codeexample:"enter code here",image:"Image Ctrl+G",imagedescription:"enter image description here",imagedialog:'Insert Image
http://example.com/images/diagram.jpg "optional title"
',olist:"Numbered List Ctrl+O",ulist:"Bulleted List Ctrl+U",litem:"List item",heading:"Heading / Ctrl+H",headingexample:"Heading",hr:"Horizontal Rule
Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help",ok:"OK",cancel:"Cancel"};function p(){}function f(e){this.buttonBar=i.getElementById("wmd-button-bar"+e),this.preview=i.getElementById("wmd-preview"+e),this.input=i.getElementById("wmd-input"+e)}function g(e,n){var a,i,r,o=this,s=[],c=0,d="none",u=function(e,t){d!=e&&(d=e,t||f()),l&&"moving"==d?r=null:i=setTimeout(p,1)},p=function(e){r=new h(n,e),i=void 0};this.setCommandMode=function(){d="command",f(),i=setTimeout(p,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return!!s[c+1]},this.undo=function(){o.canUndo()&&(a?(a.restore(),a=null):(s[c]=new h(n),s[--c].restore(),e&&e())),d="none",n.input.focus(),p()},this.redo=function(){o.canRedo()&&(s[++c].restore(),e&&e()),d="none",n.input.focus(),p()};var f=function(){var t=r||new h(n);if(!t)return!1;"moving"!=d?(a&&(s[c-1].text!=a.text&&(s[c++]=a),a=null),s[c++]=t,s[c+1]=null,e&&e()):a||(a=t)},g=function(e){var t=!1;if((e.ctrlKey||e.metaKey)&&!e.altKey){var n=e.charCode||e.keyCode;switch(String.fromCharCode(n).toLowerCase()){case"y":o.redo(),t=!0;break;case"z":e.shiftKey?o.redo():o.undo(),t=!0}}if(t)return e.preventDefault&&e.preventDefault(),void(window.event&&(window.event.returnValue=!1))},m=function(e){if(!e.ctrlKey&&!e.metaKey){var t=e.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?u("moving"):8==t||46==t||127==t?u("deleting"):13==t?u("newlines"):27==t?u("escape"):(t<16||t>20)&&91!=t&&u("typing")}};!function(){t.addEvent(n.input,"keypress",(function(e){!e.ctrlKey&&!e.metaKey||e.altKey||89!=e.keyCode&&90!=e.keyCode||e.preventDefault()}));var e=function(){(l||r&&r.text!=n.input.value)&&null==i&&(d="paste",f(),p())};t.addEvent(n.input,"keydown",g),t.addEvent(n.input,"keydown",m),t.addEvent(n.input,"mousedown",(function(){u("moving")})),n.input.onpaste=e,n.input.ondrop=e}(),p(!0),f()}function h(e,n){var a=this,r=e.input;this.init=function(){t.isVisible(r)&&(!n&&i.activeElement&&i.activeElement!==r||(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value)))},this.setInputAreaSelection=function(){if(t.isVisible(r))if(void 0===r.selectionStart||d){if(i.selection){if(i.activeElement&&i.activeElement!==r)return;r.focus();var e=r.createTextRange();e.moveStart("character",-r.value.length),e.moveEnd("character",-r.value.length),e.moveEnd("character",a.end),e.moveStart("character",a.start),e.select()}}else r.focus(),r.selectionStart=a.start,r.selectionEnd=a.end,r.scrollTop=a.scrollTop},this.setInputAreaSelectionStartEnd=function(){if(e.ieCachedRange||!r.selectionStart&&0!==r.selectionStart){if(i.selection){a.text=t.fixEolChars(r.value);var n=e.ieCachedRange||i.selection.createRange(),o=t.fixEolChars(n.text),s="",l=s+o+s;n.text=l;var c=t.fixEolChars(r.value);n.moveStart("character",-l.length),n.text=o,a.start=c.indexOf(s),a.end=c.lastIndexOf(s)-s.length;var d=a.text.length-t.fixEolChars(r.value).length;if(d){for(n.moveStart("character",-o.length);d--;)o+="\n",a.end+=1;n.text=o}e.ieCachedRange&&(a.scrollTop=e.ieCachedScrollTop),e.ieCachedRange=null,this.setInputAreaSelection()}}else a.start=r.selectionStart,a.end=r.selectionEnd},this.restore=function(){null!=a.text&&a.text!=r.value&&(r.value=a.text),this.setInputAreaSelection(),r.scrollTop=a.scrollTop},this.getChunks=function(){var e=new p;return e.before=t.fixEolChars(a.text.substring(0,a.start)),e.startTag="",e.selection=t.fixEolChars(a.text.substring(a.start,a.end)),e.endTag="",e.after=t.fixEolChars(a.text.substring(a.end)),e.scrollTop=a.scrollTop,e},this.setChunks=function(e){e.before=e.before+e.startTag,e.after=e.endTag+e.after,this.start=e.before.length,this.end=e.before.length+e.selection.length,this.text=e.before+e.selection+e.after,this.scrollTop=e.scrollTop},this.init()}function m(e,a,r){var o,s,c,d=function(){var e=0;return window.innerHeight?e=window.pageYOffset:i.documentElement&&i.documentElement.scrollTop?e=i.documentElement.scrollTop:i.body&&(e=i.body.scrollTop),e},u=function(){if(a.preview){var t=a.input.value;if(!t||t!=c){c=t;var n=(new Date).getTime();e.makeHtmlAsync(t).then((function(e){var t=(new Date).getTime();s=t-n,k(e)}))}}},p=function(){o&&(clearTimeout(o),o=void 0);var e=0;(e=s)>3e3&&(e=3e3),o=setTimeout(u,e)};this.refresh=function(e){e?(c="",u()):p()},this.processingTime=function(){return s};var f,g,h,m=!0,v=function(e){var t=a.preview,n=t.parentNode,i=t.nextSibling;n.removeChild(t),t.innerHTML=e,i?n.insertBefore(t,i):n.appendChild(t)},w=function(e){a.preview.innerHTML=e},k=function(e){var t,i=n.getTop(a.input)-d();if(a.preview&&(!function(e){if(f)return f(e);try{w(e),f=w}catch(t){(f=v)(e)}}(e),r()),a.preview&&(a.preview.scrollTop=(a.preview.scrollHeight-a.preview.clientHeight)*((t=a.preview).scrollHeight<=t.clientHeight?1:t.scrollTop/(t.scrollHeight-t.clientHeight))),m)m=!1;else{var o=n.getTop(a.input)-d();l?setTimeout((function(){window.scrollBy(0,o-i)}),0):window.scrollBy(0,o-i)}};g=a.input,h=p,t.addEvent(g,"input",h),g.onpaste=h,g.ondrop=h,t.addEvent(g,"keypress",h),t.addEvent(g,"keydown",h),u(),a.preview&&(a.preview.scrollTop=0)}function v(e,n,a,r,s,c,u){var p=n.input,f={};!function(){var t=n.buttonBar,a=document.createElement("ul");a.id="wmd-button-row"+e,a.className="wmd-button-row",a=t.appendChild(a);var i=function(t,n,i,r){var o=document.createElement("li");o.className="wmd-button";var s=document.createElement("span");return o.id=t+e,o.appendChild(s),o.title=n,o.XShift=i,r&&(o.textOp=r),w(o,!0),a.appendChild(o),o},r=function(t){var n=document.createElement("li");n.className="wmd-spacer wmd-spacer"+t,n.id="wmd-spacer"+t+e,a.appendChild(n)};f.bold=i("wmd-bold-button",u("bold"),"0px",k("doBold")),f.italic=i("wmd-italic-button",u("italic"),"-20px",k("doItalic")),r(1),f.link=i("wmd-link-button",u("link"),"-40px",k((function(e,t){return this.doLinkOrImage(e,t,!1)}))),f.quote=i("wmd-quote-button",u("quote"),"-60px",k("doBlockquote")),f.code=i("wmd-code-button",u("code"),"-80px",k("doCode")),f.image=i("wmd-image-button",u("image"),"-100px",k((function(e,t){return this.doLinkOrImage(e,t,!0)}))),r(2),f.olist=i("wmd-olist-button",u("olist"),"-120px",k((function(e,t){this.doList(e,t,!0)}))),f.ulist=i("wmd-ulist-button",u("ulist"),"-140px",k((function(e,t){this.doList(e,t,!1)}))),f.heading=i("wmd-heading-button",u("heading"),"-160px",k("doHeading")),f.hr=i("wmd-hr-button",u("hr"),"-180px",k("doHorizontalRule")),r(3),f.undo=i("wmd-undo-button",u("undo"),"-200px",null),f.undo.execute=function(e){e&&e.undo()};var s=/win/.test(o.platform.toLowerCase())?u("redo"):u("redomac");f.redo=i("wmd-redo-button",s,"-220px",null),f.redo.execute=function(e){e&&e.redo()};var l=document.createElement("li");if(l.className="wmd-spacer wmd-spacer-max",a.appendChild(l),c){var d=$("body").hasClass("js-ask-page-v2"),p=document.createElement("li"),g=document.createElement("span");p.appendChild(g),d?(p.className="s-btn s-btn__muted s-btn__sm as-center",p.innerText="Show formatting tips"):p.className="wmd-button wmd-help-button",p.id="wmd-help-button"+e,p.XShift="-240px",p.isHelp=!0,p.style.right="0px",p.title=u("help"),p.onclick=c.handler,d||w(p,!0),a.appendChild(p),f.help=p}b()}();var g="keydown";d&&(g="keypress"),t.addEvent(p,g,(function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){var t=e.charCode||e.keyCode;switch(String.fromCharCode(t).toLowerCase()){case"b":v(f.bold);break;case"i":v(f.italic);break;case"l":v(f.link);break;case"q":v(f.quote);break;case"k":v(f.code);break;case"g":v(f.image);break;case"o":v(f.olist);break;case"u":v(f.ulist);break;case"h":v(f.heading);break;case"r":v(f.hr);break;case"y":v(f.redo);break;case"z":e.shiftKey?v(f.redo):v(f.undo);break;default:return}e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1)}})),t.addEvent(p,"keyup",(function(e){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey&&13===(e.charCode||e.keyCode)){var t={};t.textOp=k("doAutoindent"),v(t)}})),l&&t.addEvent(p,"keydown",(function(e){if(27===e.keyCode)return!1}));var m={link:!0,image:!0};function v(e,t){if(p.focus(),e.id&&!t){var i=e.id.replace(/^wmd-(\w+)-.*$/,"$1");if(m[i]&&s.hooks.interceptButtonClick(e,i,(function(){v(e,!0)})))return}if(e.textOp){a&&a.setCommandMode();var o=new h(n);if(!o)return;var l=o.getChunks(),c=function(){p.focus(),l&&o.setChunks(l),o.restore(),r.refresh()};e.textOp(l,c)||c()}e.execute&&e.execute(a)}function w(e,t){var a=e.getElementsByTagName("span")[0];t?(a.style.backgroundPosition=e.XShift+" 0px",e.onmouseover=function(){a.style.backgroundPosition=this.XShift+" -40px"},e.onmouseout=function(){a.style.backgroundPosition=this.XShift+" 0px"},l&&(e.onmousedown=function(){i.activeElement&&i.activeElement!==n.input||(n.ieCachedRange=document.selection.createRange(),n.ieCachedScrollTop=n.input.scrollTop)}),e.isHelp||(e.onclick=function(){return this.onmouseout&&this.onmouseout(),v(this),!1})):(a.style.backgroundPosition=e.XShift+" -20px",e.onmouseover=e.onmouseout=e.onclick=function(){})}function k(e){return"string"==typeof e&&(e=s[e]),function(){e.apply(s,arguments)}}function b(){a&&(w(f.undo,a.canUndo()),w(f.redo,a.canRedo()))}this.setUndoRedoButtonStates=b}function w(e,t,n,a,i){this.hooks=e,this.getString=t,this.converter=n,this.wrapImageInLink=a,this.convertImagesToLinks=i}e.Editor=function(t,n,a){"function"==typeof(a=a||{}).handler&&(a={helpButton:a}),a.strings=a.strings||{},a.helpButton&&(a.strings.help=a.strings.help||a.helpButton.title);var r=function(e){return a.strings[e]||u[e]};n=n||"",this.getPostfix=function(){return n};var o=this.hooks=new e.HookCollection;o.addNoop("onPreviewRefresh"),o.addNoop("postBlockquoteCreation"),o.addFalse("insertImageDialog"),o.addNoop("imageConvertedToLink"),o.addFalse("insertLinkDialog"),o.addFalse("interceptButtonClick"),o.addFalse("skipModalBackground"),this.getConverter=function(){return t};var s,l=this;this.run=function(){if(!s){s=new f(n);var e,c,d=new w(o,r,t,a.wrapImageInLink,a.convertImagesToLinks),u=new m(t,s,(function(){o.onPreviewRefresh()}));/\?noundo/.test(i.location.href)||(e=new g((function(){u.refresh(),c&&c.setUndoRedoButtonStates()}),s),this.textOperation=function(t){e.setCommandMode(),t(),l.refreshPreview()}),(c=new v(n,s,e,u,d,a.helpButton,r)).setUndoRedoButtonStates(),(l.refreshPreview=function(){u.refresh(!0)})()}}},p.prototype.findTags=function(e,n){var a,i=this;e&&(a=t.extendRegExp(e,"","$"),this.before=this.before.replace(a,(function(e){return i.startTag=i.startTag+e,""})),a=t.extendRegExp(e,"^",""),this.selection=this.selection.replace(a,(function(e){return i.startTag=i.startTag+e,""}))),n&&(a=t.extendRegExp(n,"","$"),this.selection=this.selection.replace(a,(function(e){return i.endTag=e+i.endTag,""})),a=t.extendRegExp(n,"^",""),this.after=this.after.replace(a,(function(e){return i.endTag=e+i.endTag,""})))},p.prototype.trimWhitespace=function(e){var t,n,a=this;e?t=n="":(t=function(e){return a.before+=e,""},n=function(e){return a.after=e+a.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},p.prototype.skipLines=function(e,t,n){var a,i;if(void 0===e&&(e=1),void 0===t&&(t=1),e++,t++,navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+r.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+r.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+r.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+r.$1,this.before){for(a=i="";e--;)a+="\\n?",i+="\n";n&&(a="\\n*"),this.before=this.before.replace(new r(a+"$",""),i)}if(this.after){for(a=i="";t--;)a+="\\n?",i+="\n";n&&(a="\\n*"),this.after=this.after.replace(new r(a,""),i)}},t.isVisible=function(e){return window.getComputedStyle?"none"!==window.getComputedStyle(e,null).getPropertyValue("display"):e.currentStyle?"none"!==e.currentStyle.display:void 0},t.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},t.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},t.fixEolChars=function(e){return e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")},t.extendRegExp=function(e,t,n){null==t&&(t=""),null==n&&(n="");var a,i=e.toString();return i=(i=i.replace(/\/([gim]*)$/,(function(e,t){return a=t,""}))).replace(/(^\/|\/$)/g,""),new r(i=t+i+n,a)},n.getTop=function(e,t){var n=e.offsetTop;if(!t)for(;e=e.offsetParent;)n+=e.offsetTop;return n},n.getHeight=function(e){return e.offsetHeight||e.scrollHeight},n.getWidth=function(e){return e.offsetWidth||e.scrollWidth},n.getPageSize=function(){var e,t,n,a;return self.innerHeight&&self.scrollMaxY?(e=i.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):i.body.scrollHeight>i.body.offsetHeight?(e=i.body.scrollWidth,t=i.body.scrollHeight):(e=i.body.offsetWidth,t=i.body.offsetHeight),self.innerHeight?(n=self.innerWidth,a=self.innerHeight):i.documentElement&&i.documentElement.clientHeight?(n=i.documentElement.clientWidth,a=i.documentElement.clientHeight):i.body&&(n=i.body.clientWidth,a=i.body.clientHeight),[Math.max(e,n),Math.max(t,a),n,a]},a.createBackground=function(){var e=i.createElement("div"),t=e.style;e.className="wmd-prompt-background",t.position="absolute",t.top="0",t.zIndex="8950",l?t.filter="alpha(opacity=50)":t.opacity="0.5";var a=n.getPageSize();return t.height=a[1]+"px",l?(t.left=i.documentElement.scrollLeft,t.width=i.documentElement.clientWidth):(t.left="0",t.width="100%"),i.body.appendChild(e),e},a.prompt=function(e,a,r,o,s){var l,d;void 0===a&&(a="");var u=function(e){if(27===(e.charCode||e.keyCode))return e.stopPropagation&&e.stopPropagation(),p(!0),!1},p=function(e){t.removeEvent(i.body,"keyup",u);var n=d.value;return e?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),l.parentNode.removeChild(l),s(n),!1};setTimeout((function(){!function(r,o){(l=i.createElement("div")).className="wmd-prompt-dialog",l.style.padding="10px;",l.style.position="fixed",l.style.width="400px",l.style.zIndex="9000";var s=i.createElement("div");s.innerHTML=e,s.style.padding="5px",l.appendChild(s);var f=i.createElement("form"),g=f.style;f.onsubmit=function(){return p(!1)},g.padding="0",g.margin="0",g.cssFloat="left",g.width="100%",g.textAlign="center",g.position="relative",l.appendChild(f),(d=i.createElement("input")).type="text",d.className="s-input mb16",d.value=a,(g=d.style).display="block",g.width="80%",g.marginLeft=g.marginRight="auto",f.appendChild(d);var h=i.createElement("button");h.className="s-btn s-btn__primary",h.type="button",h.onclick=function(){return p(!1)},h.innerText="Insert";var m=i.createElement("button");m.type="button",m.onclick=function(){return p(!0)},m.className="s-btn ml8",m.innerText="Cancel",f.appendChild(h),f.appendChild(m),t.addEvent(i.body,"keyup",u),l.style.top="50%",l.style.left="50%",l.style.display="block",c&&(l.style.position="absolute",l.style.top=i.documentElement.scrollTop+200+"px",l.style.left="50%"),i.body.appendChild(l),l.style.marginTop=-n.getHeight(l)/2+"px",l.style.marginLeft=-n.getWidth(l)/2+"px"}();var r=a.length;if(void 0!==d.selectionStart)d.selectionStart=0,d.selectionEnd=r;else if(d.createTextRange){var o=d.createTextRange();o.collapse(!1),o.moveStart("character",-r),o.moveEnd("character",r),o.select()}d.focus()}),0)};var k=w.prototype;k.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",k.unwrap=function(e){var t=new r("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},k.wrap=function(e,t){this.unwrap(e);var n=new r("(.{1,"+t+"})( +|$\\n?)","gm"),a=this;e.selection=e.selection.replace(n,(function(e,t){return new r("^"+a.prefixes,"").test(e)?e:t+"\n"})),e.selection=e.selection.replace(/\s+$/,"")},k.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},k.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},k.doBorI=function(e,t,n,a){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var i=/(\**$)/.exec(e.before)[0],o=/(^\**)/.exec(e.after)[0],s=Math.min(i.length,o.length);if(s>=n&&(2!=s||1!=n))e.before=e.before.replace(r("[*]{"+n+"}$",""),""),e.after=e.after.replace(r("^[*]{"+n+"}",""),"");else if(!e.selection&&o){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var l=r.$1;e.before=e.before+o+l}else{e.selection||o||(e.selection=a);var c=n<=1?"*":"**";e.before=e.before+c,e.after=c+e.after}},k.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,(function(e,n,a,i,r){return t[n]=e.replace(/\s*$/,""),i?(t[n]=e.replace(/["(](.+?)[")]$/,""),i+r):""}))},k.addLinkDef=function(e,t){var n=0,a={};e.before=this.stripLinkDefs(e.before,a),e.selection=this.stripLinkDefs(e.selection,a),e.after=this.stripLinkDefs(e.after,a);for(var i="",r=/\[(\d+)\]/g,o=e.before+e.selection+e.after,s=this.converter.makeHtml(o),l="https://this-is-a-real-link.biz/";-1!=s.indexOf(l);)l+="nicetry/";var c="\n\n",d=o.replace(r,(function(e,t,n){return c+=" ["+n+"]: "+l+n+"/unicorn\n","["+n+"]"}));s=this.converter.makeHtml(d+c);var u,p={},f=function(e){var t=e.replace(/^[ ]{0,3}\[(\d+)\]:/,""),a="L_"+t;return a in p?p[a]:(n++,i+="\n"+(e=" ["+n+"]:"+t),p[a]=n,n)},g=0,h=function(e,t,n){return function(e){return-1!==s.indexOf(l+e+"/unicorn")}(g+n)&&a[t]?"["+f(a[t])+"]":e},m=e.before.length;return e.before=e.before.replace(r,h),g+=m,m=e.selection.length,t?u=f(t):e.selection=e.selection.replace(r,h),g+=m,e.after=e.after.replace(r,h),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+i,u},k.doLinkOrImage=function(e,t,n){var i;this.converter.loadMarkdownRendererAsync(),e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var r=this.wrapImageInLink,o=this.convertImagesToLinks;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var s=this,l=function(a){if(i&&i.parentNode&&i.parentNode.removeChild(i),null!==a){e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var l=" [999]: "+a.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,(function(e,t,n){var a=!1;return t=t.replace(/%(?:[\da-fA-F]{2})|\?|\+|[^\w\d-./[\]]/g,(function(e){if(3===e.length&&"%"==e.charAt(0))return e.toUpperCase();switch(e){case"?":return a=!0,"?";case"+":if(a)return"%20"}return encodeURI(e)})),n&&(n=(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,"")).replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?t+' "'+n+'"':t})),c=s.addLinkDef(e,l);(!n||r&&!o)&&(e.startTag="[",e.endTag="]["+c+"]"),n&&(e.startTag+=o?"[":"![",e.endTag="]["+c+"]"+e.endTag),e.selection||(e.selection=n?s.getString("imagedescription"):s.getString("linkdescription")),n&&o&&s.hooks.imageConvertedToLink()}t()};return this.hooks.skipModalBackground(n?"image":"link")||(i=a.createBackground()),n?this.hooks.insertImageDialog(l)||a.prompt(this.getString("imagedialog"),"http://",this.getString("ok"),this.getString("cancel"),l):this.hooks.insertLinkDialog(l)||a.prompt(this.getString("linkdialog"),"http://",this.getString("ok"),this.getString("cancel"),l),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},k.doAutoindent=function(e,t){var n=this,a=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,(function(t){return e.selection=t,""})),a=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),a&&(e.after=e.selection+e.after,e.selection="")},k.doBlockquote=function(e,t){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,(function(t,n,a,i){return e.before+=n,e.after=i+e.after,a})),e.before=e.before.replace(/(>[ \t]*)$/,(function(t,n){return e.selection=n+e.selection,""})),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,a="",i="";if(e.before){for(var r=e.before.replace(/\n$/,"").split("\n"),o=!1,l=0;l0,/^>/.test(n)?(c=!0,!o&&n.length>1&&(o=!0)):c=!!/^[ \t]*$/.test(n)||o,c?a+=n+"\n":(i+=a+n,a="\n")}/(^|\n)>/.test(a)||(i+=a,a="")}e.startTag=a,e.before=i,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,(function(t){return e.endTag=t,""}));var d=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,(function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,(function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,s-2),e.selection=e.selection.replace(/^/gm,"> "),d(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),d(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,(function(t,n){return e.startTag+=n,""})))},k.doCode=function(e,t){var n=/\S[ ]*$/.test(e.before);if(!/^[ ]*\S/.test(e.after)&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,(function(t){return e.selection=t+e.selection,""}));var a=1,i=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(a=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(i=0),e.skipLines(a,i),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},k.doList=function(e,t,n){var a=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,i="-",o=1,l=function(){var e;return n?(e=" "+o+". ",o++):e=" "+i+" ",e},c=function(e){return void 0===n&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,(function(e){return l()}))};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var d=/\d+[.]/.test(e.startTag);if(e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),d&&(e.after=e.after.replace(a,c)),n==d)return}var u=1;e.before=e.before.replace(/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,(function(e){return/^\s*([*+-])/.test(e)&&(i=r.$1),u=/[^\n]\n\n[^\n]/.test(e)?1:0,c(e)})),e.selection||(e.selection=this.getString("litem"));var p=l(),f=1;e.after=e.after.replace(a,(function(e){return f=/[^\n]\n\n[^\n]/.test(e)?1:0,c(e)})),e.trimWhitespace(!0),e.skipLines(u,f,!0),e.startTag=p;var g=p.replace(/./g," ");this.wrap(e,s-g.length),e.selection=e.selection.replace(/\n/g,"\n"+g)},k.doHeading=function(e,t){if(e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,""),!e.selection)return e.startTag="## ",e.selection=this.getString("headingexample"),void(e.endTag=" ##");var n=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(n=r.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(n=1),/-+/.test(e.endTag)&&(n=2),e.startTag=e.endTag="",e.skipLines(1,1);var a=0==n?2:n-1;if(a>0){var i=a>=2?"-":"=",o=e.selection.length;for(o>s&&(o=s),e.endTag="\n";o--;)e.endTag+=i}},k.doHorizontalRule=function(e,t){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)}}()},3351:function(){StackExchange=window.StackExchange=window.StackExchange||{},StackOverflow=window.StackOverflow=window.StackOverflow||{},function(){if(!StackExchange.MarkdownEditor){var e,t=[],n={},a=function(e){var t=/\1<\/a>/g,n=window.location.hostname.toLowerCase(),a=StackExchange.options.site,i=a.parentUrl&&StackExchange.helpers.parseUrl(a.parentUrl).hostname,r=a.childUrl&&StackExchange.helpers.parseUrl(a.childUrl).hostname,o={};function s(e,t){var a=o[e+"|"+t];return a||(function(e,t){if(l[e+"|"+t])return;if(a=e,a!==n&&(u["s_"+a]||(!r||a!==r)&&(!i||a!==i)&&(!StackExchange.options.site.isMetaSite||a!==StackExchange.options.networkMetaHostname)&&n!==StackExchange.options.networkMetaHostname))return;var a;l[e+"|"+t]=!0;var o=c[e];o||(o=c[e]=[]);o.push(t),d.trigger()}(e,t),null)}var l={},c={};var d=StackExchange.helpers.DelayedReaction((function(){var e=!1;for(var t in c)if(c.hasOwnProperty(t)){var n,a=p(t);c[t].length>30?n=c[t].splice(0,30).join(";"):(n=c[t].join(";"),delete c[t]),e=!0,$.ajax({url:"https://api.stackexchange.com/2.0/questions/"+n+"?pagesize=30&key=6AU78DZ)GcdjNjAszYmTLQ((&filter=!6G7RPxWUNTleV&site="+t,crossDomain:!0,jsonpCallback:a,dataType:"jsonp"});break}e&&d.trigger()}),1e3,{sliding:!0}),u={};function p(e){var t=e.toLowerCase().replace(/\./g,"$").replace(/-/g,"_").replace(/[^_$a-z]/,"");return window.apiCallbacks[t]||(window.apiCallbacks[t]=function(t){f(t,e)}),"apiCallbacks."+t}window.apiCallbacks={};var f=function(t,n){if(t)if(t.error_message)/^No site found/.test(t.error_message)&&(u["s_"+n]=!0);else if(t.items){for(var a=t.items,i=a.length,r=0;r=h)&&(a.count++,a.ids[t]=!0,!0)}(a,i))return e;var r=s(a,i);return r?''+r+"":e}))}}(S),i=function(e){return e.replace(/<(a\shref|img\ssrc)="(http:)?(\/\/([^""\/]+?\.)?imgur.com\/[^""]+?)"/gi,'<$1="https:$3"')},r=$.Callbacks();StackExchange.MarkdownEditor=function(o){var s=o.postfix||"";e=StackExchange.options.site.isMetaSite,enableTables=o.enableTables;var l=new Commonmark.Converter({autoNewlines:StackExchange.settings.markdown.autoNewlines,enableTables:o.enableTables});o.mutateConverter&&(l=o.mutateConverter(l));var c=o.sanitizeAndHighlight||j,d=l.hooks;d.addNoop("preSafe"),o.disableAutoQuestionLinks||d.chain("postConversion",a),d.chain("postConversion",(function(e){return d.preSafe(e)})),d.chain("postConversion",c),d.chain("postConversion",I),d.chain("postConversion",T),d.chain("postConversion",C),window.modSuspendTokens&&d.chain("postConversion",window.modSuspendTokens);var u,f=new U({postfix:s,userId:o.userId});o.imageUploader&&!("showLowRepImageUploadWarning"in o.imageUploader)&&(o.imageUploader.showLowRepImageUploadWarning=o.showLowRepImageUploadWarning);var g,h,m,v={helpButton:{handler:function(){u&&u(),f.toggle()}},strings:(g=o.noCode,h='http://example.com/ "'+"optional title"+'"
',m="Insert Hyperlink",{bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:""+m+"
"+h,linktabtitle:m,quote:"Blockquote Ctrl+Q",quoteexample:"Blockquote",code:g?"Preformatted text Ctrl-K":"Code Sample Ctrl+K",codeexample:g?"enter preformatted text here":"enter code here",image:"Image Ctrl+G",imagedescription:"enter image description here",imagedialog:""+"Insert Image"+'
http://example.com/images/diagram.jpg "'+"optional title"+'"
',olist:"Numbered List Ctrl+O",ulist:"Bulleted List Ctrl+U",litem:"List item",heading:"Heading / Ctrl+H",headingexample:"Heading",hr:"Horizontal Rule
Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help",ok:"OK",cancel:"Cancel"}),wrapImageInLink:!o.disableImageLinkWrapping,convertImagesToLinks:o.convertImagesToLinks,imageUploader:o.imageUploader},w=new Markdown.Editor(l,s,v);w.hooks.chain("postBlockquoteCreation",E),StackExchange.settings.site.allowImageUploads&&!o.noModals&&(o.showLowRepImageUploadWarning&&StackExchange.imageUploader.enableLowRepWarning(),w.hooks.set("insertImageDialog",StackExchange.imageUploader.uploadImageDialog)),o.noModals&&(u=function(e,t,n,a){var i,r,o,s;function l(e){o=null,$("#wmd-button-bar"+n+" .wmd-button__active").removeClass("wmd-button__active"),e?$(".js-wmd-inline-dialog-"+n).remove():$(".js-wmd-inline-dialog-"+n).slideUp(100,(function(){$(this).remove()})),$("#wmd-input"+n).prop("disabled",!1).focus(),$("#wmd-button-bar"+n).removeClass("has-active-button"),i&&(i(),i=null)}e.hooks.set("skipModalBackground",(function(e){return!0}));var c=$("#post-editor"+n);function d(e){$("#wmd-image-button"+n+".wmd-button__active").length?o(e):(r=e,setTimeout((function(){r=null}),500),$("#wmd-image-button"+n).click())}function u(e){var t=(e=e.originalEvent||e).dataTransfer.items,n=!1;if(t)for(var a=0;a"+"Insert Hyperlink"+"
");return a.find(".js-insert-link-button").text("Add link").click((function(){var t=$(this).parent().find("input").val();return t=t.replace(/^https:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(t)||(t="http://"+t),i=null,l(),e(t),!1})).end().insertAfter(t).hide().slideDown(100).find("input").val("https://").keydown((function(e){if(13===e.which)return a.find(".js-insert-link-button").click(),!1})),$("#wmd-input"+n).prop("disabled",!0),setTimeout((function(){var e=a.find("input");e.caret(0,8),e.focus()}),0),i=function(){e(null)},h(a),!0})),e.hooks.set("insertImageDialog",(function(e){g($("#wmd-image-button"+n));var a=$("#wmd-button-bar"+n),c=$(""+(t.imageUploader.showLowRepImageUploadWarning?""+"Images are useful in a post, but make sure the post is still clear without them<\/b>. If you post images of code or error messages, copy and paste or type the actual code or message into the post directly."+"":"")+""+(t.imageUploader.allowUrls?(function(n){return n.browseStart+"Browse"+n.browseEnd+", drag & drop, or "+n.pasteStart+"paste"+n.pasteEnd+" an image or link"})({browseStart:""+"Add picture"+' '+"Cancel"+' ");c.insertAfter(a).hide().slideDown(100,(function(){var e=c.find(".js-add-picture");e.prop("disabled")?setTimeout((function(){$("#image-upload-file-input"+n).focus()}),100):e.focus()})),c.find(".js-url-input-container input").keydown((function(e){if(13===e.which)return c.find(".js-add-picture").click(),!1}));var d,f,m,v=StackExchange.stacksValidation.handlerFor(c.find(".js-pseudo-input")),w=!1;function k(){f&&(URL.revokeObjectURL(f),f=null)}$("#wmd-input"+n).prop("disabled",!0);var b="file";s=function(e){e&&!t.imageUploader.allowUrls||(e&&!/^https?:\/\//i.test(e)&&(e="https://"+e),v.clear(),v=StackExchange.stacksValidation.handlerFor($("#image-upload-url-input"+n)),k(),b="url",m=e,c.find(".js-image-upload-preview, .js-cta-container").addClass("d-none"),c.find(".js-url-input-container").removeClass("d-none").find("input").val(e).trigger("input").focus())},o=function(e){if(!w){if(v.clear(),v=StackExchange.stacksValidation.handlerFor(c.find(".js-pseudo-input")),k(),b="file",c.find(".js-url-input-container").addClass("d-none"),c.find(".js-cta-container").removeClass("d-none"),e){f=URL.createObjectURL(e),c.find(".js-image-upload-preview").attr("src",f).removeClass("d-none");var t=e.size>=2097152;t&&v.add("error","Your image is too large to upload (over 2 MiB)."),c.find(".js-add-picture").prop("disabled",t).focus()}else c.find(".js-image-upload-preview").removeAttr("src").addClass("d-none"),c.find(".js-add-picture").prop("disabled",!0);d=e}};var x=!1;i=function(){x=!0,k(),e(null)},r&&(o(r),r=null);var y=$("#image-upload-file-input"+n).on("change",(function(e){o(p(e))}));return $("#image-upload-url-input"+n).on("input",(function(){var e;t.imageUploader.allowUrls?e=!$(this).val():(v.clear(),$(this).val()&&v.add("error",(function(n){return"Uploading images via web links is not supported on this site. Paste an image from the clipboard or "+n.browseStart+"browse"+n.browseEnd+" files on your device."})({browseStart:"