gollum 5.2.3 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +41 -0
  3. data/Gemfile +18 -4
  4. data/HISTORY.md +3 -3
  5. data/LATEST_CHANGES.md +13 -0
  6. data/README.md +38 -26
  7. data/Rakefile +55 -12
  8. data/bin/gollum +6 -4
  9. data/bin/gollum-migrate-tags +40 -28
  10. data/docker-run.sh +18 -0
  11. data/gollum.gemspec +19 -14
  12. data/lib/gollum/app.rb +66 -42
  13. data/lib/gollum/public/assets/.sprockets-manifest-160337b312f8e438181baac4aaa37319.json +1 -0
  14. data/lib/gollum/public/assets/{app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css → app-309be032396e783b13a47df58f389b7c8e11c2b2d42640560b874f677c25f6e5.css} +1 -1
  15. data/lib/gollum/public/assets/{app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css.gz → app-309be032396e783b13a47df58f389b7c8e11c2b2d42640560b874f677c25f6e5.css.gz} +0 -0
  16. data/lib/gollum/public/assets/{app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js → app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js} +2 -2
  17. data/lib/gollum/public/assets/{app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js.gz → app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js.gz} +0 -0
  18. data/lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css.gz +0 -0
  19. data/lib/gollum/public/assets/{editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js → editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js} +2 -2
  20. data/lib/gollum/public/assets/{editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js.gz → editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js.gz} +0 -0
  21. data/lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css.gz +0 -0
  22. data/lib/gollum/public/gollum/javascript/app.js +1 -0
  23. data/lib/gollum/public/gollum/javascript/date.min.js +123 -0
  24. data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +1 -1
  25. data/lib/gollum/public/gollum/javascript/gollum.js.erb +20 -2
  26. data/lib/gollum/public/gollum/stylesheets/editor.scss +1 -0
  27. data/lib/gollum/public/gollum/stylesheets/template.scss.erb +8 -0
  28. data/lib/gollum/templates/commit.mustache +4 -2
  29. data/lib/gollum/templates/compare.mustache +10 -4
  30. data/lib/gollum/templates/create.mustache +7 -4
  31. data/lib/gollum/templates/edit.mustache +7 -4
  32. data/lib/gollum/templates/history.mustache +10 -3
  33. data/lib/gollum/templates/latest_changes.mustache +8 -5
  34. data/lib/gollum/templates/layout.mustache +1 -0
  35. data/lib/gollum/templates/navbar.mustache +9 -2
  36. data/lib/gollum/templates/overview.mustache +7 -4
  37. data/lib/gollum/templates/search.mustache +7 -1
  38. data/lib/gollum/templates/wiki_content.mustache +4 -2
  39. data/lib/gollum/views/commit.rb +4 -0
  40. data/lib/gollum/views/create.rb +3 -2
  41. data/lib/gollum/views/edit.rb +2 -5
  42. data/lib/gollum/views/has_math.rb +11 -0
  43. data/lib/gollum/views/helpers/locale_helpers.rb +82 -0
  44. data/lib/gollum/views/history.rb +17 -12
  45. data/lib/gollum/views/latest_changes.rb +15 -10
  46. data/lib/gollum/views/layout.rb +6 -1
  47. data/lib/gollum/views/page.rb +23 -18
  48. data/lib/gollum/views/template_cascade.rb +40 -0
  49. data/lib/gollum.rb +10 -6
  50. metadata +55 -28
  51. data/lib/gollum/public/assets/.sprockets-manifest-de7bb79aec424e55af1acdcc4237b301.json +0 -1
@@ -19,6 +19,6 @@ keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward
19
19
  ;var g=e("./lib/dom");g.importCssString&&g.importCssString(".ace_marker-layer .ace_isearch-result { position: absolute; z-index: 6; box-sizing: border-box;}div.ace_isearch-result { border-radius: 4px; background-color: rgba(255, 200, 0, 0.5); box-shadow: 0 0 4px rgb(255, 200, 0);}.ace_dark div.ace_isearch-result { background-color: rgb(100, 110, 160); box-shadow: 0 0 4px rgb(80, 90, 140);}","incremental-search-highlighting");var p=e("./commands/command_manager");(function(){this.setupIncrementalSearch=function(e,t){if(this.usesIncrementalSearch!=t){this.usesIncrementalSearch=t;var n=u.iSearchStartCommands;this[t?"addCommands":"removeCommands"](n)}}}).call(p.CommandManager.prototype);var f=e("./editor").Editor;e("./config").defineOptions(f.prototype,"editor",{useIncrementalSearch:{set:function(t){this.keyBinding.$handlers.forEach(function(e){e.setupIncrementalSearch&&e.setupIncrementalSearch(this,t)}),this._emit("incrementalSearchSettingChanged",{isEnabled:t})}}})}),ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"],function(e,r){"use strict";var t=e("../lib/dom");e("../incremental_search");var n=e("../commands/incremental_search_commands"),i=e("./hash_handler").HashHandler;r.handler=new i,r.handler.isEmacs=!0;var o,s,a=!(r.handler.$id="ace/keyboard/emacs");r.handler.attach=function(e){a||(a=!0,t.importCssString(" .emacs-mode .ace_cursor{ border: 1px rgba(50,250,50,0.8) solid!important; box-sizing: border-box!important; background-color: rgba(0,250,0,0.9); opacity: 0.5; } .emacs-mode .ace_hidden-cursors .ace_cursor{ opacity: 1; background-color: transparent; } .emacs-mode .ace_overwrite-cursors .ace_cursor { opacity: 1; background-color: transparent; border-width: 0 0 2px 2px !important; } .emacs-mode .ace_text-layer { z-index: 4 } .emacs-mode .ace_cursor-layer { z-index: 2 }","emacsMode")),o=e.session.$selectLongWords,e.session.$selectLongWords=!0,s=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.$emacsMark=null,e.session.$emacsMarkRing=e.session.$emacsMarkRing||[],e.emacsMark=function(){return this.session.$emacsMark},e.setEmacsMark=function(e){this.session.$emacsMark=e},e.pushEmacsMark=function(e,t){var n=this.session.$emacsMark;n&&this.session.$emacsMarkRing.push(n),!e||t?this.setEmacsMark(e):this.session.$emacsMarkRing.push(e)},e.popEmacsMark=function(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.session.$emacsMarkRing.pop()},e.getLastEmacsMark=function(){return this.session.$emacsMark||this.session.$emacsMarkRing.slice(-1)[0]},e.emacsMarkForSelection=function(e){var t=this.selection,n=this.multiSelect?this.multiSelect.getAllRanges().length:1,i=t.index||0,o=this.session.$emacsMarkRing,r=o.length-(n-i),s=o[r]||t.anchor;return e&&o.splice(r,1,"row"in e&&"column"in e?e:undefined),s},e.on("click",c),e.on("changeSession",l),e.renderer.$blockCursor=!0,e.setStyle("emacs-mode"),e.commands.addCommands(d),r.handler.platform=e.commands.platform,e.$emacsModeHandler=this,e.addEventListener("copy",this.onCopy),e.addEventListener("paste",this.onPaste)},r.handler.detach=function(e){e.renderer.$blockCursor=!1,e.session.$selectLongWords=o,e.session.$useEmacsStyleLineStart=s,e.removeEventListener("click",c),e.removeEventListener("changeSession",l),e.unsetStyle("emacs-mode"),e.commands.removeCommands(d),e.removeEventListener("copy",this.onCopy),e.removeEventListener("paste",this.onPaste),e.$emacsModeHandler=null};var l=function(e){e.oldSession&&(e.oldSession.$selectLongWords=o,e.oldSession.$useEmacsStyleLineStart=s),o=e.session.$selectLongWords,e.session.$selectLongWords=!0,s=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.hasOwnProperty("$emacsMark")||(e.session.$emacsMark=null),e.session.hasOwnProperty("$emacsMarkRing")||(e.session.$emacsMarkRing=[])},c=function(e){e.editor.session.$emacsMark=null},h=e("../lib/keys").KEY_MODS,u={C:"ctrl",S:"shift",M:"alt",CMD:"command"};["C-S-M-CMD","S-M-CMD","C-M-CMD","C-S-CMD","C-S-M","M-CMD","S-CMD","S-M","C-CMD","C-M","C-S","CMD","M","S","C"].forEach(function(e){var t=0;e.split("-").forEach(function(e){t|=h[u[e]]}),u[t]=e.toLowerCase()+"-"}),r.handler.onCopy=function(e,t){t.$handlesEmacsOnCopy||(t.$handlesEmacsOnCopy=!0,r.handler.commands.killRingSave.exec(t),t.$handlesEmacsOnCopy=!1)},r.handler.onPaste=function(e,t){t.pushEmacsMark(t.getCursorPosition())},r.handler.bindKey=function(e,t){if("object"==typeof e&&(e=e[this.platform]),e){var n=this.commandKeyBinding;e.split("|").forEach(function(e){e=e.toLowerCase(),n[e]=t,e.split(" ").slice(0,-1).reduce(function(e,t,n){var i=e[n-1]?e[n-1]+" ":"";return e.concat([i+t])},[]).forEach(function(e){n[e]||(n[e]="null")})},this)}},r.handler.getStatusText=function(e,t){var n="";return t.count&&(n+=t.count),t.keyChain&&(n+=" "+t.keyChain),n},r.handler.handleKeyboard=function(e,t,n,i){if(-1===i)return undefined;var o=e.editor;if(o._signal("changeStatus"),-1==t&&(o.pushEmacsMark(),e.count)){var r=new Array(e.count+1).join(n);return e.count=null,{command:"insertstring",args:r}}var s=u[t];if(("c-"==s||e.count)&&("number"==typeof(c=parseInt(n[n.length-1]))&&!isNaN(c)))return e.count=Math.max(e.count,0)||0,e.count=10*e.count+c,{command:"null"};s&&(n=s+n),e.keyChain&&(n=e.keyChain+=" "+n);var a,l=this.commandKeyBinding[n];if(e.keyChain="null"==l?n:"",!l)return undefined;if("null"===l)return{command:"null"};if("universalArgument"===l)return e.count=-4,{command:"null"};if("string"!=typeof l&&(a=l.args,l.command&&(l=l.command),"goorselect"===l&&(l=o.emacsMark()?a[1]:a[0],a=null)),"string"==typeof l&&(("insertstring"===l||"splitline"===l||"togglecomment"===l)&&o.pushEmacsMark(),!(l=this.commands[l]||o.commands.commands[l])))return undefined;if(!l.readOnly&&!l.isYank&&(e.lastCommand=null),!l.readOnly&&o.emacsMark()&&o.setEmacsMark(null),e.count){var c=e.count;if(e.count=0,!l||!l.handlesCount)return{args:a,command:{exec:function(e,t){for(var n=0;n<c;n++)l.exec(e,t)},multiSelectAction:l.multiSelectAction}};a||(a={}),"object"==typeof a&&(a.count=c)}return{command:l,args:a}},r.emacsKeys={"Up|C-p":{command:"goorselect",args:["golineup","selectup"]},"Down|C-n":{command:"goorselect",args:["golinedown","selectdown"]},"Left|C-b":{command:"goorselect",args:["gotoleft","selectleft"]},"Right|C-f":{command:"goorselect",args:["gotoright","selectright"]},"C-Left|M-b":{command:"goorselect",args:["gotowordleft","selectwordleft"]},"C-Right|M-f":{command:"goorselect",args:["gotowordright","selectwordright"]},"Home|C-a":{command:"goorselect",args:["gotolinestart","selecttolinestart"]},"End|C-e":{command:"goorselect",args:["gotolineend","selecttolineend"]},"C-Home|S-M-,":{command:"goorselect",args:["gotostart","selecttostart"]},"C-End|S-M-.":{command:"goorselect",args:["gotoend","selecttoend"]},"S-Up|S-C-p":"selectup","S-Down|S-C-n":"selectdown","S-Left|S-C-b":"selectleft","S-Right|S-C-f":"selectright","S-C-Left|S-M-b":"selectwordleft","S-C-Right|S-M-f":"selectwordright","S-Home|S-C-a":"selecttolinestart","S-End|S-C-e":"selecttolineend","S-C-Home":"selecttostart","S-C-End":"selecttoend","C-l":"recenterTopBottom","M-s":"centerselection","M-g":"gotoline","C-x C-p":"selectall","C-Down":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"C-Up":{command:"goorselect",args:["gotopageup","selectpageup"]},"PageDown|C-v":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"PageUp|M-v":{command:"goorselect",args:["gotopageup","selectpageup"]},"S-C-Down":"selectpagedown","S-C-Up":"selectpageup","C-s":"iSearch","C-r":"iSearchBackwards","M-C-s":"findnext","M-C-r":"findprevious","S-M-5":"replace",Backspace:"backspace","Delete|C-d":"del","Return|C-m":{command:"insertstring",args:"\n"},"C-o":"splitline","M-d|C-Delete":{command:"killWord",args:"right"},"C-Backspace|M-Backspace|M-Delete":{command:"killWord",args:"left"},"C-k":"killLine","C-y|S-Delete":"yank","M-y":"yankRotate","C-g":"keyboardQuit","C-w|C-S-W":"killRegion","M-w":"killRingSave","C-Space":"setMark","C-x C-x":"exchangePointAndMark","C-t":"transposeletters","M-u":"touppercase","M-l":"tolowercase","M-/":"autocomplete","C-u":"universalArgument","M-;":"togglecomment","C-/|C-x u|S-C--|C-z":"undo","S-C-/|S-C-x u|C--|S-C-z":"redo","C-x r":"selectRectangularRegion","M-x":{command:"focusCommandLine",args:"M-x "}},r.handler.bindKeys(r.emacsKeys),r.handler.addCommands({recenterTopBottom:function(e){var t=e.renderer,n=t.$cursorLayer.getPixelPosition(),i=t.$size.scrollerHeight-t.lineHeight,o=t.scrollTop;o=Math.abs(n.top-o)<2?n.top-i:Math.abs(n.top-o-.5*i)<2?n.top:n.top-.5*i,e.session.setScrollTop(o)},selectRectangularRegion:function(e){e.multiSelect.toggleBlockSelection()},setMark:{exec:function(t,e){function n(){var e=t.popEmacsMark();e&&t.moveCursorToPosition(e)}if(e&&e.count)return t.inMultiSelectMode?t.forEachSelection(n):n(),void n();var i=t.emacsMark(),o=t.selection.getAllRanges(),r=o.map(function(e){return{row:e.start.row,column:e.start.column}}),s=!0,a=o.every(function(e){return e.isEmpty()});return!s||!i&&a?i?void 0:(r.forEach(function(e){t.pushEmacsMark(e)}),void t.setEmacsMark(r[r.length-1])):(t.inMultiSelectMode?t.forEachSelection({exec:t.clearSelection.bind(t)}):t.clearSelection(),void(i&&t.pushEmacsMark(null)))},readOnly:!0,handlesCount:!0},exchangePointAndMark:{exec:function(e,t){var n=e.selection;if(t.count||n.isEmpty())if(t.count){var i={row:n.lead.row,column:n.lead.column};n.clearSelection(),n.moveCursorToPosition(e.emacsMarkForSelection(i))}else n.selectToPosition(e.emacsMarkForSelection());else n.setSelectionRange(n.getRange(),!n.isBackwards())},readOnly:!0,handlesCount:!0,multiSelectAction:"forEach"},killWord:{exec:function(e,t){e.clearSelection(),"left"==t?e.selection.selectWordLeft():e.selection.selectWordRight();var n=e.getSelectionRange(),i=e.session.getTextRange(n);r.killRing.add(i),e.session.remove(n),e.clearSelection()},multiSelectAction:"forEach"},killLine:function(e){e.pushEmacsMark(null),e.clearSelection();var t=e.getSelectionRange(),n=e.session.getLine(t.start.row);t.end.column=n.length,n=n.substr(t.start.column);var i=e.session.getFoldLine(t.start.row);i&&t.end.row!=i.end.row&&(t.end.row=i.end.row,n="x"),/^\s*$/.test(n)&&(t.end.row++,n=e.session.getLine(t.end.row),t.end.column=/^\s*$/.test(n)?n.length:0);var o=e.session.getTextRange(t);e.prevOp.command==this?r.killRing.append(o):r.killRing.add(o),e.session.remove(t),e.clearSelection()},yank:function(e){e.onPaste(r.killRing.get()||""),e.keyBinding.$data.lastCommand="yank"},yankRotate:function(e){"yank"==e.keyBinding.$data.lastCommand&&(e.undo(),e.session.$emacsMarkRing.pop(),e.onPaste(r.killRing.rotate()),e.keyBinding.$data.lastCommand="yank")},killRegion:{exec:function(e){r.killRing.add(e.getCopyText()),e.commands.byName.cut.exec(e),e.setEmacsMark(null)},readOnly:!0,multiSelectAction:"forEach"},killRingSave:{exec:function(i){i.$handlesEmacsOnCopy=!0;var t=i.session.$emacsMarkRing.slice(),o=[];r.killRing.add(i.getCopyText()),setTimeout(function(){function e(){var e=i.selection,t=e.getRange(),n=e.isBackwards()?t.end:t.start;o.push({row:n.row,column:n.column}),e.clearSelection()}i.$handlesEmacsOnCopy=!1,i.inMultiSelectMode?i.forEachSelection({exec:e}):e(),i.setEmacsMark(null),i.session.$emacsMarkRing=t.concat(o.reverse())},0)},readOnly:!0},keyboardQuit:function(e){e.selection.clearSelection(),e.setEmacsMark(null),e.keyBinding.$data.count=null},focusCommandLine:function(e,t){e.showCommandLine&&e.showCommandLine(t)}}),r.handler.addCommands(n.iSearchStartCommands);var d=r.handler.commands;d.yank.isYank=!0,d.yankRotate.isYank=!0,r.killRing={$data:[],add:function(e){e&&this.$data.push(e),30<this.$data.length&&this.$data.shift()},append:function(e){var t=this.$data.length-1,n=this.$data[t]||"";e&&(n+=e),n&&(this.$data[t]=n)},get:function(e){return e=e||1,this.$data.slice(this.$data.length-e,this.$data.length).reverse().join("\n")},pop:function(){return 1<this.$data.length&&this.$data.pop(),this.get()},rotate:function(){return this.$data.unshift(this.$data.pop()),this.get()}}}),ace.require(["ace/keyboard/emacs"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t){"use strict";var n=function(e){this.$editor=e;var t=this,n=[],i=!1;this.onAfterExec=function(){i=!1,t.processRows(n),n=[]},this.onExec=function(){i=!0},this.onChange=function(e){i&&(-1==n.indexOf(e.start.row)&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;for(var t=[],n=0,i=e.length;n<i;n++){var o=e[n];if(!(-1<t.indexOf(o)))for(var r=this.$findCellWidthsForBlock(o),s=this.$setBlockCellWidthsToMax(r.cellWidths),a=r.firstRow,l=0,c=s.length;l<c;l++){var h=s[l];t.push(a),this.$adjustRow(a,h),a++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){for(var t,n=[],i=e;0<=i&&0!=(t=this.$cellWidthsForRow(i)).length;)n.unshift(t),i--;var o=i+1;i=e;for(var r=this.$editor.session.getLength();i<r-1&&(i++,0!=(t=this.$cellWidthsForRow(i)).length);)n.push(t);return{cellWidths:n,firstRow:o}},this.$cellWidthsForRow=function(e){for(var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),i=n.map(function(){return 0}).slice(1),o=this.$editor.session.getLine(e),r=0,s=n.length-1;r<s;r++){var a=n[r]+1,l=n[r+1],c=this.$rightmostSelectionInCell(t,l),h=o.substring(a,l);i[r]=Math.max(h.replace(/\s+$/g,"").length,c-a)}return i},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){for(var t,n,i,o=!0,r=this.$izip_longest(e),s=0,a=r.length;s<a;s++){var l=r[s];if(l.push){l.push(NaN);for(var c=0,h=l.length;c<h;c++){var u=l[c];if(o&&(t=c,i=0,o=!1),isNaN(u)){n=c;for(var d=t;d<n;d++)e[d][s]=i;o=!0}i=Math.max(i,u)}}else console.error(l)}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){for(var i=[],o=0,r=e.length;o<r;o++)e[o]<=t?i.push(o):i.push(0);n=Math.max.apply(Math,i)}return n},this.$tabsForRow=function(e){for(var t,n=[],i=this.$editor.session.getLine(e),o=/\t/g;null!=(t=o.exec(i));)n.push(t.index);return n},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(0!=n.length)for(var i=0,o=-1,r=this.$izip(t,n),s=0,a=r.length;s<a;s++){var l=r[s][0],c=r[s][1],h=(o+=1+l)-(c+=i);if(0!=h){var u=this.$editor.session.getLine(e).substr(0,c),d=u.replace(/\s*$/g,""),g=u.length-d.length;0<h&&(this.$editor.session.getDocument().insertInLine({row:e,column:c+1},Array(h+1).join(" ")+"\t"),this.$editor.session.getDocument().removeInLine(e,c,c+1),i+=h),h<0&&-h<=g&&(this.$editor.session.getDocument().removeInLine(e,c+h,c),i+=h)}}},this.$izip_longest=function(e){if(!e[0])return[];for(var t=e[0].length,n=e.length,i=1;i<n;i++){var o=e[i].length;t<o&&(t=o)}for(var r=[],s=0;s<t;s++){var a=[];for(i=0;i<n;i++)""===e[i][s]?a.push(NaN):a.push(e[i][s]);r.push(a)}return r},this.$izip=function(e,t){for(var n=e.length>=t.length?t.length:e.length,i=[],o=0;o<n;o++){var r=[e[o],t[o]];i.push(r)}return i}}).call(n.prototype),t.ElasticTabstopsLite=n;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new n(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}),ace.require(["ace/ext/elastic_tabstops_lite"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.require(["ace/ext/error_marker"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";e("../../lib/dom").importCssString(i),n.exports.overlayPage=function(e,t,n){function i(e){27===e.keyCode&&o()}function o(){r&&(document.removeEventListener("keydown",i),r.parentNode.removeChild(r),e.focus(),r=null,n&&n())}var r=document.createElement("div");return r.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",r.addEventListener("click",function(){o()}),document.addEventListener("keydown",i),t.addEventListener("click",function(e){e.stopPropagation()}),r.appendChild(t),document.body.appendChild(r),e.blur(),{close:o}}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var i=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){i.KEY_MODS;var r=[],s={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var n in t){var i=n.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[n];Array.isArray(o)||(o=[o]),o.forEach(function(e){"string"!=typeof e&&(e=e.name),s[e]?s[e].key+="|"+i:(s[e]={key:i,command:e},r.push(s[e]))})}}),r}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(r,e,t){"use strict";function n(e){if(!document.getElementById("kbshortcutmenu")){var t=r("./menu_tools/overlay_page").overlayPage,n=(0,r("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts)(e),i=document.createElement("div"),o=n.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+'</span> : <span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");i.id="kbshortcutmenu",i.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",t(e,i)}}var i=r("../editor").Editor;t.exports.init=function(e){i.prototype.showKeyboardShortcuts=function(){n(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e){e.showKeyboardShortcuts()}}])}}),ace.require(["ace/ext/keybinding_menu"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/lib/dom","ace/editor"],function(e,a){"use strict";function t(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}var n=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,c=e("./lib/lang"),h=e("./range").Range,u=e("./range_list").RangeList,o=e("./keyboard/hash_handler").HashHandler,r=e("./tokenizer").Tokenizer,s=e("./clipboard"),l={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var i=e.session.getTextRange();return n?i.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):i},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(){return s.getText&&s.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:t.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:t.bind(null,{year:"2-digit"}),CURRENT_MONTH:t.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:t.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:t.bind(null,{month:"short"}),CURRENT_DATE:t.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:t.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:t.bind(null,{weekday:"short"}),CURRENT_HOUR:t.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:t.bind(null,{minute:"2-digit"}),CURRENT_SECOND:t.bind(null,{second:"2-digit"})};l.SELECTED_TEXT=l.SELECTION;var d=function(){this.snippetMap={},this.snippetNameMap={}};(function(){n.implement(this,i),this.getTokenizer=function(){return d.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function o(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function e(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var t={regex:"/("+e("/")+"+)/",onMatch:function(e,t,n){var i=n[0];return i.fmtString=!0,i.guard=e.slice(1,-1),i.flag=""},next:"formatString"};return d.$tokenizer=new r({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length?e=i:-1!="`$\\".indexOf(i)&&(e=i),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:o},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,t,n){var i=o(e.substr(1));return n.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+e("\\|")+"*\\|",onMatch:function(e,t,n){var i=e.slice(1,-1).replace(/\\[,|\\]|,/g,function(e){return 2==e.length?e[1]:"\0"}).split("\0");return[(n[0].choices=i)[0]]},next:"start"},t,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length?e=i:-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:"a"<i}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var i=n.shift();return i&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var i={text:e.slice(2)};return n.unshift(i),[i]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var i=n.shift();return this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},t,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),d.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var i=this.variables[t];return"function"==typeof i&&(i=this.variables[t](e,t,n)),null==i?"":i},this.variables=l,this.tmStrFormat=function(e,t,s){if(!t.fmt)return e;var n=t.flag||"",i=t.guard;i=new RegExp(i,n.replace(/[^gim]/g,""));var a="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,l=this;return e.replace(i,function(){var e=l.variables.__;l.variables.__=[].slice.call(arguments);for(var t=l.resolveVariables(a,s),n="E",i=0;i<t.length;i++){var o=t[i];if("object"==typeof o)if(t[i]="",o.changeCase&&o.local){var r=t[i+1];r&&"string"==typeof r&&("u"==o.changeCase?t[i]=r[0].toUpperCase():t[i]=r[0].toLowerCase(),t[i+1]=r.substr(1))}else o.changeCase&&(n=o.changeCase);else"U"==n?t[i]=o.toUpperCase():"L"==n&&(t[i]=o.toLowerCase())}return l.variables.__=e,t.join("")})},this.tmFormatFunction=function(e,t){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},this.resolveVariables=function(n,e){function t(e){var t=n.indexOf(e,s+1);-1!=t&&(s=t)}for(var i=[],o="",r=!0,s=0;s<n.length;s++){var a=n[s];if("string"!=typeof a){if(a){if(r=!1,a.fmtString){var l=n.indexOf(a,s+1);-1==l&&(l=n.length),a.fmt=n.slice(s+1,l),s=l}if(a.text){var c=this.getVariableValue(e,a.text,o)+"";a.fmtString&&(c=this.tmStrFormat(c,a,e)),a.formatFunction&&(c=this.tmFormatFunction(c,a,e)),c&&!a.ifEnd?(i.push(c),t(a)):!c&&a.ifEnd&&t(a.ifEnd)}else a.elseEnd?t(a.elseEnd):null!=a.tabstopId?i.push(a):null!=a.changeCase&&i.push(a)}}else i.push(a),"\n"==a?(r=!0,o=""):r&&(o=/^\t*/.exec(a)[0],r=/\S/.test(a))}return i},this.insertSnippetForSelection=function(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(c[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}var i=e.getCursorPosition(),o=e.session.getLine(i.row),r=e.session.getTabString(),s=o.match(/^\s*/)[0];i.column<s.length&&(s=s.slice(0,i.column)),t=t.replace(/\r/g,"");var a=this.tokenizeTmSnippet(t);a=(a=this.resolveVariables(a,e)).map(function(e){return"\n"==e?e+s:"string"==typeof e?e.replace(/\t/g,r):e});var l=[];a.forEach(function(e,t){if("object"==typeof e){var n=e.tabstopId,i=l[n];if(i||((i=l[n]=[]).index=n,i.value="",i.parents={}),-1===i.indexOf(e)){e.choices&&!i.choices&&(i.choices=e.choices),i.push(e);var o=a.indexOf(e,t+1);if(-1!==o){var r=a.slice(t+1,o);r.some(function(e){return"object"==typeof e})&&!i.value?i.value=r:r.length&&(!i.value||"string"!=typeof i.value)&&(i.value=r.join(""))}}}}),l.forEach(function(e){e.length=0});for(var c={},h=0;h<a.length;h++){var u=a[h];if("object"==typeof u){var d=u.tabstopId,g=l[d],p=a.indexOf(u,h+1);if(c[d])c[d]===u&&(delete c[d],Object.keys(c).forEach(function(e){g.parents[e]=!0}));else{c[d]=u;var f=g.value;"string"!=typeof f?f=n(f):u.fmt&&(f=this.tmStrFormat(f,u,e)),a.splice.apply(a,[h+1,Math.max(0,p-h)].concat(f,u)),-1===g.indexOf(u)&&g.push(u)}}}var m=0,v=0,b="";a.forEach(function(e){if("string"==typeof e){var t=e.split("\n");1<t.length?(v=t[t.length-1].length,m+=t.length-1):v+=e.length,b+=e}else e&&(e.start?e.end={row:m,column:v}:e.start={row:m,column:v})});var w=e.getSelectionRange(),y=e.session.replace(w,b),x=new C(e),k=e.inVirtualSelectionMode&&e.selection.index;x.addTabstops(l,w.start,y,k)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"===t&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),o=e.session.getLine(i.row),r=o.substring(0,i.column),s=o.substr(i.column),a=this.snippetMap;return this.getActiveScopes(e).some(function(e){var t=a[e];return t&&(n=this.findMatchingSnippet(t,r,s)),!!n},this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var o=e[i];if((!o.startRe||o.startRe.test(t))&&((!o.endRe||o.endRe.test(n))&&(o.startRe||o.endRe)))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(n):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(n)[0]:"",o}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,i){function o(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function r(e,t,n){return e=o(e),t=o(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function t(e){e.scope||(e.scope=i||"_"),i=e.scope,s[i]||(s[i]=[],a[i]={});var t=a[i];if(e.name){var n=t[e.name];n&&l.unregister(n),t[e.name]=e}s[i].push(e),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=c.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=r(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=r(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}var s=this.snippetMap,a=this.snippetNameMap,l=this;e||(e=[]),e&&e.content?t(e):Array.isArray(e)&&e.forEach(t),this._signal("registerSnippets",{scope:i})},this.unregister=function(e,o){function t(e){var t=s[e.scope||o];if(t&&t[e.name]){delete t[e.name];var n=r[e.scope||o],i=n&&n.indexOf(e);0<=i&&n.splice(i,1)}}var r=this.snippetMap,s=this.snippetNameMap;e.content?t(e):Array.isArray(e)&&e.forEach(t)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(c){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var r=t[2],s=t[3];if("regex"==r){var a=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=a.exec(s)[1],i.trigger=a.exec(s)[1],i.endTrigger=a.exec(s)[1],i.endGuard=a.exec(s)[1]}else"snippet"==r?(i.tabTrigger=s.match(/^\S*/)[0],i.name||(i.name=s)):i[r]=s}}return n},this.getSnippetByName=function(n,e){var i,o=this.snippetNameMap;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(i=t[n]),!!i},this),i}}).call(d.prototype);var C=function(e){if(e.tabstopManager)return e.tabstopManager;(e.tabstopManager=this).$onChange=this.onChange.bind(this),this.$onChangeSelection=c.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},
20
20
  this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop&&this.selectedTabstop.parents||{},i=(this.tabstops||[]).slice(),o=0;o<i.length;o++){var r=i[o],s=r==this.selectedTabstop||n[r.index];if(r.rangeList.$bias=s?0:1,"remove"==e.action&&r!==this.selectedTabstop){var a=r.parents&&r.parents[this.selectedTabstop.index],l=r.rangeList.pointIndex(e.start,a);l=l<0?-l-1:l+1;var c=r.rangeList.pointIndex(e.end,a);c=c<0?-c-1:c-1;for(var h=r.rangeList.ranges.slice(l,c),u=0;u<h.length;u++)this.removeRange(h[u])}r.rangeList.$onChange(e)}var d=this.editor.session;!this.$inChange&&t&&1==d.getLength()&&!d.getValue()&&this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var t=this.editor.session,n=t.getTextRange(e.firstNonLinked),i=0;i<e.length;i++){var o=e[i];if(o.linked){var r=o.original,s=a.snippetManager.tmStrFormat(n,r,this.editor);t.replace(o,s)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var o=this.ranges[i].contains(e.row,e.column),r=n||this.ranges[i].contains(t.row,t.column);if(o&&r)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){var n=(this.selectedTabstop=t).firstNonLinked||t;if(this.editor.inVirtualSelectionMode)this.editor.selection.setRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n.clone());for(var o=0;o<t.length;o++)t.hasLinkedRanges&&t[o].linked||i.addRange(t[o].clone(),!0);i.ranges[0]&&i.addRange(i.ranges[0].clone())}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,s,t){var a=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var n=h.fromPoints(t,t);p(n.start,s),p(n.end,s),e[0]=[n],e[0].index=0}var l=[this.index+1,0],c=this.ranges;e.forEach(function(e,t){var n=this.$openTabstops[t]||e;e.rangeList=new u;for(var i=e.rangeList.$bias=0;i<e.length;i++){var o=e[i],r=h.fromPoints(o.start,o.end||o.start);g(r.start,s),g(r.end,s),r.original=o,r.tabstop=n,c.push(r),e.rangeList.ranges.push(r),n!=e?n.unshift(r):n[i]=r,o.fmtString||n.firstNonLinked&&a?(r.linked=!0,n.hasLinkedRanges=!0):n.firstNonLinked||(n.firstNonLinked=r)}n.firstNonLinked||(n.hasLinkedRanges=!1),n===e&&(l.push(n),this.$openTabstops[t]=n),this.addTabstopMarkers(n)},this),2<l.length&&(this.tabstops.length&&l.push(l.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,l))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new o,this.keyboardHandler.bindKeys({Tab:function(e){a.snippetManager&&a.snippetManager.expandWithTab(e)||e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(){return!1}})}).call(C.prototype);var g=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},p=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),a.snippetManager=new d;var f=e("./editor").Editor;(function(){this.insertSnippet=function(e,t){return a.snippetManager.insertSnippet(this,e,t)},this.expandSnippet=function(e){return a.snippetManager.expandWithTab(this,e)}}).call(f.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],function(e,t){"use strict";var i=e("../virtual_renderer").VirtualRenderer,o=e("../editor").Editor,l=e("../range").Range,c=e("../lib/event"),u=e("../lib/lang"),g=e("../lib/dom"),p=function(e){var t=new i(e);t.$maxLines=4;var n=new o(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n},n=function(e){var t=g.createElement("div"),d=new p(t);e&&e.appendChild(t),t.style.display="none",d.renderer.content.style.cursor="default",d.renderer.setStyle("ace_autocomplete"),d.setOption("displayIndentGuides",!1),d.setOption("dragDelay",150);var n=function(){};d.focus=n,d.$isFocused=!0,d.renderer.$cursorLayer.restartTimer=n,d.renderer.$cursorLayer.element.style.opacity=0,d.renderer.$maxLines=8,d.renderer.$keepTextAreaAtCursor=!1,d.setHighlightActiveLine(!1),d.session.highlight(""),d.session.$searchHighlight.clazz="ace_highlight-marker",d.on("mousedown",function(e){var t=e.getDocumentPosition();d.selection.moveToPosition(t),o.start.row=o.end.row=t.row,e.stop()});var h,i=new l(-1,0,-1,Infinity),o=new l(-1,0,-1,Infinity);o.id=d.session.addMarker(o,"ace_active-line","fullLine"),d.setSelectOnHover=function(e){e?i.id&&(d.session.removeMarker(i.id),i.id=null):i.id=d.session.addMarker(i,"ace_line-hover","fullLine")},d.setSelectOnHover(!1),d.on("mousemove",function(e){if(h){if(h.x!=e.x||h.y!=e.y){(h=e).scrollTop=d.renderer.scrollTop;var t=h.getDocumentPosition().row;i.start.row!=t&&(i.id||d.setRow(t),s(t))}}else h=e}),d.renderer.on("beforeRender",function(){if(h&&-1!=i.start.row){h.$pos=null;var e=h.getDocumentPosition().row;i.id||d.setRow(e),s(e,!0)}}),d.renderer.on("afterRender",function(){var e=d.getRow(),t=d.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow];n!==t.selectedNode&&t.selectedNode&&g.removeCssClass(t.selectedNode,"ace_selected"),(t.selectedNode=n)&&g.addCssClass(n,"ace_selected")});var r=function(){s(-1)},s=function(e,t){e!==i.start.row&&(i.start.row=i.end.row=e,t||d.session._emit("changeBackMarker"),d._emit("changeHoverMarker"))};d.getHoveredRow=function(){return i.start.row},c.addListener(d.container,"mouseout",r),d.on("hide",r),d.on("changeSelection",r),d.session.doc.getLength=function(){return d.data.length},d.session.doc.getLine=function(e){var t=d.data[e];return"string"==typeof t?t:t&&t.value||""};var a=d.session.bgTokenizer;return a.$tokenizeRow=function(e){function t(e,t){e&&i.push({type:(n.className||"")+(t||""),value:e})}var n=d.data[e],i=[];if(!n)return i;"string"==typeof n&&(n={value:n});for(var o=n.caption||n.value||n.name,r=o.toLowerCase(),s=(d.filterText||"").toLowerCase(),a=0,l=0,c=0;c<=s.length;c++)if(c!=l&&(n.matchMask&1<<c||c==s.length)){var h=s.slice(l,c);l=c;var u=r.indexOf(h,a);if(-1==u)continue;t(o.slice(a,u),""),a=u+h.length,t(o.slice(u,a),"completion-highlight")}return t(o.slice(a,o.length),""),n.meta&&i.push({type:"completion-meta",value:n.meta}),n.message&&i.push({type:"completion-message",value:n.message}),i},a.$updateOnChange=n,a.start=n,d.session.$computeWidth=function(){return this.screenWidth=0},d.isOpen=!1,d.isTopdown=!1,d.autoSelect=!0,d.filterText="",d.data=[],d.setData=function(e,t){d.filterText=t||"",d.setValue(u.stringRepeat("\n",e.length),-1),d.data=e||[],d.setRow(0)},d.getData=function(e){return d.data[e]},d.getRow=function(){return o.start.row},d.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e)),o.start.row!=e&&(d.selection.clearSelection(),o.start.row=o.end.row=e||0,d.session._emit("changeBackMarker"),d.moveCursorTo(e||0,0),d.isOpen&&d._signal("select"))},d.on("changeSelection",function(){d.isOpen&&d.setRow(d.selection.lead.row),d.renderer.scrollCursorIntoView()}),d.hide=function(){this.container.style.display="none",this._signal("hide"),d.isOpen=!1},d.show=function(e,t,n){var i=this.container,o=window.innerHeight,r=window.innerWidth,s=this.renderer,a=s.$maxLines*t*1.4,l=e.top+this.$borderSize;o/2<l&&!n&&o<l+t+a?(s.$maxPixelHeight=l-2*this.$borderSize,i.style.top="",i.style.bottom=o-l+"px",d.isTopdown=!1):(l+=t,s.$maxPixelHeight=o-l-.2*t,i.style.top=l+"px",i.style.bottom="",d.isTopdown=!0),i.style.display="";var c=e.left;c+i.offsetWidth>r&&(c=r-i.offsetWidth),i.style.left=c+"px",this._signal("show"),h=null,d.isOpen=!0},d.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=n<=t?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},d.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},d.$imageSize=0,d.$borderSize=1,d};g.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62);}.ace_completion-meta { opacity: 0.5; margin: 0.9em;}.ace_completion-message { color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12;}.ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111;}.ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1;}","autocompletion.css"),t.AcePopup=n,t.$singleLineEditor=p}),ace.define("ace/autocomplete/util",["require","exports","module"],function(e,t){"use strict";t.parForEach=function(e,t,n){var i=0,o=e.length;0===o&&n();for(var r=0;r<o;r++)t(e[r],function(e,t){++i===o&&n(e,t)})};var r=/[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n=n||r;for(var i=[],o=t-1;0<=o&&n.test(e[o]);o--)i.push(e[o]);return i.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||r;for(var i=[],o=t;o<e.length&&n.test(e[o]);o++)i.push(e[o]);return i},t.getCompletionPrefix=function(e){var t,n=e.getCursorPosition(),i=e.session.getLine(n.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(i,n.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(i,n.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(e,t){"use strict";var n=e("./keyboard/hash_handler").HashHandler,i=e("./autocomplete/popup").AcePopup,l=e("./autocomplete/util"),o=e("./lib/lang"),r=e("./lib/dom"),s=e("./snippets").snippetManager,a=e("./config"),c=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new n,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=o.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=o.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new i(document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(e,t,n){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var i=e.renderer;if(this.popup.setRow(this.autoSelect?0:-1),n)n&&!t&&this.detach();else{this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize());var o=i.layerConfig.lineHeight,r=i.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var s=e.container.getBoundingClientRect();r.top+=s.top-i.layerConfig.offset,r.left+=s.left-e.renderer.scrollLeft,r.left+=i.gutterWidth,this.popup.show(r,o)}},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(){var e=this.editor.selection.lead;(e.row!=this.base.row||e.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),i=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t!=n&&t.parentNode!=o&&!i&&t!=this.tooltipNode&&e.relatedTarget!=n&&this.detach()},this.mousedownListener=function(){this.detach()},this.mousewheelListener=function(){this.detach()},this.goTo=function(e){this.popup.goTo(e)},this.insertMatch=function(e){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;if(e.completer&&e.completer.insertMatch)e.completer.insertMatch(this.editor,e);else{if(this.completions.filterText)for(var t,n=this.editor.selection.getAllRanges(),i=0;t=n[i];i++)t.start.column-=this.completions.filterText.length,this.editor.session.remove(t);e.snippet?s.insertSnippet(this.editor,e.snippet):this.editor.execCommand("insertstring",e.value||e)}this.detach()},this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},this.gatherCompletions=function(n,i){var t=n.getSession(),o=n.getCursorPosition(),r=l.getCompletionPrefix(n);this.base=t.doc.createAnchor(o.row,o.column-r.length),this.base.$insertRight=!0;var s=[],a=n.completers.length;return n.completers.forEach(function(e){e.getCompletions(n,t,o,r,function(e,t){!e&&t&&(s=s.concat(t)),i(null,{prefix:l.getCompletionPrefix(n),matches:s,finished:0==--a})})}),!0},this.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,(this.editor=e).completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},this.updateCompletions=function(s,e){if(s&&this.base&&this.completions){var t=this.editor.getCursorPosition(),n=this.editor.session.getTextRange({start:this.base,end:t});if(n==this.completions.filterText)return;return this.completions.setFilter(n),this.completions.filtered.length?1!=this.completions.filtered.length||this.completions.filtered[0].value!=n||this.completions.filtered[0].snippet?void this.openPopup(this.editor,n,s):this.detach():this.detach()}if(e&&e.matches){t=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(t.row,t.column),this.base.$insertRight=!0,this.completions=new h(e.matches),this.openPopup(this.editor,"",s)}var a=this.gatherCompletionsId;this.gatherCompletions(this.editor,function(e,t){var n=function(){if(t.finished)return this.detach()}.bind(this),i=t.prefix,o=t&&t.matches;if(!o||!o.length)return n();if(0===i.indexOf(t.prefix)&&a==this.gatherCompletionsId){this.completions=new h(o),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(i);var r=this.completions.filtered;return r.length&&(1!=r.length||r[0].value!=i||r[0].snippet)?this.autoInsert&&1==r.length&&t.finished?this.insertMatch(r[0]):void this.openPopup(this.editor,i,s):n()}}.bind(this))},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var e=this.popup,t=e.data,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),i=null;return n&&this.editor&&this.popup.isOpen?(this.editor.completers.some(function(e){return e.getDocTooltip&&(i=e.getDocTooltip(n)),i}),!i&&"string"!=typeof n&&(i=n),"string"==typeof i&&(i={docText:i}),i&&(i.docHTML||i.docText)?void this.showDocTooltip(i):this.hideDocTooltip()):this.hideDocTooltip()},this.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=r.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||document.body.appendChild(t);var n=this.popup,i=n.container.getBoundingClientRect();t.style.top=n.container.style.top,t.style.bottom=n.container.style.bottom,t.style.display="block",window.innerWidth-i.right<320?i.left<320?(n.isTopdown?t.style.top=i.bottom+"px":t.style.top=n.container.offsetTop-t.offsetHeight+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-i.left+"px",t.style.left=""):(t.style.left=i.right+1+"px",t.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==e&&this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},this.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&this.editor.completer,this.popup=null}}).call(c.prototype),c["for"]=function(e){return e.completer||(a.get("sharedPopups")?(c.$shared||(c.$sharedInstance=new c),e.completer=c.$sharedInstance):(e.completer=new c,e.once("destroy",function(e,t){t.completer.destroy()}))),e.completer},c.startCommand={name:"startAutocomplete",exec:function(e,t){var n=c["for"](e);n.autoInsert=!1,n.autoSelect=!0,n.showPopup(e,t),n.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var h=function(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(e){if(e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else t=this.all;this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t!==n&&(n=t,!0)}),this.filtered=t},this.filterCompletions=function(e,t){var n=[],i=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=r.caption||r.value||r.snippet;if(a){var l,c,h=-1,u=0,d=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var g=a.toLowerCase().indexOf(o);if(-1<g)d=g;else for(var p=0;p<t.length;p++){var f=a.indexOf(o[p],h+1),m=a.indexOf(i[p],h+1);if((l=0<=f&&(m<0||f<m)?f:m)<0)continue e;0<(c=l-h-1)&&(-1===h&&(d+=10),d+=c,u|=1<<p),h=l}}r.matchMask=u,r.exactMatch=d?0:1,r.$score=(r.score||0)-d,n.push(r)}}return n}}).call(h.prototype),t.Autocomplete=c,t.FilteredList=h}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(e,t){function n(e,t){return e.getTextRange(i.fromPoints({row:0,column:0},t)).split(l).length-1}function s(e,t){var o=n(e,t),r=e.getValue().split(l),s=Object.create(null),a=r[o];return r.forEach(function(e,t){if(e&&e!==a){var n=Math.abs(o-t),i=r.length-n;s[e]?s[e]=Math.max(i,s[e]):s[e]=i}}),s}var i=e("../range").Range,l=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;t.getCompletions=function(e,t,n,i,o){var r=s(t,n);o(null,Object.keys(r).map(function(e){return{caption:e,value:e,score:r[e],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(e,t){"use strict";var c=e("../snippets").snippetManager,o=e("../autocomplete").Autocomplete,n=e("../config"),i=e("../lib/lang"),r=e("../autocomplete/util"),s=e("../autocomplete/text_completer"),a={getCompletions:function(e,t,n,i,o){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,i,o);var r=e.session.getState(n.row);o(null,t.$mode.getCompletions(r,t,n,i))}},l={getCompletions:function(e,t,n,i,o){var r=[],s=t.getTokenAt(n.row,n.column);s&&s.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?r.push("html-tag"):r=c.getActiveScopes(e);var a=c.snippetMap,l=[];r.forEach(function(e){for(var t=a[e]||[],n=t.length;n--;){var i=t[n],o=i.name||i.tabTrigger;o&&l.push({caption:o,snippet:i.content,meta:i.tabTrigger&&!i.name?i.tabTrigger+"\u21e5 ":"snippet",type:"snippet"})}},this),o(null,l)},getDocTooltip:function(e){"snippet"==e.type&&!e.docHTML&&(e.docHTML=["<b>",i.escapeHTML(e.caption),"</b>","<hr></hr>",i.escapeHTML(e.snippet)].join(""))}},h=[l,s,a];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=s,t.keyWordCompleter=a,t.snippetCompleter=l;var u={name:"expandSnippet",exec:function(e){return c.expandWithTab(e)},bindKey:"Tab"},d=function(e,t){g(t.session.$mode)},g=function(e){var t=e.$id;c.files||(c.files={}),p(t),e.modes&&e.modes.forEach(g)},p=function(t){if(t&&!c.files[t]){var e=t.replace("mode","snippets");c.files[t]={},n.loadModule(e,function(e){e&&(!(c.files[t]=e).snippets&&e.snippetText&&(e.snippets=c.parseSnippetFile(e.snippetText)),c.register(e.snippets||[],e.scope),e.includeScopes&&(c.snippetMap[e.scope].includeScopes=e.includeScopes,e.includeScopes.forEach(function(e){p("ace/mode/"+e)})))})}},f=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if("backspace"===e.command.name)n&&!r.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name){if(r.getCompletionPrefix(t)&&!n){var i=o["for"](t);i.autoInsert=!1,i.showPopup(t)}}},m=e("../editor").Editor;e("../config").defineOptions(m.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(o.startCommand)):this.commands.removeCommand(o.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",f)):this.commands.removeListener("afterExec",f)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(u),this.on("changeMode",d),d(null,this)):(this.commands.removeCommand(u),this.off("changeMode",d))},value:!1}})}),ace.require(["ace/ext/language_tools"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,o){function t(e){var t=e.editor;if(e.getAccelKey()){t=e.editor;var n=e.getDocumentPosition(),i=t.session.getTokenAt(n.row,n.column);o.previousLinkingHover&&o.previousLinkingHover!=i&&t._emit("linkHoverOut"),t._emit("linkHover",{position:n,token:i}),o.previousLinkingHover=i}else o.previousLinkingHover&&(t._emit("linkHoverOut"),o.previousLinkingHover=!1)}function n(e){var t=e.getAccelKey();if(0==e.getButton()&&t){var n=e.editor,i=e.getDocumentPosition(),o=n.session.getTokenAt(i.row,i.column);n._emit("linkClick",{position:i,token:o})}}var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",n),this.on("mousemove",t)):(this.off("click",n),this.off("mousemove",t))},value:!1}}),o.previousLinkingHover=!1}),ace.require(["ace/ext/linking"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e){"use strict";function t(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&0===n.column&&(t.session.$bidiHandler.isMoveLeftOperation&&0<n.row?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function n(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function i(e,t){var n=t.session;if(n.$bidiHandler.currentRow=null,n.$bidiHandler.isRtlLine(e.start.row)&&"insert"===e.action&&1<e.lines.length)for(var i=e.start.row;i<e.end.row;i++)n.getLine(i+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[i+1]=n.$bidiHandler.RLE+n.getLine(i+1))}function o(e,t){var n=t.session.$bidiHandler,i=t.$textLayer.$lines.cells,o=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;n&&n.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=o):(t.direction="",t.textAlign="",t.width="")})}function r(e){function t(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var n=e.$textLayer.$lines;n.cells.forEach(t),n.cellCache.forEach(t)}var s=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],a=e("../editor").Editor;e("../config").defineOptions(a.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",i),this.on("changeSelection",t),this.renderer.on("afterRender",o),this.commands.on("exec",n),this.commands.addCommands(s)):(this.off("change",i),this.off("changeSelection",t),this.renderer.off("afterRender",o),this.commands.off("exec",n),this.commands.removeCommands(s),r(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){(this.session.$bidiHandler.$isRtl=e)?(this.setOption("rtlText",!1),this.renderer.on("afterRender",o),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",o),r(this.renderer)),this.renderer.updateFull()}}})}),ace.require(["ace/ext/rtl"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t){"use strict";var o=e("../lib/dom"),n=e("../lib/lang"),s=e("../lib/event"),i='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',r=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys"),l=999;o.importCssString(i,"ace_searchbox");var c=function(e){var t=o.createElement("div");o.buildDom(["div",{"class":"ace_search right"},["span",{action:"hide","class":"ace_searchbtn_close"}],["div",{"class":"ace_search_form"},["input",{"class":"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev","class":"ace_searchbtn prev"},"\u200b"],["span",{action:"findNext","class":"ace_searchbtn next"},"\u200b"],["span",{action:"findAll","class":"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{"class":"ace_replace_form"},["input",{"class":"ace_search_field",
21
21
  placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext","class":"ace_searchbtn"},"Replace"],["span",{action:"replaceAll","class":"ace_searchbtn"},"All"]],["div",{"class":"ace_search_options"},["span",{action:"toggleReplace","class":"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{"class":"ace_search_counter"}],["span",{action:"toggleRegexpMode","class":"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive","class":"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords","class":"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection","class":"ace_button",title:"Search In Selection"},"S"]]],t),this.element=t.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),o.importCssString(i,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var r=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){r.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var t=(e.target||e.srcElement).getAttribute("action");t&&r[t]?r[t]():r.$searchBarKb.commands[t]&&r.$searchBarKb.commands[t].exec(r),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,t,n){var i=a.keyCodeToString(n),o=r.$searchBarKb.findKeyCommand(t,i);o&&o.exec&&(o.exec(r),s.stopEvent(e))}),this.$onChange=n.delayedCall(function(){r.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){r.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){r.activeInput=r.searchInput,r.searchInput.value&&r.highlight()}),s.addListener(this.replaceInput,"focus",function(){r.activeInput=r.replaceInput,r.searchInput.value&&r.highlight()})},this.$closeSearchBarKb=new r([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new r,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){(this.searchRange=e)?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){o.setCssClass(this.replaceOption,"checked",this.searchRange),o.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",o.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),o.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),o.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;o.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,i=0;if(t){var o=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),r=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(r-=e.session.doc.positionToIndex(this.searchRange.start));for(var s,a=t.lastIndex=0;(s=t.exec(o))&&(n++,(a=s.index)<=r&&i++,!(l<n))&&(s[0]||(t.lastIndex=a+=1,!(a>=o.length))););}this.searchCounter.textContent=i+" of "+(l<n?l+"+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;o.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(c.prototype),t.SearchBox=c,t.Search=function(e,t){(e.searchBox||new c(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";e("../../lib/dom").importCssString(i),n.exports.overlayPage=function(e,t,n){function i(e){27===e.keyCode&&o()}function o(){r&&(document.removeEventListener("keydown",i),r.parentNode.removeChild(r),e.focus(),r=null,n&&n())}var r=document.createElement("div");return r.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",r.addEventListener("click",function(){o()}),document.addEventListener("keydown",i),t.addEventListener("click",function(e){e.stopPropagation()}),r.appendChild(t),document.body.appendChild(r),e.blur(),{close:o}}}),ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){for(var t=l.text,n=e.split(/[\/\\]/).pop(),i=0;i<o.length;i++)if(o[i].supportsFile(n)){t=o[i];break}return t}var o=[],r=function(e,t,n){var i;this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n,i=/\^/.test(n)?n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":"^.*\\.("+n+")$",this.extRe=new RegExp(i,"gi")};r.prototype.supportsFile=function(e){return e.match(this.extRe)};var s={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Crystal:["cr"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nix:["nix"],Nim:["nim"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Puppet:["epp|pp"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},a={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},l={};for(var c in s){var h=s[c],u=(a[c]||c).replace(/_/g," "),d=c.toLowerCase(),g=new r(d,u,h[0]);l[d]=g,o.push(g)}n.exports={getModeForPath:i,modes:o,modesByName:l}}),ace.define("ace/ext/themelist",["require","exports","module"],function(e,i){"use strict";var t=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];i.themesByName={},i.themes=t.map(function(e){var t=e[1]||e[0].replace(/ /g,"_").toLowerCase(),n={caption:e[0],theme:"ace/theme/"+t,isDark:"dark"==e[2],name:t};return i.themesByName[t]=n})}),ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"],function(e,t){"use strict";e("./menu_tools/overlay_page").overlayPage;var n=e("../lib/dom"),i=e("../lib/oop"),o=e("../config"),r=e("../lib/event_emitter").EventEmitter,s=n.buildDom,a=e("./modelist"),l=e("./themelist"),c={Bright:[],Dark:[]};l.themes.forEach(function(e){c[e.isDark?"Dark":"Bright"].push({caption:e.caption,value:e.theme})});var h={Main:{Mode:{path:"mode",type:"select",items:a.modes.map(function(e){return{caption:e.caption,value:e.mode}})},Theme:{path:"theme",type:"select",items:c},Keybinding:{type:"buttonBar",path:"keyboardHandler",items:[{caption:"Ace",value:null},{caption:"Vim",value:"ace/keyboard/vim"},{caption:"Emacs",value:"ace/keyboard/emacs"},{caption:"Sublime",value:"ace/keyboard/sublime"}]},"Font Size":{path:"fontSize",type:"number",defaultValue:12,defaults:[{caption:"12px",value:12},{caption:"24px",value:24}]},"Soft Wrap":{type:"buttonBar",path:"wrap",items:[{caption:"Off",value:"off"},{caption:"View",value:"free"},{caption:"margin",value:"printMargin"},{caption:"40",value:"40"}]},"Cursor Style":{path:"cursorStyle",items:[{caption:"Ace",value:"ace"},{caption:"Slim",value:"slim"},{caption:"Smooth",value:"smooth"},{caption:"Smooth And Slim",value:"smooth slim"},{caption:"Wide",value:"wide"}]},Folding:{path:"foldStyle",items:[{caption:"Manual",value:"manual"},{caption:"Mark begin",value:"markbegin"},{caption:"Mark begin and end",value:"markbeginend"}]},"Soft Tabs":[{path:"useSoftTabs"},{path:"tabSize",type:"number",values:[2,3,4,8,16]}],Overscroll:{type:"buttonBar",path:"scrollPastEnd",items:[{caption:"None",value:0},{caption:"Half",value:.5},{caption:"Full",value:1}]}},More:{"Atomic soft tabs":{path:"navigateWithinSoftTabs"},"Enable Behaviours":{path:"behavioursEnabled"},"Full Line Selection":{type:"checkbox",values:"text|line",path:"selectionStyle"},"Highlight Active Line":{path:"highlightActiveLine"},"Show Invisibles":{path:"showInvisibles"},"Show Indent Guides":{path:"displayIndentGuides"},"Persistent Scrollbar":[{path:"hScrollBarAlwaysVisible"},{path:"vScrollBarAlwaysVisible"}],"Animate scrolling":{path:"animatedScroll"},"Show Gutter":{path:"showGutter"},"Show Line Numbers":{path:"showLineNumbers"},"Relative Line Numbers":{path:"relativeLineNumbers"},"Fixed Gutter Width":{path:"fixedWidthGutter"},"Show Print Margin":[{path:"showPrintMargin"},{type:"number",path:"printMarginColumn"}],"Indented Soft Wrap":{path:"indentedSoftWrap"},"Highlight selected word":{path:"highlightSelectedWord"},"Fade Fold Widgets":{path:"fadeFoldWidgets"},"Use textarea for IME":{path:"useTextareaForIME"},"Merge Undo Deltas":{path:"mergeUndoDeltas",items:[{caption:"Always",value:"always"},{caption:"Never",value:"false"},{caption:"Timed",value:"true"}]},"Elastic Tabstops":{path:"useElasticTabstops"},"Incremental Search":{path:"useIncrementalSearch"},"Read-only":{path:"readOnly"},"Copy without selection":{path:"copyWithEmptySelection"},"Live Autocompletion":{path:"enableLiveAutocompletion"}}},u=function(e,t){this.editor=e,this.container=t||document.createElement("div"),this.groups=[],this.options={}};(function(){i.implement(this,r),this.add=function(e){e.Main&&i.mixin(h.Main,e.Main),e.More&&i.mixin(h.More,e.More)},this.render=function(){this.container.innerHTML="",s(["table",{id:"controls"},this.renderOptionGroup(h.Main),["tr",null,["td",{colspan:2},["table",{id:"more-controls"},this.renderOptionGroup(h.More)]]],["tr",null,["td",{colspan:2},"version "+o.version]]],this.container)},this.renderOptionGroup=function(i){return Object.keys(i).map(function(e,t){var n=i[e];return n.position||(n.position=t/1e4),n.label||(n.label=e),n}).sort(function(e,t){return e.position-t.position}).map(function(e){return this.renderOption(e.label,e)},this)},this.renderOptionControl=function(t,i){var o=this;if(Array.isArray(i))return i.map(function(e){return o.renderOptionControl(t,e)});var e,r=o.getOption(i);if(i.values&&"checkbox"!=i.type&&("string"==typeof i.values&&(i.values=i.values.split("|")),i.items=i.values.map(function(e){return{value:e,name:e}})),"buttonBar"==i.type)e=["div",i.items.map(function(n){return["button",{value:n.value,ace_selected_button:r==n.value,onclick:function(){o.setOption(i,n.value);for(var e=this.parentNode.querySelectorAll("[ace_selected_button]"),t=0;t<e.length;t++)e[t].removeAttribute("ace_selected_button");this.setAttribute("ace_selected_button",!0)}},n.desc||n.caption||n.name]})];else if("number"==i.type)e=["input",{type:"number",value:r||i.defaultValue,style:"width:3em",oninput:function(){o.setOption(i,parseInt(this.value))}}],i.defaults&&(e=[e,i.defaults.map(function(t){return["button",{onclick:function(){var e=this.parentNode.firstChild;e.value=t.value,e.oninput()}},t.caption]})]);else if(i.items){var n=function(e){return e.map(function(e){return["option",{value:e.value||e.name},e.desc||e.caption||e.name]})},s=Array.isArray(i.items)?n(i.items):Object.keys(i.items).map(function(e){return["optgroup",{label:e},n(i.items[e])]});e=["select",{id:t,value:r,onchange:function(){o.setOption(i,this.value)}},s]}else"string"==typeof i.values&&(i.values=i.values.split("|")),i.values&&(r=r==i.values[1]),e=["input",{type:"checkbox",id:t,checked:r||null,onchange:function(){var e=this.checked;i.values&&(e=i.values[e?1:0]),o.setOption(i,e)}}],"checkedNumber"==i.type&&(e=[e,[]]);return e},this.renderOption=function(e,t){if(!t.path||t.onchange||this.editor.$options[t.path]){var n="-"+(this.options[t.path]=t).path;return["tr",{"class":"ace_optionsMenuEntry"},["td",["label",{"for":n},e]],["td",this.renderOptionControl(n,t)]]}},this.setOption=function(e,t){"string"==typeof e&&(e=this.options[e]),"false"==t&&(t=!1),"true"==t&&(t=!0),"null"==t&&(t=null),"undefined"==t&&(t=undefined),"string"==typeof t&&parseFloat(t).toString()==t&&(t=parseFloat(t)),e.onchange?e.onchange(t):e.path&&this.editor.setOption(e.path,t),this._signal("setOption",{name:e.path,value:t})},this.getOption=function(e){return e.getValue?e.getValue():this.editor.getOption(e.path)}}).call(u.prototype),t.OptionPanel=u}),ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/options","ace/ext/menu_tools/overlay_page","ace/editor"],function(e,t,n){"use strict";function i(e){if(!document.getElementById("ace_settingsmenu")){var t=new o(e);t.render(),t.container.id="ace_settingsmenu",r(e,t.container),t.container.querySelector("select,input,button,checkbox").focus()}}var o=e("./options").OptionPanel,r=e("./menu_tools/overlay_page").overlayPage;n.exports.init=function(){e("../editor").Editor.prototype.showSettingsMenu=function(){i(this)}}}),ace.require(["ace/ext/settings_menu"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t){"use strict";var h=e("../lib/event");t.contextMenuHandler=function(e){var n=e.target,i=n.textInput.getElement();if(n.selection.isEmpty()){var t=n.getCursorPosition(),o=n.session.getWordRange(t.row,t.column),r=n.session.getTextRange(o);if(n.session.tokenRe.lastIndex=0,n.session.tokenRe.test(r)){var s="\x01\x01",a=r+" "+s;i.value=a,i.setSelectionRange(r.length,r.length+1),i.setSelectionRange(0,0),i.setSelectionRange(0,r.length);var l=!1;h.addListener(i,"keydown",function c(){h.removeListener(i,"keydown",c),l=!0}),n.textInput.setInputHandler(function(e){if(console.log(e,a,i.selectionStart,i.selectionEnd),e==a)return"";if(0===e.lastIndexOf(a,0))return e.slice(a.length);if(e.substr(i.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==s){var t=e.slice(0,-2);if(" "==t.slice(-1))return l?t.substring(0,i.selectionEnd):(t=t.slice(0,-1),n.session.replace(o,t),"")}return e})}}};var n=e("../editor").Editor;e("../config").defineOptions(n.prototype,"editor",{spellcheck:{set:function(e){this.textInput.getElement().spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}),ace.require(["ace/ext/spellcheck"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t){"use strict";var n=e("./lib/oop"),i=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),o=e("./editor").Editor,r=e("./virtual_renderer").VirtualRenderer,s=e("./edit_session").EditSession,a=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){n.implement(this,i),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new r(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<e;)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<e;)this.$createEditor(),this.$splits++}else for(;this.$splits>e;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(t){this.$editors.forEach(function(e){e.setTheme(t)})},this.setKeyboardHandler=function(t){this.$editors.forEach(function(e){e.setKeyboardHandler(t)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(t){this.$fontSize=t,this.forEach(function(e){e.setFontSize(t)})},this.$cloneSession=function(e){var t=new s(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(t,e){var n;return n=null==e?this.$cEditor:this.$editors[e],this.$editors.some(function(e){return e.session===t})&&(t=this.$cloneSession(t)),n.setSession(t),t},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,n=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var i=t/this.$splits,o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=i+"px",e.container.style.top="0px",e.container.style.left=o*i+"px",e.container.style.height=n+"px",e.resize();else{var r=n/this.$splits;for(o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=t+"px",e.container.style.top=o*r+"px",e.container.style.left="0px",e.container.style.height=r+"px",e.resize()}}}).call(a.prototype),t.Split=a}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}),ace.require(["ace/ext/split"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";function i(e){this.type=e,this.style={},this.textContent=""}var g=e("../edit_session").EditSession,o=e("../layer/text").Text,p=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;contain: none;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",u=e("../config"),d=e("../lib/dom"),r=e("../lib/lang").escapeHTML;i.prototype.cloneNode=function(){return this},i.prototype.appendChild=function(e){this.textContent+=e.toString()},i.prototype.toString=function(){var e=[];if("fragment"!=this.type){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),"fragment"!=this.type&&e.push("</",this.type,">"),e.join("")};var f={createTextNode:function(e){return r(e)},createElement:function(e){return new i(e)},createFragment:function(){return new i("fragment")}},m=function(){this.config={},this.dom=f};m.prototype=o.prototype;var v=function(s,e,a){var t=s.className.match(/lang-(\w+)/),n=e.mode||t&&"ace/mode/"+t[1];if(!n)return!1;var i=e.theme||"ace/theme/textmate",o="",l=[];if(s.firstElementChild)for(var r=0,c=0;c<s.childNodes.length;c++){var h=s.childNodes[c];3==h.nodeType?(r+=h.data.length,o+=h.data):l.push(r,h)}else o=s.textContent,e.trim&&(o=o.trim());v.render(o,n,i,e.firstLineNumber,!e.showGutter,function(e){d.importCssString(e.css,"ace_highlight"),s.innerHTML=e.html;for(var t=s.firstChild.firstChild,n=0;n<l.length;n+=2){var i=e.session.doc.indexToPosition(l[n]),o=l[n+1],r=t.children[i.row];r&&r.appendChild(o)}a&&a()})};v.render=function(t,n,i,o,r,s){function a(){var e=v.renderSync(t,n,i,o,r);return s?s(e):e}var l,c=1,h=g.prototype.$modes;return"string"==typeof i&&(c++,u.loadModule(["theme",i],function(e){i=e,--c||a()})),n&&"object"==typeof n&&!n.getTokenizer&&(n=(l=n).path),"string"==typeof n&&(c++,u.loadModule(["mode",n],function(e){h[n]&&!l||(h[n]=new e.Mode(l)),n=h[n],--c||a()})),--c||a()},v.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var r=new g("");r.setUseWorker(!1),r.setMode(t);var s=new m;s.setSession(r),Object.keys(s.$tabStrings).forEach(function(e){if("string"==typeof s.$tabStrings[e]){var t=f.createFragment();t.textContent=s.$tabStrings[e],s.$tabStrings[e]=t}}),r.setValue(e);var a=r.getLength(),l=f.createElement("div");l.className=n.cssClass;var c=f.createElement("div");c.className="ace_static_highlight"+(o?"":" ace_show_gutter"),c.style["counter-reset"]="ace_line "+(i-1);for(var h=0;h<a;h++){var u=f.createElement("div");if(u.className="ace_line",!o){var d=f.createElement("span");d.className="ace_gutter ace_gutter-cell",d.textContent="",u.appendChild(d)}s.$renderLine(u,h,!1),u.textContent+="\n",c.appendChild(u)}return l.appendChild(c),{css:p+n.cssText,html:l.toString(),session:r}},n.exports=v,n.exports.highlight=v}),ace.require(["ace/ext/static_highlight"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t){"use strict";var i=e("../lib/dom"),o=e("../lib/lang"),n=function(e,t){this.element=i.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=o.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function t(e,t){e&&n.push(e,t||"|")}var n=[];t(e.keyBinding.getStatusText(e)),e.commands.recording&&t("REC");var i=e.selection,o=i.lead;if(!i.isEmpty()){var r=e.getSelectionRange();t("("+(r.end.row-r.start.row)+":"+(r.end.column-r.start.column)+")"," ")}t(o.row+":"+o.column," "),i.rangeCount&&t("["+i.rangeCount+"]"," "),n.pop(),this.element.textContent=n.join("")}}).call(n.prototype),t.StatusBar=n}),ace.require(["ace/ext/statusbar"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";t.isDark=!1,t.cssClass="ace-tm",
22
- t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"],function(e,f,t){"use strict";function u(e,t){for(var n in t)e.style[n]=t[n]}function d(i,t){if("textarea"!=i.type)throw new Error("Textarea required!");var e=i.parentNode,o=document.createElement("div"),n=function(){var t="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(e){t+=e+":"+s(i,o,e)+";"});var e=s(i,o,"width")||i.clientWidth+"px",n=s(i,o,"height")||i.clientHeight+"px";t+="height:"+n+";width:"+e+";",t+="display:inline-block;",o.setAttribute("style",t)};for(m.addListener(window,"resize",n),n(),e.insertBefore(o,i.nextSibling);e!==document;){if("FORM"===e.tagName.toUpperCase()){var r=e.onsubmit;e.onsubmit=function(e){i.value=t(),r&&r.call(this,e)};break}e=e.parentNode}return o}function g(n,e,i,t,o){function r(e){return"true"===e||1==e}n.getSession(),n.renderer;return n.setDisplaySettings=function(e){null==e&&(e="none"==i.style.display),e?(i.style.display="block",i.hideButton.focus(),n.on("focus",function t(){n.removeListener("focus",t),i.style.display="none"})):n.focus()},n.$setOption=n.setOption,n.$getOption=n.getOption,n.setOption=function(e,t){switch(e){case"mode":n.$setOption("mode","ace/mode/"+t);break;case"theme":n.$setOption("theme","ace/theme/"+t);break;case"keybindings":switch(t){case"vim":n.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":n.setKeyboardHandler("ace/keyboard/emacs");break;default:n.setKeyboardHandler(null)}break;case"wrap":case"fontSize":n.$setOption(e,t);break;default:n.$setOption(e,r(t))}},n.getOption=function(e){switch(e){case"mode":return n.$getOption("mode").substr("ace/mode/".length);case"theme":return n.$getOption("theme").substr("ace/theme/".length);case"keybindings":var t=n.getKeyboardHandler();switch(t&&t.$id){case"ace/keyboard/vim":return"vim";case"ace/keyboard/emacs":return"emacs";default:return"ace"}break;default:return n.$getOption(e)}},n.setOptions(o),n}function p(e,t,n){function i(e,t,n,i){if(n){for(var o in e.push("<select title='"+t+"'>"),n)e.push("<option value='"+o+"' "),i==o&&e.push(" selected "),e.push(">",n[o],"</option>");e.push("</select>")}else e.push("<input type='checkbox' title='",t,"' ",i+""=="true"?"checked='true'":"","'></input>")}var o=null,r={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},s={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:o,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:o,useSoftTabs:o,showInvisibles:o},a=[];for(var l in a.push("<table><tr><th>Setting</th><th>Value</th></tr>"),f.defaultOptions)a.push("<tr><td>",r[l],"</td>"),a.push("<td>"),i(a,l,s[l],n.getOption(l)),a.push("</td></tr>");a.push("</table>"),e.innerHTML=a.join("");for(var c=function(e){var t=e.currentTarget;n.setOption(t.title,t.value)},h=function(e){var t=e.currentTarget;n.setOption(t.title,t.checked)},u=e.getElementsByTagName("select"),d=0;d<u.length;d++)u[d].onchange=c;var g=e.getElementsByTagName("input");for(d=0;d<g.length;d++)g[d].onclick=h;var p=document.createElement("input");p.type="button",p.value="Hide",m.addListener(p,"click",function(){n.setDisplaySettings(!1)}),e.appendChild(p),e.hideButton=p}var m=e("../lib/event"),v=e("../lib/useragent"),b=(e("../lib/net"),e("../ace"));e("../theme/textmate"),t.exports=f=b;var s=function(e,t,n){var i=e.style[n];return i||(i=window.getComputedStyle?window.getComputedStyle(e,"").getPropertyValue(n):e.currentStyle[n]),i&&"auto"!=i&&"intrinsic"!=i||(i=t.style[n]),i};f.transformTextarea=function(e,t){var n,i=e.autofocus||document.activeElement==e,o=d(e,function(){return n.getValue()});e.style.display="none",o.style.background="white";var r=document.createElement("div");u(r,{top:"0px",left:"0px",right:"0px",bottom:"0px",border:"1px solid gray",position:"absolute"}),o.appendChild(r);var s=document.createElement("div");u(s,{position:"absolute",right:"0px",bottom:"0px",cursor:"nw-resize",border:"solid 9px",borderColor:"lightblue gray gray #ceade6",zIndex:101});var a=document.createElement("div"),l={top:"0px",left:"20%",right:"0px",bottom:"0px",position:"absolute",padding:"5px",zIndex:100,color:"white",display:"none",overflow:"auto",fontSize:"14px",boxShadow:"-5px 2px 3px gray"};v.isOldIE?l.backgroundColor="#333":l.backgroundColor="rgba(0, 0, 0, 0.6)",u(a,l),o.appendChild(a),t=t||f.defaultOptions;var c=b.edit(r);(n=c.getSession()).setValue(e.value||e.innerHTML),i&&c.focus(),o.appendChild(s),g(c,r,a,b,t),p(a,s,c);var h="";return m.addListener(s,"mousemove",function(e){var t=this.getBoundingClientRect();e.clientX-t.left+(e.clientY-t.top)<(t.width+t.height)/2?(this.style.cursor="pointer",h="toggle"):(h="resize",this.style.cursor="nw-resize")}),m.addListener(s,"mousedown",function(e){if(e.preventDefault(),"toggle"!=h){o.style.zIndex=1e5;var t=o.getBoundingClientRect(),n=t.width+t.left-e.clientX,i=t.height+t.top-e.clientY;m.capture(s,function(e){o.style.width=e.clientX-t.left+n+"px",o.style.height=e.clientY-t.top+i+"px",c.resize()},function(){})}else c.setDisplaySettings()}),c},f.defaultOptions={mode:"javascript",theme:"textmate",wrap:"off",fontSize:"12px",showGutter:"false",keybindings:"ace",showPrintMargin:"false",useSoftTabs:"true",showInvisibles:"false"}}),ace.require(["ace/ext/textarea"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/themelist",["require","exports","module"],function(e,i){"use strict";var t=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];i.themesByName={},i.themes=t.map(function(e){var t=e[1]||e[0].replace(/ /g,"_").toLowerCase(),n={caption:e[0],theme:"ace/theme/"+t,isDark:"dark"==e[2],name:t};return i.themesByName[t]=n})}),ace.require(["ace/ext/themelist"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,i){"use strict";var v=e("../lib/lang");i.$detectIndentation=function(e){function t(e){for(var t=0,n=e;n<i.length;n+=e)t+=i[n]||0;return t}for(var i=[],n=[],o=0,r=0,s=Math.min(e.length,1e3),a=0;a<s;a++){var l=e[a];if(/^\s*[^*+\-\s]/.test(l)){if("\t"==l[0])o++,r=-Number.MAX_VALUE;else{var c=l.match(/^ */)[0].length;if(c&&"\t"!=l[c]){var h=c-r;0<h&&!(r%h)&&!(c%h)&&(n[h]=(n[h]||0)+1),i[c]=(i[c]||0)+1}r=c}for(;a<s&&"\\"==l[l.length-1];)l=e[a++]}}var u=n.reduce(function(e,t){return e+t},0),d={score:0,length:0},g=0;for(a=1;a<12;a++){var p=t(a);1==a?(g=p,p=i[1]?.9:.8,i.length||(p=0)):p/=g,n[a]&&(p+=n[a]/u),p>d.score&&(d={score:p,length:a})}if(d.score&&1.4<d.score)var f=d.length;return g+1<o?((1==f||g<o/4||d.score<1.8)&&(f=undefined),{ch:"\t",length:f}):o+1<g?{ch:" ",length:f}:void 0},i.detectIndentation=function(e){var t=e.getLines(0,1e3),n=i.$detectIndentation(t)||{};return n.ch&&e.setUseSoftTabs(" "==n.ch),n.length&&e.setTabSize(n.length),n},i.trimTrailingSpace=function(e,t){var n=e.getDocument(),i=n.getAllLines(),o=t&&t.trimEmpty?-1:0,r=[],s=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var i=n[t+1];i&&i.cursor.row==e.cursor.row||r.push(e.cursor)}):r.push(e.selection.getCursor()),s=0);for(var a=r[s]&&r[s].row,l=0,c=i.length;l<c;l++){var h=i[l],u=h.search(/\s+$/);l==a&&(u<r[s].column&&o<u&&(u=r[s].column),a=r[++s]?r[s].row:-1),o<u&&n.removeInLine(l,u,h.length)}},i.convertIndentation=function(e,t,n){var i=e.getTabString()[0],o=e.getTabSize();n||(n=o),t||(t=i);for(var r="\t"==t?t:v.stringRepeat(t,n),s=e.doc,a=s.getAllLines(),l={},c={},h=0,u=a.length;h<u;h++){var d=a[h].match(/^\s*/)[0];if(d){var g=e.$getStringScreenWidth(d)[0],p=Math.floor(g/o),f=g%o,m=l[p]||(l[p]=v.stringRepeat(r,p));(m+=c[f]||(c[f]=v.stringRepeat(" ",f)))!=d&&(s.removeInLine(h,0,d.length),s.insertInLine({row:h,column:0},m))}}e.setTabSize(n),e.setUseSoftTabs(" "==t)},i.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch="\t":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},i.$parseArg=function(e){return e?"string"==typeof e?i.$parseStringArg(e):"string"==typeof e.text?i.$parseStringArg(e.text):e:{}},i.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){i.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,t){i.trimTrailingSpace(e.session,t)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,t){var n=i.$parseArg(t);i.convertIndentation(e.session,n.ch,n.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,t){var n=i.$parseArg(t);n.length&&e.session.setTabSize(n.length),n.ch&&e.session.setUseSoftTabs(" "==n.ch)}}]}),ace.require(["ace/ext/whitespace"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});var GollumTagStart={token:"support.function",regex:"\\[\\[[^\\]]*\\]\\]",next:"start"},UMLBlock=[{token:"support.function",regex:"^\\@enduml$",next:"start"},{defaultToken:"support.function"}],UMLStart={token:"support.function",regex:"^(?:[ \\t]*)\\@startuml$",next:"umlblock"},GithubCodeBlock=[{token:"support.function",regex:".*",onMatch:function(e,t,n){var i=n[2][0],o=n[2][1],r=/^( {0,3})(~~[~]+|```)\s*$/.exec(e);return r&&r[2].length>=i&&r[2].charAt(0)==o?(n.splice(0,3),this.next=n.shift()):this.next="",this.token}},{defaultToken:"support.function"}],startCodeBlockMatch=function(e,t,n){var i=new RegExp(this.regex).exec(e);return n.unshift("githubblock",[],[i[2].length,i[2].charAt(0)],t),this.token},GollumCodeStart={token:"support.function",regex:"^( {0,3})(```)[^`]*$",onMatch:startCodeBlockMatch,next:"githubblock"},MarkdownCodeStart={token:"support.function",regex:"^( {0,3})(~~[~]+)[^`~]*$",onMatch:startCodeBlockMatch,next:"githubblock"};ace.define("GollumRstHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rst_highlight_rules").RSTHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumAsciidocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/asciidoc_highlight_rules").AsciidocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextileHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/textile_highlight_rules").TextileHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/text_highlight_rules").TextHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumRdocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rdoc_highlight_rules").RDocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumMarkdownHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.$rules.start.unshift(MarkdownCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),function(e){var r={asciidoc:{mode:"asciidoc",highlighter:"GollumAsciidocHighlightRules"},creole:{mode:"text",highlighter:"GollumTextHighlightRules"},markdown:{mode:"markdown",highlighter:"GollumMarkdownHighlightRules"},mediawiki:{mode:"text",highlighter:"GollumTextHighlightRules"},bib:{mode:"latex"},org:{mode:"text",highlighter:"GollumTextHighlightRules"},rst:{mode:"rst",highlighter:"GollumRstHighlightRules"},txt:{mode:"text"},pod:{mode:"text",highlighter:"GollumTextHighlightRules"},rdoc:{mode:"rdoc",highlighter:"GollumRdocHighlightRules"},textile:{mode:"textile",highlighter:"GollumTextileHighlightRules"}};e.getEditorMode=function(e){var t=null;if(t=r[e]){var n=t.mode,i=t.highlighter;if(i){var o=new(ace.require("ace/mode/"+n).Mode);return o.HighlightRules=ace.require(i).GollumHighlightRules,o}return"ace/mode/"+n}return null}}(jQuery),function(v){function r(e){return new RegExp("^[^"+"A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufdfe-\ufe6f\ufefd-\uffff"+"]*["+"\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc"+"]").test(e)}function s(e){window.ace_editor.session.$bidiHandler.$isRtl=e,window.ace_editor.session.$bidiHandler.updateBidiMap(),window.ace_editor.renderer.updateFull()}function a(){e&&clearTimeout(e),v("#gollum-saved-msg").text("Saving..."),e=setTimeout(function(){localStorage.setItem(h,window.ace_editor.getSession().getValue()),v("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").each(function(e,t){var n=h+t.id.replace("gollum-editor-","_");localStorage.setItem(n,t.value)}),v("#gollum-saved-msg").text("Saved recovery text")},2e3)}var l={MarkupType:"markdown",EditorMode:"code",NewFile:!1,HasFunctionBar:!0,Debug:!1,NoDefinitionsFor:[]},c={},e=null,h="gollum_autorecover_"+window.location;v.GollumEditor=function(e){if(c=v.extend(l,e),v('textarea[id="gollum-editor-body"]').each(function(){var e=v(this),t=e.attr("data-markup-lang")?e.attr("data-markup-lang"):"markdown",n=v("<div>",{position:"absolute",height:e.height(),"class":e.attr("class"),id:"gollum-editor-body-ace"}).insertAfter(e);e.css("display","none");var i=ace.edit(n[0],{rtlText:!0});window.ace_editor=i;var o=localStorage.getItem(h);o&&(v("#gollum-autorecover-button").click(function(e){i.getSession().setValue(o),["header","footer","sidebar"].forEach(function(e){var t=localStorage.getItem(h+"_"+e);t&&v("#gollum-editor-"+e).val(t)}),v("#gollum-autorecover-msg")[0].hidden=!0,e.preventDefault()}),v("#gollum-autorecover-msg")[0].hidden=!1),i.setTheme("ace/theme/tomorrow"),i.setKeyboardHandler(),i.renderer.setShowGutter(!1),i.getSession().setUseWrapMode(!0),i.getSession().setValue(e.val()),i.getSession().setMode(v.getEditorMode(t)),i.getSession().on("change",function(){e.val(i.getSession().getValue()),a()}),v("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").on("change keyup paste",a),r(i.getSession().getLine(0))&&s(!0),i.commands.addCommand({name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(t){ace.config.loadModule("ace/ext/keybinding_menu",function(e){e.init(t),t.showKeyboardShortcuts()})}}),c.commands&&v.each(c.commands,function(e,t){i.commands.addCommand(t)})}),v("#gollum-editor-body-ace").resize(function(){window.ace_editor.resize()}),v("#wiki_format").change(function(){var e=v(this).val(),t=window.ace_editor;window.ace_editor.getSession().setMode(v.getEditorMode(e)),g.updateCommitMessage(e),t.focus()}),v("#keybinding").change(function(){var e=v(this).val(),t=window.ace_editor;"default"==e?t.setKeyboardHandler():"vim"==e||"emacs"==e?t.setKeyboardHandler("ace/keyboard/"+e):t.setKeyboardHandler(),t.focus()}),v("#gollum-editor-submit, #gollum-editor-cancel").click(function(){var t="gollum_autorecover_"+window.location;localStorage.removeItem(t),["header","footer","sidebar"].forEach(function(e){localStorage.removeItem(t+"_"+e)})}),b("GollumEditor loading"),d.baseEditorMarkup()){if(d.titleDisplayed()&&v("#gollum-editor-title-field").addClass("active"),d.editSummaryMarkup()&&(v.GollumEditor.Placeholder.add(v("#gollum-editor-edit-summary input")),v('#gollum-editor form[name="gollum-editor"]').submit(function(e){e.preventDefault(),b("submitting"),v(this).unbind("submit"),v(this).submit()})),d.collapsibleInputs()&&v("#gollum-editor .collapsed button.collapsable, #gollum-editor .expanded button.collapsable").click(function(e){e.preventDefault(),v(this).parent().toggleClass("expanded"),v(this).parent().toggleClass("collapsed"),buttons=v(this).parent().children("button"),hidden_button=buttons.filter(":hidden")[0],shown_button=buttons.not(":hidden")[0],hidden_button.hidden=!1,shown_button.hidden=!0}),d.previewButton())v("#gollum-editor #gollum-editor-preview").click(function(){var e=v("#gollum-editor form").attr("action"),t=v(v("#gollum-editor form").get(0));t.attr("action",this.href||routePath("preview")),t.attr("target","_blank");var n=window.location.pathname.split("/");return t.attr("page",n[n.length-1]||""),t.submit(),t.attr("action",e),t.removeAttr("target"),!1});if(d.functionBar()){var t=v("#gollum-editor-body").attr("data-markup-lang");t&&(c.MarkupType=t),u.setActiveLanguage(c.MarkupType),d.formatSelector()&&g.init(v("#wiki_format")),d.dir()&&v("#function-text-direction").click(function(e){e.preventDefault(),s(!window.ace_editor.session.$bidiHandler.$isRtl)}),d.help()&&(v("#gollum-editor-help").hide(),v("#gollum-editor-help").removeClass("jaws"))}if(c.section&&v.markupSupportsEditableSections(c.MarkupType)){var n=v.findSection(c.section,u.getDefinitionFor("gollum-helpers"));n&&(window.ace_editor.gotoLine(n+1,0,animate=!1),window.ace_editor.scrollToLine(n,center=!1,animate=!1),window.ace_editor.focus())}if(d.dragDropUpload()){var o=v("#gollum-editor-body-ace"),i=v("#gollum-editor-body-ace")[0];i.ondragover=function(){return o.addClass("dragging"),!1},i.ondragleave=function(){return o.removeClass("dragging"),!1},i.ondrop=function(e){b("dropped file"),e.preventDefault(),o.removeClass("dragging").addClass("uploading");var i=e.dataTransfer.files[0],t=new FormData;return t.append("file",i),v.ajax({url:routePath("upload_file"),data:t,cache:!1,contentType:!1,processData:!1,type:"POST",success:function(){o.removeClass("uploading");var e=i.name.split(".").pop().toLowerCase(),t=["jpg","jpeg","tif","tiff","png","gif","svg","bmp"];if(uploadDest=uploadDest.replace(/%20/g," "),-1<t.indexOf(e))var n="[[/"+uploadDest+"/"+i.name+"]]";else n="[["+i.name+"|/"+uploadDest+"/"+i.name+"]]";window.ace_editor.insert(n)},error:function(e,t,n){409==e.status?alert("This file already exists."):alert("Error uploading file: "+t+" "+n),o.removeClass("uploading")}}),!1}}}},v.GollumEditor.defineLanguage=function(e,t){"object"==typeof t?u.define(e,t):b("GollumEditor.defineLanguage: definition for "+e+" is not an object")};var b=function(e){c.Debug&&"undefined"!=typeof console&&console.log(e)},u={_ACTIVE_LANG:"",_LOADED_LANGS:[],_LANG:{},define:function(e,t){if(u._ACTIVE_LANG=e,u._LOADED_LANGS.push(e),"object"==typeof v.GollumEditor.WikiLanguage){var n={};v.extend(n,v.GollumEditor.WikiLanguage,t),u._LANG[e]=n}else u._LANG[e]=t},getActiveLanguage:function(){return u._ACTIVE_LANG},setActiveLanguage:function(e){function t(t){return function(){var e=u.getDefinitionFor(t);"object"==typeof e&&n.executeAction(e)}}null!=u._ACTIVE_LANG&&u._ACTIVE_LANG.length<=0&&g.updateCommitMessage(e),u.getHookFunctionFor("deactivate")&&u.getHookFunctionFor("deactivate")(),u.isLoadedFor(e)?(u._ACTIVE_LANG=e,n.refresh()):(u._ACTIVE_LANG=null,d.functionBar()&&n.refresh(),u.isValid()&&d.formatSelector()&&g.updateSelected()),u.getHookFunctionFor("activate")&&u.getHookFunctionFor("activate")(),window.ace_editor.commands.addCommand({name:"header-1",bindKey:{win:"Ctrl-1",mac:"Command-1"},exec:t("function-h1")}),window.ace_editor.commands.addCommand({name:"header-2",bindKey:{win:"Ctrl-2",mac:"Command-2"},exec:t("function-h2")}),window.ace_editor.commands.addCommand({name:"header-3",bindKey:{win:"Ctrl-3",mac:"Command-3"},exec:t("function-h3")}),window.ace_editor.commands.addCommand({name:"bold-text",bindKey:{win:"Ctrl-b",mac:"Command-b"},exec:t("function-bold")}),window.ace_editor.commands.addCommand({name:"italic-text",bindKey:{win:"Ctrl-i",mac:"Command-i"},exec:t("function-italic")})},getHookFunctionFor:function(e,t){return t||(t=u._ACTIVE_LANG),u.isLoadedFor(t)&&u._LANG[t][e]&&"function"==typeof u._LANG[t][e]?u._LANG[t][e]:null},getDefinitionFor:function(e,t){return t||(t=u._ACTIVE_LANG),u.isLoadedFor(t)&&u._LANG[t][e]&&"object"==typeof u._LANG[t][e]?u._LANG[t][e]:null},isLoadedFor:function(e){if(0===u._LOADED_LANGS.length)return!1;for(var t=0;t<u._LOADED_LANGS.length;t++)if(u._LOADED_LANGS[t]==e)return!0;return!1},isValid:function(){return u._ACTIVE_LANG&&"object"==typeof u._LANG[u._ACTIVE_LANG]}},d={baseEditorMarkup:function(){return v("#gollum-editor").length&&v("#gollum-editor-body").length},collapsibleInputs:function(){return v("#gollum-editor .collapsed, #gollum-editor .expanded").length},formatSelector:function(){return v("#wiki_format").length},functionBar:function(){return c.HasFunctionBar&&v("#gollum-editor-function-bar").length},ff4Environment:function(){return new RegExp(/Firefox\/4.0b/).test(navigator.userAgent)},editSummaryMarkup:function(){return 0<v("input#gollum-editor-message-field").length},help:function(){return v("#gollum-editor #gollum-editor-help").length&&v("#gollum-editor #function-help").length},dir:function(){return v("#gollum-editor #function-text-direction").length},previewButton:function(){return v("#gollum-editor #gollum-editor-preview").length},titleDisplayed:function(){return c.NewFile},dragDropUpload:function(){return v("#gollum-editor.uploads-allowed").length}},n={isActive:!1,activate:function(){b("Activating function bar"),v("#gollum-editor-function-bar button.function-button").each(function(){u.getDefinitionFor(v(this).attr("id"))?(v(this).click(n.evtFunctionButtonClick),v(this).attr("disabled",!1)):["function-help","function-text-direction"].includes(v(this).attr("id"))||v(this).attr("disabled",!0)}),v("#gollum-editor-function-bar").addClass("active"),n.isActive=!0},deactivate:function(){v("#gollum-editor-function-bar button.function-button").not("#function-text-direction").unbind("click"),v("#gollum-editor-function-bar").removeClass("active"),n.isActive=!1},evtFunctionButtonClick:function(e){e.preventDefault();var t=u.getDefinitionFor(v(this).attr("id"));"object"==typeof t&&n.executeAction(t)},executeAction:function(e){var t=window.ace_editor,n=t.getValue(),i=!1,o=!1,r=t.getSelectionRange(),s=t.getSelectedText(),a=s.length,l=!1;if(""==s)if(e.whole_line&&1==e.whole_line){l=!0;var c=r.start.row;s=t.session.getLine(c),r=new(ace.require("ace/range").Range)(c,0,c,s.length)}else e.break_line&&1==e.break_line&&(o=i=!0);else e.break_line&&1==e.break_line&&(o=i=!0);var h=s;if(e.exec&&"function"==typeof e.exec)e.exec(n,s,v("#gollum-editor-body"),r);else{var u=/([^\n]+)/gi;if(e.search&&"object"==typeof e.search&&(b("Replacing search Regex"),u=null,u=new RegExp(e.search),b(u)),b('repText is "'+h+'"'),e.replace&&"string"==typeof e.replace){b("Running replacement - using "+e.replace);var d=e.replace;h=(h=(h=escape(h)).replace(u,d)).replace(/\$[\d]/g,""),""===(h=unescape(h))&&(b("Search string is empty"),h=d.replace(/\$[\d]/g,""));var g=undefined;if(0==l){repPosition=d.indexOf("$1"),-1==repPosition&&(repPosition=Math.floor(d.length/2));var p=d.substring(0,repPosition),f=p.split("\n").length-1,m=repPosition;0<f&&(m-=p.lastIndexOf("\n")),g=[f,m+=a]}}e.append&&"string"==typeof e.append&&(h+=e.append),h&&v.GollumEditor.replaceSelection(h,i,o,r,g)}},isShown:function(){return v("#gollum-editor-function-bar").is(":visible")},refresh:function(){d.functionBar()&&(b("Refreshing function bar"),u.isValid()?(n.deactivate(),n.activate(),o&&o.setActiveHelp(u.getActiveLanguage())):(b("Language definition is invalid."),n.isShown()&&n.deactivate(),o.isShown()&&o.hide()))}},g={$_SELECTOR:null,evtChangeFormat:function(){var e=v(this).val();g.updateCommitMessage(e),u.setActiveLanguage(e)},updateCommitMessage:function(e){var t=document.getElementById("gollum-editor-message-field"),n=t.value;/^(?:created|updated)/i.test(n)&&(t.value=n.replace(/\([^\)]*\)$/,"("+e+")"))},init:function(e){b("Initializing format selector"),g.$_SELECTOR&&"object"==typeof g.$_SELECTOR&&g.$_SELECTOR.unbind("change"),g.$_SELECTOR=e,g.updateSelected(),g.$_SELECTOR.change(g.evtChangeFormat)},updateSelected:function(){var e=u.getActiveLanguage();g.$_SELECTOR.val(e)}},o={_ACTIVE_HELP:"",_LOADED_HELP_LANGS:[],_HELP:{},define:function(e,t){o.isValidHelpFormat(t)?(b("help is a valid format"),o._ACTIVE_HELP_LANG=e,o._LOADED_HELP_LANGS.push(e),o._HELP[e]=t,v("#function-help").length&&(v("#function-help").attr("disabled")&&v("#function-help").attr("disabled",!1),v("#function-help").unbind("click"),v("#function-help").click(o.evtHelpButtonClick),o.generateHelpMenuFor(e),v("#gollum-editor-help").length&&void 0!==v("#gollum-editor-help").attr("data-autodisplay")&&"true"===v("#gollum-editor-help").attr("data-autodisplay")&&o.show())):v("#function-help").length&&v("#function-help").attr("disabled",!0)},generateHelpMenuFor:function(e){if(!o._HELP[e])return b("Help is not defined for "+e.toString()),!1;var t=o._HELP[e];v("#gollum-editor-help-parent").html(""),v("#gollum-editor-help-list").html(""),v("#gollum-editor-help-content").html("");for(var n=0;n<t.length&&"object"==typeof t[n];n++){var i=v('<li><a href="#" rel="'+n+'">'+t[n].menuName+"</a></li>");v("#gollum-editor-help-parent").append(i),0===n&&i.children("a").addClass("selected"),i.children("a").click(o.evtParentMenuClick)}o.generateSubMenu(t[0],0),v(v("#gollum-editor-help-list li a").get(0)).click()},generateSubMenu:function(e,t){v("#gollum-editor-help-list").html(""),v("#gollum-editor-help-content").html("");for(var n=0;n<e.content.length&&"object"==typeof e.content[n];n++){var i=v('<li><a href="#" rel="'+t+":"+n+'">'+e.content[n].menuName+"</a></li>");v("#gollum-editor-help-list").append(i),i.children("a").click(o.evtSubMenuClick)}},hide:function(){v.browser.msie?v("#gollum-editor-help").css("display","none"):v("#gollum-editor-help").animate({opacity:0},200,function(){v("#gollum-editor-help").animate({height:"hide"},200)})
23
- },show:function(){v.browser.msie?v("#gollum-editor-help").css("display","block"):v("#gollum-editor-help").animate({height:"show"},200,function(){v("#gollum-editor-help").animate({opacity:1},300)})},showHelpFor:function(e,t){var n=o._HELP[o._ACTIVE_HELP_LANG][e].content[t].data;v("#gollum-editor-help-content").html(n)},isLoadedFor:function(e){for(var t=0;t<o._LOADED_HELP_LANGS.length;t++)if(e==o._LOADED_HELP_LANGS[t])return!0;return!1},isShown:function(){return v("#gollum-editor-help").is(":visible")},isValidHelpFormat:function(e){return"object"==typeof e&&e.length&&"string"==typeof e[0].menuName&&"object"==typeof e[0].content&&e[0].content.length},setActiveHelp:function(e){o.isLoadedFor(e)?(o._ACTIVE_HELP_LANG=e,v("#function-help").length&&(v("#function-help").attr("disabled")&&v("#function-help").attr("disabled",!1),v("#function-help").unbind("click"),v("#function-help").click(o.evtHelpButtonClick),o.generateHelpMenuFor(e))):(v("#function-help").length&&v("#function-help").attr("disabled",!0),o.isShown()&&o.hide())},evtHelpButtonClick:function(e){e.preventDefault(),o.isShown()?(v("#gollum-editor-help").length&&"undefined"!==v("#gollum-editor-help").attr("data-autodisplay")&&"true"===v("#gollum-editor-help").attr("data-autodisplay")&&(v.post("/wiki/help?_method=delete"),v("#gollum-editor-help").attr("data-autodisplay","")),o.hide()):o.show()},evtParentMenuClick:function(e){if(e.preventDefault(),!v(this).hasClass("selected")){var t=v(this).attr("rel"),n=o._HELP[o._ACTIVE_HELP_LANG][t];v("#gollum-editor-help-parent li a").removeClass("selected"),v(this).addClass("selected"),o.generateSubMenu(n,t),v(v("#gollum-editor-help-list li a").get(0)).click()}},evtSubMenuClick:function(e){if(e.preventDefault(),!v(this).hasClass("selected")){var t=v(this).attr("rel").split(":");v("#gollum-editor-help-list li a").removeClass("selected"),v(this).addClass("selected"),o.showHelpFor(t[0],t[1])}}};v.GollumEditor.defineHelp=o.define,v.GollumEditor.Dialog=v.GollumDialog,v.GollumEditor.replaceSelection=function(e,t,n,i,o){var r=window.ace_editor,s=0;if(i==undefined)i=r.selection.getRange();if(1==t){var a=r.session.doc.getLine(i.start.row-1);0<i.start.column?(e="\n\n"+e,s=2):""!=a&&(e="\n"+e,s=1)}if(1==n){var l=r.session.doc.getLine(i.end.row+1);i.end.column<r.session.doc.getLine(i.end.row).length?e+="\n\n":""!=l&&(e+="\n")}r.session.replace(i,e),o!=undefined&&(totalVerticalOffset=o[0]+s+i.start.row,totalHorizontalOffset=o[1]+i.start.column,r.navigateTo(totalVerticalOffset,totalHorizontalOffset)),r.focus()},v.GollumEditor.Placeholder=v.GollumPlaceholder}(jQuery),function(r){r.constructLanguageDefinition=function(t){var n=r.extend(!0,{},r.DefaultLang,t);return Object.keys(t).forEach(function(e){"undefined"==typeof t[e]&&delete n[e]}),n};var n=function(e,t,n){r.GollumEditor.Dialog.init({title:e,fields:t,OK:function(e){r.GollumEditor.replaceSelection(n(e))}})};r.DefaultLang={"function-bold":{search:/([^\n]+)([\n\s]*)/g,replace:"**$1**$2"},"function-italic":{search:/([^\n]+)([\n\s]*)/g,replace:"_$1_$2"},"function-code":{search:/([^\n]+)([\n\s]*)/g,replace:"`$1`$2"},"function-hr":{append:"\n***\n"},"function-ul":{exec:function(e,t){for(var n="",i=t.split("\n"),o=0;o<i.length;o++)n+="* "+i[o]+"\n";n=n.substring(0,n.length-1),r.GollumEditor.replaceSelection(n,!0,!0)}},"function-ol":{line:function(e,t){return e.toString()+". "+t+"\n"},exec:function(e,t){for(var n="",i=t.split("\n"),o=0;o<i.length;o++)n+=this.line(o+1,i[o]);n=n.substring(0,n.length-1),r.GollumEditor.replaceSelection(n,!0,!0)}},"function-blockquote":{search:/(.+)([\n]?)/g,replace:"> $1$2",break_line:!0},"function-h1":{search:/(.+)([\n]?)/g,replace:"# $1$2",break_line:!0,whole_line:!0},"function-h2":{search:/(.+)([\n]?)/g,replace:"## $1$2",break_line:!0,whole_line:!0},"function-h3":{search:/(.+)([\n]?)/g,replace:"### $1$2",break_line:!0,whole_line:!0},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.text+"]("+e.href+")"),t},exec:function(e,t){n("Insert Link",[{id:"text",name:"Link Text",type:"text",defaultValue:t},{id:"href",name:"URL",type:"text"}],this.replace)}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="!["+e.alt+"]("+e.url+")"),t},exec:function(e,t){n("Insert Image",[{id:"url",name:"Image Url",type:"text",defaultValue:t},{id:"alt",name:"Alt Text",type:"text"}],this.replace)}},"function-critic-accept":{exec:function(e,t){var n=t.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$2").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");r.GollumEditor.replaceSelection(n)}},"function-critic-reject":{exec:function(e,t){var n=t.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$1").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");r.GollumEditor.replaceSelection(n)}}}}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-hr":undefined,"function-blockquote":{replace:"----\n$1$2\n----"},"function-h1":{replace:"= $1$2"},"function-h2":{replace:"== $1$2"},"function-h3":{replace:"=== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t=e.href+"["+e.text+"]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="image::"+e.url+"["+e.alt+"]"),t}}};e.GollumEditor.defineLanguage("asciidoc",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>AsciiDoc headers can be written in two ways: with differing underlines or with different indentation using <code>=</code> (equals sign). AsciiDoc supports headings 1-4. The editor will automatically use the <code>=</code> notation. To create a level one header, prefix your line with one <code>=</code>. Level two headers are created with <code>==</code> and so on.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>*</code> (asterisks). To display text as <em>italic</em>, wrap the text in <code>_</code> (underscores). To create <code>monospace</code> text, wrap the text in <code>`</code> (backtick)."},{menuName:"Scripts",data:"<p>Superscript and subscript is created the same way as other inline formats. To create superscript text, wrap your text in <code>^</code> (carats). To create subscript text, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Special Characters",data:"<p>AsciiDoc will automatically convert textual representations of commonly-used special characters. For example, <code>(R)</code> becomes &reg;, <code>(C)</code> becomes &copy; and <code>(TM)</code> becomes &trade;.</p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>AsciiDoc allows paragraphs to have optional titles or icons to denote special sections. To make a normal paragraph, simply add a line between blocks and a new paragraph will start. If you want to title your paragraphs, adda line prefixed by <code>.</code> (full stop). An example paragraph with optional title is displayed below:<br><br><code>.Optional Title<br><br>This is my paragraph. It is two sentences long.</code></p>"},{menuName:"Source Blocks",data:"<p>To create source blocks (long blocks of code), follow the same syntax as above but with an extra line denoting the inline source and lines of four dashes (<code>----</code>) delimiting the source block.. An example of Python source is below:<br><br><code>.python.py<br>[source,python]<br>----<br># i just wrote a comment in python<br># and maybe one more<br>----</code></p>"},{menuName:"Comment Blocks",data:"<p>Comment blocks are useful if you want to keep notes for yourself inline but do not want them displayed to the public. To create a comment block, simply wrap the paragraph in dividers with four slashes (<code>////</code>). An example comment block is below:<br><br><code>////<br>My comment block is here now<br><br>It can be multiple paragraphs. Really.<br>////</p>"},{menuName:"Quote Blocks",data:"<p>Quote blocks work much like comment blocks &mdash; simply create dividers using four underscores (<code>____</code>) around your quote. An example quote block is displayed below:<br><code>____<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>____</code></p>"}]},{menuName:"Macros",content:[{menuName:"Links",data:'<p>To create links to external pages, you can simply write the URI if you want the URI to link to itself. (i.e., <code>http://github.com/</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>. If you want different text to be displayed, simply append it to the end of the URI in between <code>[</code> (brackets.) For example, <code>http://github.com/[GitHub]</code> will be parsed as <a href="javascript:void(0);">GitHub</a>, with the URI pointing to <code>http://github.com</code>.</p>'},{menuName:"Images",data:"<p>Images in AsciiDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>"}]}];e.GollumEditor.defineHelp("asciidoc",n)}(jQuery),jQuery.GollumEditor.defineLanguage("bib",{}),function(e){var t={"function-italic":{replace:"//$1//$2"},"function-code":{replace:"{{{$1}}}$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":undefined,"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-h1":{replace:"== $1$2"},"function-h2":{replace:"=== $1$2"},"function-h3":{replace:"==== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="[["+e.href+"|"+e.text+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="{{"+e.url,""!=e.alt&&(t+="|"+e.alt),t+="}}"),t}}};e.GollumEditor.defineLanguage("creole",e.constructLanguageDefinition(t))}(jQuery),function(e){var t={"gollum-helpers":{"find-header-line":function(e,t){if(t.match(/(^[=]+$)/)||t.match(/(^[-]+$)/)){var n=e-1,i=window.ace_editor.getSession().getLine(n);return 0<=n&&!/^\s+$/.test(i)?[i,n]:null}return null}}};e.GollumEditor.defineLanguage("markdown",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p><p>If you want to create a line break, end a line with two or more spaces, then hit Return/Enter.</p>"},{menuName:"Headers",data:"<p>Markdown supports two header formats. The wiki editor uses the &ldquo;atx&rsquo;-style headers. Simply prefix your header text with the number of <code>#</code> characters to specify heading depth. For example: <code># Header 1</code>, <code>## Header 2</code> and <code>### Header 3</code> will be progressively smaller headers. You may end your headers with any number of hashes.</p>"},{menuName:"Blockquotes",data:"<p>Markdown creates blockquotes email-style by prefixing each line with the <code>&gt;</code>. This looks best if you decide to hard-wrap text and prefix each line with a <code>&gt;</code> character, but Markdown supports just putting <code>&gt;</code> before your paragraph.</p>"},{menuName:"Lists",data:"<p>Markdown supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p> List items can contain multiple paragraphs, however each paragraph must be indented by at least 4 spaces or a tab."},{menuName:"Code Blocks",data:"<p>Markdown wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Markdown will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"Horizontal rules are created by placing three or more hyphens, asterisks or underscores on a line by themselves. Spaces are allowed between the hyphens, asterisks or underscores."}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>Markdown has two types of links: <strong>inline</strong> and <strong>reference</strong>. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[GitHub]</code>.</p><p>To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., <code>[GitHub](http://github.com/)</code>). Relative paths are allowed in inline links.</p><p>To create a reference link, use two sets of square brackets. <code>[my internal link][internal-ref]</code> will link to the internal reference <code>internal-ref</code>.</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) and underscores (<code>_</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) or double underscores (<code>__</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Markdown will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (<code>!</code>). For example, if you want to link to an image at <code>http://github.com/unicorn.png</code> with the alternate text <code>My Unicorn</code>, you would write <code>![My Unicorn](http://github.com/unicorn.png)</code>.</p>"}]},{menuName:"Miscellaneous",content:[{menuName:"Automatic Links",data:'<p>If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in <code>&lt;</code> and <code>&gt;</code> to do so. For example, the link <a href="javascript:void(0);">http://github.com/</a> is easily produced by writing <code>&lt;http://github.com/&gt;</code>.</p>'},{menuName:"Escaping",data:"<p>If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Markdown will ignore the character directly after a backslash."},{menuName:"Emoji",data:'<p>See the <a href="http://emojione.com/demo/" target="_blank">EmojiOne demo</a> for all available emoji. To include one, wrap the emoji name in colons and use underscores instead of spaces (e.g. :heart: or :point_up:).'}]}];e.GollumEditor.defineHelp("markdown",n)}(jQuery),function(e){var t={"function-bold":{replace:"'''$1'''$2"},"function-italic":{replace:"''$1''$2"},"function-hr":{append:"\n---\n"},"function-code":{replace:"<code>$1</code>$2"},"function-ol":{link:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"<blockquote>\n$1$2\n</blockquote>"},"function-h1":{replace:"= $1$2 ="},"function-h2":{replace:"== $1$2 =="},"function-h3":{replace:"=== $1$2 ==="},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.href+" | "+e.text+"]"),t}}};e.GollumEditor.defineLanguage("mediawiki",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>MediaWiki headers are written with different indentation using <code>= Title =</code> (equals sign). MediaWiki supports headings 1-6.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>'''</code>. To display text as <em>italic</em>, wrap the text in <code>''</code>. To create <code>monospace</code> text, wrap the text in <code>&lt;code&gt;&lt;/code&gt;</code>."},{menuName:"Special Characters",data:"<p>Use HTML special characters, e.g. <code>&copy;</code> or <code>&euro;</code></p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tag <code><br /></code>.</p>"},{menuName:"Tables",data:'<p>Tables may be authored in wiki pages using either XHTML table elements directly, or using wikicode formatting to define the table. Wikitable syntax overview: <table cellpadding="5" cellspacing="0" border="1"><tr><td><pre> <code>{|</code></pre></td><td><b>table start</b></td></tr><tr><td><pre> <code>|+</code></pre></td><td>table <b>caption,</b> <i>optional;</i> only between <b>table start</b> and first <b>table row</b></td></tr><tr><td><pre> <code>|-</code></pre></td><td><b>table row,</b> <i>optional on first row</i> -- wiki engine assumes the first row</td></tr><tr><td><pre> <code>!</code></pre></td><td><b>table header</b> cell, <i>optional.</i> Consecutive <b>table header</b> cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).</td></tr><tr><td><pre> <code>|</code></pre></td><td><b>table data</b> cell, <i>required!</i> Consecutive <b>table data</b> cells may be added on same line separated by double marks (<code>||</code>) or start on new lines, each with its own single mark (<code>|</code>).</td></tr><tr><td><pre> <code>|}</code></pre></td><td><b>table end</b></td></tr></table></p>'}]},{menuName:"Macros",content:[{menuName:"Links",data:"<p>To create links to external pages, use single brackets, e.g. <code>[https://mediawiki.org MediaWiki]</code>. Internal links use double brackets: <code>[[Main Page]]</code>. To define the link text, use <code>[[Main Page | this is displayed]]</code> (note: the order of the URL/Page Name and the link text is reversed compared to Gollum pages in other markups).</p>"},{menuName:"Images",data:"<p>Use Gollum internal links, e.g. <code>[[sauron.jpg]]<code>, to insert images."}]}];e.GollumEditor.defineHelp("mediawiki",n)}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-italic":{replace:"/$1/$2"},"function-code":{replace:"=$1=$2"},"function-hr":undefined,"function-blockquote":{replace:"#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE"},"function-h1":{replace:"* $1$2"},"function-h2":{replace:"** $1$2"},"function-h3":{replace:"*** $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href?t="[["+e.href+"]["+e.text+"]]":e.href&&(t="[["+e.href+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&(t="[["+e.url+"]]"),t}}};e.GollumEditor.defineLanguage("org",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Simply prefix your header text with the number of <code>*</code> characters to specify heading depth. For example: <code>* Header 1</code>, <code>** Header 2</code> and <code>*** Header 3</code> will be progressively smaller headers.</p>"},{menuName:"Blockquotes",data:"<p>To create a blockquote, simple embed the text between <code>#+BEGIN_QUOTE</code> and <code>#+END_QUOTE</code>. An example quote block is displayed below:<br><code>#+BEGIN_QUOTE<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>#+END_QUOTE</code></p>"},{menuName:"Lists",data:"<p>Org-mode supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Code Blocks are similar to blockquote, except that <code>#+BEGIN_EXAMPLE</code> and <code>#+END_EXAMPLE</code> are used.</p>"},{menuName:"Tables",data:"<p>Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code>&lt;th&gt;</code> tag will be used to render it. </p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:'<p>To create links to external pages, you need to enclose the URI in double square brackets. (i.e., <code>[[http://github.com/]]</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[[http://github.com][GitHub]]</code>.</p>'},{menuName:"Emphasis",data:"<p>Forward slashes (<code>/</code>) are treated as emphasis and are wrapped with an <code>&lt;i&gt;</code> tag. Asterisks (<code>*</code>) are treated as bold using the <code>&lt;b&gt;</code> tag.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in equal signs (<code>=</code>). Orgmode will turn <code>=myFunction=</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.</p>"}]}];e.GollumEditor.defineHelp("org",n)}(jQuery),jQuery.GollumEditor.defineLanguage("txt",{}),function(e){var t={"function-bold":{replace:"B<$1>$2"},"function-italic":{replace:"I<$1>$2"},"function-hr":undefined,"function-code":{replace:"C<$1>$2"},"function-h1":{replace:"=head1 $1$2"},"function-h2":{replace:"=head2 $1$2"},"function-h3":{replace:"=head3 $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="L<"+e.text+"|"+e.href+">"),t}},"function-image":undefined,"function-ul":undefined,"function-ol":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("pod",e.constructLanguageDefinition(t));var n=[{menuName:"Command Paragraphs",content:[{menuName:"Headings",data:"<p>All command paragraphs start with <code>=</code> (equals sign).</p><p>To create headings 1 through 4, begin your command paragraph with <code>=headN</code>, where <code>N</code> is the number of the heading 1 through 4. For example, to make a first-order heading (the largest possible,) write <code>=head1</code>, then on the next line begin your paragraph that you want under the heading.</p>"},{menuName:"Beginning &amp; Ending",data:"<p>Perl pod blocks should begin with <code>=pod</code> and end with <code>=cut</code>, signifying to Pod parsers that the pod block has begun and ended. These command paragraphs only signal the beginning and end of a pod block.</p>"},{menuName:"Other Formats",data:"<p>pod also allows blocks in other formats, such as HTML or plain text. To create one of these blocks, use the <code>=format SYNTAX</code> command paragraph, where <code>SYNTAX</code> is the syntax of the block (e.g. <code>html</code> or <code>txt</code>). At the end of your block, use the <code>=end SYNTAX</code> block.</p>"},{menuName:"Encoding",data:"<p>If you are having encoding troubles, use the <code>=encoding ENC_TYPE</code> command, where <code>ENC_TYPE</code> is the encoding type (e.g. <code>utf8</code>, <code>koi8-r</code>). This will affect the entire document, not just the block below the command.</p>"}]},{menuName:"Formatting",content:[{menuName:"Text",data:"<p>Formatting text as <strong>bold</strong>, <em>italic</em> or <code>code</code> works in the <code>S&lt;word&gt;</code> syntax, where <code>S</code> is an abbreviation for the type of text you are trying to create. For example, <code>B&lt;my bold text&gt;</code> becomes <strong>my bold text</strong>, <code>I&lt;italic text&gt;</code> becomes <em>italic text</em> and <code>C&lt;code here()&gt;</code> becomes <code>code here()</code>.</p>"},{menuName:"Hyperlinks",data:"<p>Writing hyperlinks in pod is much like formatting text, using the same <code>S&lt;&gt;</code> syntax. Instead of <code>B</code>, <code>I</code> or <code>C</code>, use <code>L</code> to begin a hyperlink.</p><p>pod allows you to hyperlink to a <code>man</code> page, a Perl documentation page, or another web page. To link to a <code>man</code> or Perl documentation page, simply include the page name in the link (e.g. <code>L&lt;perl(1)&gt;</code> or <code>L&lt;Net::Ping&gt;</code>). If you want to link to a web page, separate the URL and the link text with a pipe (e.g. to link to github.com, write <code>L&lt;GitHub|http://github.com/&gt;</code>)."}]}];e.GollumEditor.defineHelp("pod",n)}(jQuery),function(e){var t={"function-code":undefined,"function-h1":undefined,"function-h2":undefined,"function-h3":undefined,"function-link":undefined,"function-image":undefined,"function-hr":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("rdoc",e.constructLanguageDefinition(t))}(jQuery),function(s){var o=function(e,t,n){var i="";i=e.length?e:"Title here",adornment=n.repeat(i.length),i=i+"\n"+adornment+"\n",s.GollumEditor.replaceSelection(i,!1,!1,t)},e={"function-bold":{replace:"**$1**$2"},"function-italic":{replace:"*$1*$2"},"function-code":{replace:"``$1``$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":{exec:function(e,t){for(var n=" ",i=t.split("\n"),o=0;o<i.length;o++)i[o]=n+i[o];var r=i.join("\n");s.GollumEditor.replaceSelection(r)}},"function-h1":{symbol:"=",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-h2":{symbol:"-",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-h3":{symbol:"~",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="`"+e.text+" <"+e.href+">`_"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t=".. image:: "+e.url+"\n :alt: "+e.alt),t}},"gollum-helpers":{"find-header-line":function(e){var t=e-1,n=window.ace_editor.getSession().getLine(t);return 0<=t&&!/^\s+$/.test(n)?[n,t]:null}}};s.GollumEditor.defineLanguage("rst",s.constructLanguageDefinition(e));var t=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Rest uses overline/underline adornments to indicate headers. To create a header, underline your header text with adornment characters such as the <code>=, ~, +, ^</code> characters. Make sure that the adornment is of the same length (or longer) as the header text. Use a different adornment character to specify a different heading depth.</p>"},{menuName:"Blockquotes",data:"<p>Rest creates blockquotes using indentation. This looks best if you use four spaces per level of indentation.</p>"},{menuName:"Lists",data:"<p>Rest supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number, or use <code>#</code> for auto enumeration. To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Rest wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Rest will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"<p>Horizontal rules are created by placing four or more hyphens, asterisks or underscores on a line by themselves.</p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>To create an inline link, create a set of backticks, include the link title first, followed by the url in angled brackets (e.g., <code>`Python <http://www.python.org/>`_</code>).</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Rest will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:'<p>Rest image syntax is two dots, followed by a space, the word "image", two colons, another space, and the url: <code>.. image:: http://image.com/image.png</code>.</p>'}]},{menuName:"Miscellaneous",content:[{menuName:"Escaping",data:"<p>If you want to use a special Rest character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Rest will ignore the character directly after a backslash."}]}];s.GollumEditor.defineHelp("rst",t)}(jQuery),function(e){var t={"function-hr":undefined,"function-code":{replace:"bc. $1$2",whole_line:!0},"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"bq. $1$2"},"function-h1":{replace:"h1. $1$2"},"function-h2":{replace:"h2. $1$2"},"function-h3":{replace:"h3. $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t='"'+e.text+'":'+e.href),t}},"function-image":{replace:function(e){var t="";if(e.url){t="!"+e.url;return""!=e.alt&&(t+="("+e.alt+")"),t+="!"}}}};e.GollumEditor.defineLanguage("textile",e.constructLanguageDefinition(t));var n=[{menuName:"Phrase Modifiers",content:[{menuName:"Emphasis / Strength",data:"<p>To place emphasis or strength on inline text, simply place <code>_</code> (underscores) around the text for emphasis or <code>*</code> (asterisks) around the text for strength. In most browsers, <code>_mytext_</code> will appear as italics and <code>*mytext*</code> will appear as bold.</p><p>To force italics or bold, simply double the characters: <code>__mytext__</code> will appear italic and <code>**mytext**</code> will appear as bold text.</p>"},{menuName:"Citations / Editing",data:'<p>To display citations, wrap your text in <code>??</code> (two question marks).</p><p>To display edit marks such as deleted text (strikethrough) or inserted text (underlined text), wrap your text in <code>-</code> (minuses) or <code>+</code> (pluses). For example <code>-mytext-</code> will be rendered as <span style="text-decoration: line-through;">mytext</span> and <code>+mytext+</code> will be rendered as <span style="text-decoration: underline;">mytext</span></p>'},{menuName:"Superscript / Subscript",data:"<p>To display superscript, wrap your text in <code>^</code> (carets). To display subscript, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Code",data:"<p>To display monospace code, wrap your text in <code>@</code> (at symbol). For example, <code>@mytext@</code> will appear as <code>mytext</code>.</p>"},{menuName:"Acronyms",data:'<p>To create an acronym, suffix the acronym with the definition in parentheses. For example, <code>JS(JavaScript)</code> will be displayed as <abbr title="JavaScript">JS</abbr>.</p>'}]},{menuName:"Block Modifiers",content:[{menuName:"Headings",
22
+ t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"],function(e,f,t){"use strict";function u(e,t){for(var n in t)e.style[n]=t[n]}function d(i,t){if("textarea"!=i.type)throw new Error("Textarea required!");var e=i.parentNode,o=document.createElement("div"),n=function(){var t="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(e){t+=e+":"+s(i,o,e)+";"});var e=s(i,o,"width")||i.clientWidth+"px",n=s(i,o,"height")||i.clientHeight+"px";t+="height:"+n+";width:"+e+";",t+="display:inline-block;",o.setAttribute("style",t)};for(m.addListener(window,"resize",n),n(),e.insertBefore(o,i.nextSibling);e!==document;){if("FORM"===e.tagName.toUpperCase()){var r=e.onsubmit;e.onsubmit=function(e){i.value=t(),r&&r.call(this,e)};break}e=e.parentNode}return o}function g(n,e,i,t,o){function r(e){return"true"===e||1==e}n.getSession(),n.renderer;return n.setDisplaySettings=function(e){null==e&&(e="none"==i.style.display),e?(i.style.display="block",i.hideButton.focus(),n.on("focus",function t(){n.removeListener("focus",t),i.style.display="none"})):n.focus()},n.$setOption=n.setOption,n.$getOption=n.getOption,n.setOption=function(e,t){switch(e){case"mode":n.$setOption("mode","ace/mode/"+t);break;case"theme":n.$setOption("theme","ace/theme/"+t);break;case"keybindings":switch(t){case"vim":n.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":n.setKeyboardHandler("ace/keyboard/emacs");break;default:n.setKeyboardHandler(null)}break;case"wrap":case"fontSize":n.$setOption(e,t);break;default:n.$setOption(e,r(t))}},n.getOption=function(e){switch(e){case"mode":return n.$getOption("mode").substr("ace/mode/".length);case"theme":return n.$getOption("theme").substr("ace/theme/".length);case"keybindings":var t=n.getKeyboardHandler();switch(t&&t.$id){case"ace/keyboard/vim":return"vim";case"ace/keyboard/emacs":return"emacs";default:return"ace"}break;default:return n.$getOption(e)}},n.setOptions(o),n}function p(e,t,n){function i(e,t,n,i){if(n){for(var o in e.push("<select title='"+t+"'>"),n)e.push("<option value='"+o+"' "),i==o&&e.push(" selected "),e.push(">",n[o],"</option>");e.push("</select>")}else e.push("<input type='checkbox' title='",t,"' ",i+""=="true"?"checked='true'":"","'></input>")}var o=null,r={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},s={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:o,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:o,useSoftTabs:o,showInvisibles:o},a=[];for(var l in a.push("<table><tr><th>Setting</th><th>Value</th></tr>"),f.defaultOptions)a.push("<tr><td>",r[l],"</td>"),a.push("<td>"),i(a,l,s[l],n.getOption(l)),a.push("</td></tr>");a.push("</table>"),e.innerHTML=a.join("");for(var c=function(e){var t=e.currentTarget;n.setOption(t.title,t.value)},h=function(e){var t=e.currentTarget;n.setOption(t.title,t.checked)},u=e.getElementsByTagName("select"),d=0;d<u.length;d++)u[d].onchange=c;var g=e.getElementsByTagName("input");for(d=0;d<g.length;d++)g[d].onclick=h;var p=document.createElement("input");p.type="button",p.value="Hide",m.addListener(p,"click",function(){n.setDisplaySettings(!1)}),e.appendChild(p),e.hideButton=p}var m=e("../lib/event"),v=e("../lib/useragent"),b=(e("../lib/net"),e("../ace"));e("../theme/textmate"),t.exports=f=b;var s=function(e,t,n){var i=e.style[n];return i||(i=window.getComputedStyle?window.getComputedStyle(e,"").getPropertyValue(n):e.currentStyle[n]),i&&"auto"!=i&&"intrinsic"!=i||(i=t.style[n]),i};f.transformTextarea=function(e,t){var n,i=e.autofocus||document.activeElement==e,o=d(e,function(){return n.getValue()});e.style.display="none",o.style.background="white";var r=document.createElement("div");u(r,{top:"0px",left:"0px",right:"0px",bottom:"0px",border:"1px solid gray",position:"absolute"}),o.appendChild(r);var s=document.createElement("div");u(s,{position:"absolute",right:"0px",bottom:"0px",cursor:"nw-resize",border:"solid 9px",borderColor:"lightblue gray gray #ceade6",zIndex:101});var a=document.createElement("div"),l={top:"0px",left:"20%",right:"0px",bottom:"0px",position:"absolute",padding:"5px",zIndex:100,color:"white",display:"none",overflow:"auto",fontSize:"14px",boxShadow:"-5px 2px 3px gray"};v.isOldIE?l.backgroundColor="#333":l.backgroundColor="rgba(0, 0, 0, 0.6)",u(a,l),o.appendChild(a),t=t||f.defaultOptions;var c=b.edit(r);(n=c.getSession()).setValue(e.value||e.innerHTML),i&&c.focus(),o.appendChild(s),g(c,r,a,b,t),p(a,s,c);var h="";return m.addListener(s,"mousemove",function(e){var t=this.getBoundingClientRect();e.clientX-t.left+(e.clientY-t.top)<(t.width+t.height)/2?(this.style.cursor="pointer",h="toggle"):(h="resize",this.style.cursor="nw-resize")}),m.addListener(s,"mousedown",function(e){if(e.preventDefault(),"toggle"!=h){o.style.zIndex=1e5;var t=o.getBoundingClientRect(),n=t.width+t.left-e.clientX,i=t.height+t.top-e.clientY;m.capture(s,function(e){o.style.width=e.clientX-t.left+n+"px",o.style.height=e.clientY-t.top+i+"px",c.resize()},function(){})}else c.setDisplaySettings()}),c},f.defaultOptions={mode:"javascript",theme:"textmate",wrap:"off",fontSize:"12px",showGutter:"false",keybindings:"ace",showPrintMargin:"false",useSoftTabs:"true",showInvisibles:"false"}}),ace.require(["ace/ext/textarea"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/themelist",["require","exports","module"],function(e,i){"use strict";var t=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];i.themesByName={},i.themes=t.map(function(e){var t=e[1]||e[0].replace(/ /g,"_").toLowerCase(),n={caption:e[0],theme:"ace/theme/"+t,isDark:"dark"==e[2],name:t};return i.themesByName[t]=n})}),ace.require(["ace/ext/themelist"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}),ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,i){"use strict";var v=e("../lib/lang");i.$detectIndentation=function(e){function t(e){for(var t=0,n=e;n<i.length;n+=e)t+=i[n]||0;return t}for(var i=[],n=[],o=0,r=0,s=Math.min(e.length,1e3),a=0;a<s;a++){var l=e[a];if(/^\s*[^*+\-\s]/.test(l)){if("\t"==l[0])o++,r=-Number.MAX_VALUE;else{var c=l.match(/^ */)[0].length;if(c&&"\t"!=l[c]){var h=c-r;0<h&&!(r%h)&&!(c%h)&&(n[h]=(n[h]||0)+1),i[c]=(i[c]||0)+1}r=c}for(;a<s&&"\\"==l[l.length-1];)l=e[a++]}}var u=n.reduce(function(e,t){return e+t},0),d={score:0,length:0},g=0;for(a=1;a<12;a++){var p=t(a);1==a?(g=p,p=i[1]?.9:.8,i.length||(p=0)):p/=g,n[a]&&(p+=n[a]/u),p>d.score&&(d={score:p,length:a})}if(d.score&&1.4<d.score)var f=d.length;return g+1<o?((1==f||g<o/4||d.score<1.8)&&(f=undefined),{ch:"\t",length:f}):o+1<g?{ch:" ",length:f}:void 0},i.detectIndentation=function(e){var t=e.getLines(0,1e3),n=i.$detectIndentation(t)||{};return n.ch&&e.setUseSoftTabs(" "==n.ch),n.length&&e.setTabSize(n.length),n},i.trimTrailingSpace=function(e,t){var n=e.getDocument(),i=n.getAllLines(),o=t&&t.trimEmpty?-1:0,r=[],s=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var i=n[t+1];i&&i.cursor.row==e.cursor.row||r.push(e.cursor)}):r.push(e.selection.getCursor()),s=0);for(var a=r[s]&&r[s].row,l=0,c=i.length;l<c;l++){var h=i[l],u=h.search(/\s+$/);l==a&&(u<r[s].column&&o<u&&(u=r[s].column),a=r[++s]?r[s].row:-1),o<u&&n.removeInLine(l,u,h.length)}},i.convertIndentation=function(e,t,n){var i=e.getTabString()[0],o=e.getTabSize();n||(n=o),t||(t=i);for(var r="\t"==t?t:v.stringRepeat(t,n),s=e.doc,a=s.getAllLines(),l={},c={},h=0,u=a.length;h<u;h++){var d=a[h].match(/^\s*/)[0];if(d){var g=e.$getStringScreenWidth(d)[0],p=Math.floor(g/o),f=g%o,m=l[p]||(l[p]=v.stringRepeat(r,p));(m+=c[f]||(c[f]=v.stringRepeat(" ",f)))!=d&&(s.removeInLine(h,0,d.length),s.insertInLine({row:h,column:0},m))}}e.setTabSize(n),e.setUseSoftTabs(" "==t)},i.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch="\t":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},i.$parseArg=function(e){return e?"string"==typeof e?i.$parseStringArg(e):"string"==typeof e.text?i.$parseStringArg(e.text):e:{}},i.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){i.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,t){i.trimTrailingSpace(e.session,t)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,t){var n=i.$parseArg(t);i.convertIndentation(e.session,n.ch,n.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,t){var n=i.$parseArg(t);n.length&&e.session.setTabSize(n.length),n.ch&&e.session.setUseSoftTabs(" "==n.ch)}}]}),ace.require(["ace/ext/whitespace"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});var GollumTagStart={token:"support.function",regex:"\\[\\[[^\\]]*\\]\\]",next:"start"},UMLBlock=[{token:"support.function",regex:"^\\@enduml$",next:"start"},{defaultToken:"support.function"}],UMLStart={token:"support.function",regex:"^(?:[ \\t]*)\\@startuml$",next:"umlblock"},GithubCodeBlock=[{token:"support.function",regex:".*",onMatch:function(e,t,n){var i=n[2][0],o=n[2][1],r=/^( {0,3})(~~[~]+|```)\s*$/.exec(e);return r&&r[2].length>=i&&r[2].charAt(0)==o?(n.splice(0,3),this.next=n.shift()):this.next="",this.token}},{defaultToken:"support.function"}],startCodeBlockMatch=function(e,t,n){var i=new RegExp(this.regex).exec(e);return n.unshift("githubblock",[],[i[2].length,i[2].charAt(0)],t),this.token},GollumCodeStart={token:"support.function",regex:"^( {0,3})(```)[^`]*$",onMatch:startCodeBlockMatch,next:"githubblock"},MarkdownCodeStart={token:"support.function",regex:"^( {0,3})(~~[~]+)[^`~]*$",onMatch:startCodeBlockMatch,next:"githubblock"};ace.define("GollumRstHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rst_highlight_rules").RSTHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumAsciidocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/asciidoc_highlight_rules").AsciidocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextileHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/textile_highlight_rules").TextileHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/text_highlight_rules").TextHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumRdocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rdoc_highlight_rules").RDocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumMarkdownHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.$rules.start.unshift(MarkdownCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),function(e){var r={asciidoc:{mode:"asciidoc",highlighter:"GollumAsciidocHighlightRules"},creole:{mode:"text",highlighter:"GollumTextHighlightRules"},markdown:{mode:"markdown",highlighter:"GollumMarkdownHighlightRules"},mediawiki:{mode:"text",highlighter:"GollumTextHighlightRules"},bib:{mode:"latex"},org:{mode:"text",highlighter:"GollumTextHighlightRules"},rst:{mode:"rst",highlighter:"GollumRstHighlightRules"},txt:{mode:"text"},pod:{mode:"text",highlighter:"GollumTextHighlightRules"},rdoc:{mode:"rdoc",highlighter:"GollumRdocHighlightRules"},textile:{mode:"textile",highlighter:"GollumTextileHighlightRules"}};e.getEditorMode=function(e){var t=null;if(t=r[e]){var n=t.mode,i=t.highlighter;if(i){var o=new(ace.require("ace/mode/"+n).Mode);return o.HighlightRules=ace.require(i).GollumHighlightRules,o}return"ace/mode/"+n}return null}}(jQuery),function(v){function r(e){return new RegExp("^[^"+"A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufdfe-\ufe6f\ufefd-\uffff"+"]*["+"\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc"+"]").test(e)}function s(e){window.ace_editor.session.$bidiHandler.$isRtl=e,window.ace_editor.session.$bidiHandler.updateBidiMap(),window.ace_editor.renderer.updateFull()}function a(){e&&clearTimeout(e),v("#gollum-saved-msg").text("Saving..."),e=setTimeout(function(){localStorage.setItem(h,window.ace_editor.getSession().getValue()),v("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").each(function(e,t){var n=h+t.id.replace("gollum-editor-","_");localStorage.setItem(n,t.value)}),v("#gollum-saved-msg").text("Saved recovery text")},2e3)}var l={MarkupType:"markdown",EditorMode:"code",NewFile:!1,HasFunctionBar:!0,Debug:!1,NoDefinitionsFor:[]},c={},e=null,h="gollum_autorecover_"+window.location;v.GollumEditor=function(e){if(c=v.extend(l,e),v('textarea[id="gollum-editor-body"]').each(function(){var e=v(this),t=e.attr("data-markup-lang")?e.attr("data-markup-lang"):"markdown",n=v("<div>",{position:"absolute",height:e.height(),"class":e.attr("class"),id:"gollum-editor-body-ace"}).insertAfter(e);e.css("display","none");var i=ace.edit(n[0],{rtlText:!0});window.ace_editor=i;var o=localStorage.getItem(h);o&&(v("#gollum-autorecover-button").click(function(e){i.getSession().setValue(o),["header","footer","sidebar"].forEach(function(e){var t=localStorage.getItem(h+"_"+e);t&&v("#gollum-editor-"+e).val(t)}),v("#gollum-autorecover-msg")[0].hidden=!0,e.preventDefault()}),v("#gollum-autorecover-msg")[0].hidden=!1),i.setTheme("ace/theme/tomorrow"),i.setKeyboardHandler(),i.renderer.setShowGutter(!1),i.getSession().setUseWrapMode(!0),i.getSession().setValue(e.val()),i.getSession().setMode(v.getEditorMode(t)),i.getSession().on("change",function(){e.val(i.getSession().getValue()),a()}),v("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").on("change keyup paste",a),r(i.getSession().getLine(0))&&s(!0),i.commands.addCommand({name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(t){ace.config.loadModule("ace/ext/keybinding_menu",function(e){e.init(t),t.showKeyboardShortcuts()})}}),c.commands&&v.each(c.commands,function(e,t){i.commands.addCommand(t)})}),v("#gollum-editor-body-ace").resize(function(){window.ace_editor.resize()}),v("#wiki_format").change(function(){var e=v(this).val(),t=window.ace_editor;window.ace_editor.getSession().setMode(v.getEditorMode(e)),g.updateCommitMessage(e),t.focus()}),v("#keybinding").change(function(){var e=v(this).val(),t=window.ace_editor;"default"==e?t.setKeyboardHandler():"vim"==e||"emacs"==e?t.setKeyboardHandler("ace/keyboard/"+e):t.setKeyboardHandler(),t.focus()}),v("#gollum-editor-submit, #gollum-editor-cancel").click(function(){var t="gollum_autorecover_"+window.location;localStorage.removeItem(t),["header","footer","sidebar"].forEach(function(e){localStorage.removeItem(t+"_"+e)})}),b("GollumEditor loading"),d.baseEditorMarkup()){if(d.titleDisplayed()&&v("#gollum-editor-title-field").addClass("active"),d.editSummaryMarkup()&&(v.GollumEditor.Placeholder.add(v("#gollum-editor-edit-summary input")),v('#gollum-editor form[name="gollum-editor"]').submit(function(e){e.preventDefault(),b("submitting"),v(this).unbind("submit"),v(this).submit()})),d.collapsibleInputs()&&v("#gollum-editor .collapsed button.collapsable, #gollum-editor .expanded button.collapsable").click(function(e){e.preventDefault(),v(this).parent().toggleClass("expanded"),v(this).parent().toggleClass("collapsed"),buttons=v(this).parent().children("button"),hidden_button=buttons.filter(":hidden")[0],shown_button=buttons.not(":hidden")[0],hidden_button.hidden=!1,shown_button.hidden=!0}),d.previewButton())v("#gollum-editor #gollum-editor-preview").click(function(){var e=v("#gollum-editor form").attr("action"),t=v(v("#gollum-editor form").get(0));t.attr("action",this.href||routePath("preview")),t.attr("target","_blank");var n=window.location.pathname.split("/");return t.attr("page",decodeURIComponent(n[n.length-1])||""),t.submit(),t.attr("action",e),t.removeAttr("target"),!1});if(d.functionBar()){var t=v("#gollum-editor-body").attr("data-markup-lang");t&&(c.MarkupType=t),u.setActiveLanguage(c.MarkupType),d.formatSelector()&&g.init(v("#wiki_format")),d.dir()&&v("#function-text-direction").click(function(e){e.preventDefault(),s(!window.ace_editor.session.$bidiHandler.$isRtl)}),d.help()&&(v("#gollum-editor-help").hide(),v("#gollum-editor-help").removeClass("jaws"))}if(c.section&&v.markupSupportsEditableSections(c.MarkupType)){var n=v.findSection(c.section,u.getDefinitionFor("gollum-helpers"));n&&(window.ace_editor.gotoLine(n+1,0,animate=!1),window.ace_editor.scrollToLine(n,center=!1,animate=!1),window.ace_editor.focus())}if(d.dragDropUpload()){var o=v("#gollum-editor-body-ace"),i=v("#gollum-editor-body-ace")[0];i.ondragover=function(){return o.addClass("dragging"),!1},i.ondragleave=function(){return o.removeClass("dragging"),!1},i.ondrop=function(e){b("dropped file"),e.preventDefault(),o.removeClass("dragging").addClass("uploading");var i=e.dataTransfer.files[0],t=new FormData;return t.append("file",i),v.ajax({url:routePath("upload_file"),data:t,cache:!1,contentType:!1,processData:!1,type:"POST",success:function(){o.removeClass("uploading");var e=i.name.split(".").pop().toLowerCase(),t=["jpg","jpeg","tif","tiff","png","gif","svg","bmp"];if(uploadDest=uploadDest.replace(/%20/g," "),-1<t.indexOf(e))var n="[[/"+uploadDest+"/"+i.name+"]]";else n="[["+i.name+"|/"+uploadDest+"/"+i.name+"]]";window.ace_editor.insert(n)},error:function(e,t,n){409==e.status?alert("This file already exists."):alert("Error uploading file: "+t+" "+n),o.removeClass("uploading")}}),!1}}}},v.GollumEditor.defineLanguage=function(e,t){"object"==typeof t?u.define(e,t):b("GollumEditor.defineLanguage: definition for "+e+" is not an object")};var b=function(e){c.Debug&&"undefined"!=typeof console&&console.log(e)},u={_ACTIVE_LANG:"",_LOADED_LANGS:[],_LANG:{},define:function(e,t){if(u._ACTIVE_LANG=e,u._LOADED_LANGS.push(e),"object"==typeof v.GollumEditor.WikiLanguage){var n={};v.extend(n,v.GollumEditor.WikiLanguage,t),u._LANG[e]=n}else u._LANG[e]=t},getActiveLanguage:function(){return u._ACTIVE_LANG},setActiveLanguage:function(e){function t(t){return function(){var e=u.getDefinitionFor(t);"object"==typeof e&&n.executeAction(e)}}null!=u._ACTIVE_LANG&&u._ACTIVE_LANG.length<=0&&g.updateCommitMessage(e),u.getHookFunctionFor("deactivate")&&u.getHookFunctionFor("deactivate")(),u.isLoadedFor(e)?(u._ACTIVE_LANG=e,n.refresh()):(u._ACTIVE_LANG=null,d.functionBar()&&n.refresh(),u.isValid()&&d.formatSelector()&&g.updateSelected()),u.getHookFunctionFor("activate")&&u.getHookFunctionFor("activate")(),window.ace_editor.commands.addCommand({name:"header-1",bindKey:{win:"Ctrl-1",mac:"Command-1"},exec:t("function-h1")}),window.ace_editor.commands.addCommand({name:"header-2",bindKey:{win:"Ctrl-2",mac:"Command-2"},exec:t("function-h2")}),window.ace_editor.commands.addCommand({name:"header-3",bindKey:{win:"Ctrl-3",mac:"Command-3"},exec:t("function-h3")}),window.ace_editor.commands.addCommand({name:"bold-text",bindKey:{win:"Ctrl-b",mac:"Command-b"},exec:t("function-bold")}),window.ace_editor.commands.addCommand({name:"italic-text",bindKey:{win:"Ctrl-i",mac:"Command-i"},exec:t("function-italic")})},getHookFunctionFor:function(e,t){return t||(t=u._ACTIVE_LANG),u.isLoadedFor(t)&&u._LANG[t][e]&&"function"==typeof u._LANG[t][e]?u._LANG[t][e]:null},getDefinitionFor:function(e,t){return t||(t=u._ACTIVE_LANG),u.isLoadedFor(t)&&u._LANG[t][e]&&"object"==typeof u._LANG[t][e]?u._LANG[t][e]:null},isLoadedFor:function(e){if(0===u._LOADED_LANGS.length)return!1;for(var t=0;t<u._LOADED_LANGS.length;t++)if(u._LOADED_LANGS[t]==e)return!0;return!1},isValid:function(){return u._ACTIVE_LANG&&"object"==typeof u._LANG[u._ACTIVE_LANG]}},d={baseEditorMarkup:function(){return v("#gollum-editor").length&&v("#gollum-editor-body").length},collapsibleInputs:function(){return v("#gollum-editor .collapsed, #gollum-editor .expanded").length},formatSelector:function(){return v("#wiki_format").length},functionBar:function(){return c.HasFunctionBar&&v("#gollum-editor-function-bar").length},ff4Environment:function(){return new RegExp(/Firefox\/4.0b/).test(navigator.userAgent)},editSummaryMarkup:function(){return 0<v("input#gollum-editor-message-field").length},help:function(){return v("#gollum-editor #gollum-editor-help").length&&v("#gollum-editor #function-help").length},dir:function(){return v("#gollum-editor #function-text-direction").length},previewButton:function(){return v("#gollum-editor #gollum-editor-preview").length},titleDisplayed:function(){return c.NewFile},dragDropUpload:function(){return v("#gollum-editor.uploads-allowed").length}},n={isActive:!1,activate:function(){b("Activating function bar"),v("#gollum-editor-function-bar button.function-button").each(function(){u.getDefinitionFor(v(this).attr("id"))?(v(this).click(n.evtFunctionButtonClick),v(this).attr("disabled",!1)):["function-help","function-text-direction"].includes(v(this).attr("id"))||v(this).attr("disabled",!0)}),v("#gollum-editor-function-bar").addClass("active"),n.isActive=!0},deactivate:function(){v("#gollum-editor-function-bar button.function-button").not("#function-text-direction").unbind("click"),v("#gollum-editor-function-bar").removeClass("active"),n.isActive=!1},evtFunctionButtonClick:function(e){e.preventDefault();var t=u.getDefinitionFor(v(this).attr("id"));"object"==typeof t&&n.executeAction(t)},executeAction:function(e){var t=window.ace_editor,n=t.getValue(),i=!1,o=!1,r=t.getSelectionRange(),s=t.getSelectedText(),a=s.length,l=!1;if(""==s)if(e.whole_line&&1==e.whole_line){l=!0;var c=r.start.row;s=t.session.getLine(c),r=new(ace.require("ace/range").Range)(c,0,c,s.length)}else e.break_line&&1==e.break_line&&(o=i=!0);else e.break_line&&1==e.break_line&&(o=i=!0);var h=s;if(e.exec&&"function"==typeof e.exec)e.exec(n,s,v("#gollum-editor-body"),r);else{var u=/([^\n]+)/gi;if(e.search&&"object"==typeof e.search&&(b("Replacing search Regex"),u=null,u=new RegExp(e.search),b(u)),b('repText is "'+h+'"'),e.replace&&"string"==typeof e.replace){b("Running replacement - using "+e.replace);var d=e.replace;h=(h=(h=escape(h)).replace(u,d)).replace(/\$[\d]/g,""),""===(h=unescape(h))&&(b("Search string is empty"),h=d.replace(/\$[\d]/g,""));var g=undefined;if(0==l){repPosition=d.indexOf("$1"),-1==repPosition&&(repPosition=Math.floor(d.length/2));var p=d.substring(0,repPosition),f=p.split("\n").length-1,m=repPosition;0<f&&(m-=p.lastIndexOf("\n")),g=[f,m+=a]}}e.append&&"string"==typeof e.append&&(h+=e.append),h&&v.GollumEditor.replaceSelection(h,i,o,r,g)}},isShown:function(){return v("#gollum-editor-function-bar").is(":visible")},refresh:function(){d.functionBar()&&(b("Refreshing function bar"),u.isValid()?(n.deactivate(),n.activate(),o&&o.setActiveHelp(u.getActiveLanguage())):(b("Language definition is invalid."),n.isShown()&&n.deactivate(),o.isShown()&&o.hide()))}},g={$_SELECTOR:null,evtChangeFormat:function(){var e=v(this).val();g.updateCommitMessage(e),u.setActiveLanguage(e)},updateCommitMessage:function(e){var t=document.getElementById("gollum-editor-message-field"),n=t.value;/^(?:created|updated)/i.test(n)&&(t.value=n.replace(/\([^\)]*\)$/,"("+e+")"))},init:function(e){b("Initializing format selector"),g.$_SELECTOR&&"object"==typeof g.$_SELECTOR&&g.$_SELECTOR.unbind("change"),g.$_SELECTOR=e,g.updateSelected(),g.$_SELECTOR.change(g.evtChangeFormat)},updateSelected:function(){var e=u.getActiveLanguage();g.$_SELECTOR.val(e)}},o={_ACTIVE_HELP:"",_LOADED_HELP_LANGS:[],_HELP:{},define:function(e,t){o.isValidHelpFormat(t)?(b("help is a valid format"),o._ACTIVE_HELP_LANG=e,o._LOADED_HELP_LANGS.push(e),o._HELP[e]=t,v("#function-help").length&&(v("#function-help").attr("disabled")&&v("#function-help").attr("disabled",!1),v("#function-help").unbind("click"),v("#function-help").click(o.evtHelpButtonClick),o.generateHelpMenuFor(e),v("#gollum-editor-help").length&&void 0!==v("#gollum-editor-help").attr("data-autodisplay")&&"true"===v("#gollum-editor-help").attr("data-autodisplay")&&o.show())):v("#function-help").length&&v("#function-help").attr("disabled",!0)},generateHelpMenuFor:function(e){if(!o._HELP[e])return b("Help is not defined for "+e.toString()),!1;var t=o._HELP[e];v("#gollum-editor-help-parent").html(""),v("#gollum-editor-help-list").html(""),v("#gollum-editor-help-content").html("");for(var n=0;n<t.length&&"object"==typeof t[n];n++){var i=v('<li><a href="#" rel="'+n+'">'+t[n].menuName+"</a></li>");v("#gollum-editor-help-parent").append(i),0===n&&i.children("a").addClass("selected"),i.children("a").click(o.evtParentMenuClick)}o.generateSubMenu(t[0],0),v(v("#gollum-editor-help-list li a").get(0)).click()},generateSubMenu:function(e,t){v("#gollum-editor-help-list").html(""),v("#gollum-editor-help-content").html("");for(var n=0;n<e.content.length&&"object"==typeof e.content[n];n++){var i=v('<li><a href="#" rel="'+t+":"+n+'">'+e.content[n].menuName+"</a></li>");v("#gollum-editor-help-list").append(i),i.children("a").click(o.evtSubMenuClick)}},hide:function(){v.browser.msie?v("#gollum-editor-help").css("display","none"):v("#gollum-editor-help").animate({opacity:0},200,function(){v("#gollum-editor-help").animate({
23
+ height:"hide"},200)})},show:function(){v.browser.msie?v("#gollum-editor-help").css("display","block"):v("#gollum-editor-help").animate({height:"show"},200,function(){v("#gollum-editor-help").animate({opacity:1},300)})},showHelpFor:function(e,t){var n=o._HELP[o._ACTIVE_HELP_LANG][e].content[t].data;v("#gollum-editor-help-content").html(n)},isLoadedFor:function(e){for(var t=0;t<o._LOADED_HELP_LANGS.length;t++)if(e==o._LOADED_HELP_LANGS[t])return!0;return!1},isShown:function(){return v("#gollum-editor-help").is(":visible")},isValidHelpFormat:function(e){return"object"==typeof e&&e.length&&"string"==typeof e[0].menuName&&"object"==typeof e[0].content&&e[0].content.length},setActiveHelp:function(e){o.isLoadedFor(e)?(o._ACTIVE_HELP_LANG=e,v("#function-help").length&&(v("#function-help").attr("disabled")&&v("#function-help").attr("disabled",!1),v("#function-help").unbind("click"),v("#function-help").click(o.evtHelpButtonClick),o.generateHelpMenuFor(e))):(v("#function-help").length&&v("#function-help").attr("disabled",!0),o.isShown()&&o.hide())},evtHelpButtonClick:function(e){e.preventDefault(),o.isShown()?(v("#gollum-editor-help").length&&"undefined"!==v("#gollum-editor-help").attr("data-autodisplay")&&"true"===v("#gollum-editor-help").attr("data-autodisplay")&&(v.post("/wiki/help?_method=delete"),v("#gollum-editor-help").attr("data-autodisplay","")),o.hide()):o.show()},evtParentMenuClick:function(e){if(e.preventDefault(),!v(this).hasClass("selected")){var t=v(this).attr("rel"),n=o._HELP[o._ACTIVE_HELP_LANG][t];v("#gollum-editor-help-parent li a").removeClass("selected"),v(this).addClass("selected"),o.generateSubMenu(n,t),v(v("#gollum-editor-help-list li a").get(0)).click()}},evtSubMenuClick:function(e){if(e.preventDefault(),!v(this).hasClass("selected")){var t=v(this).attr("rel").split(":");v("#gollum-editor-help-list li a").removeClass("selected"),v(this).addClass("selected"),o.showHelpFor(t[0],t[1])}}};v.GollumEditor.defineHelp=o.define,v.GollumEditor.Dialog=v.GollumDialog,v.GollumEditor.replaceSelection=function(e,t,n,i,o){var r=window.ace_editor,s=0;if(i==undefined)i=r.selection.getRange();if(1==t){var a=r.session.doc.getLine(i.start.row-1);0<i.start.column?(e="\n\n"+e,s=2):""!=a&&(e="\n"+e,s=1)}if(1==n){var l=r.session.doc.getLine(i.end.row+1);i.end.column<r.session.doc.getLine(i.end.row).length?e+="\n\n":""!=l&&(e+="\n")}r.session.replace(i,e),o!=undefined&&(totalVerticalOffset=o[0]+s+i.start.row,totalHorizontalOffset=o[1]+i.start.column,r.navigateTo(totalVerticalOffset,totalHorizontalOffset)),r.focus()},v.GollumEditor.Placeholder=v.GollumPlaceholder}(jQuery),function(r){r.constructLanguageDefinition=function(t){var n=r.extend(!0,{},r.DefaultLang,t);return Object.keys(t).forEach(function(e){"undefined"==typeof t[e]&&delete n[e]}),n};var n=function(e,t,n){r.GollumEditor.Dialog.init({title:e,fields:t,OK:function(e){r.GollumEditor.replaceSelection(n(e))}})};r.DefaultLang={"function-bold":{search:/([^\n]+)([\n\s]*)/g,replace:"**$1**$2"},"function-italic":{search:/([^\n]+)([\n\s]*)/g,replace:"_$1_$2"},"function-code":{search:/([^\n]+)([\n\s]*)/g,replace:"`$1`$2"},"function-hr":{append:"\n***\n"},"function-ul":{exec:function(e,t){for(var n="",i=t.split("\n"),o=0;o<i.length;o++)n+="* "+i[o]+"\n";n=n.substring(0,n.length-1),r.GollumEditor.replaceSelection(n,!0,!0)}},"function-ol":{line:function(e,t){return e.toString()+". "+t+"\n"},exec:function(e,t){for(var n="",i=t.split("\n"),o=0;o<i.length;o++)n+=this.line(o+1,i[o]);n=n.substring(0,n.length-1),r.GollumEditor.replaceSelection(n,!0,!0)}},"function-blockquote":{search:/(.+)([\n]?)/g,replace:"> $1$2",break_line:!0},"function-h1":{search:/(.+)([\n]?)/g,replace:"# $1$2",break_line:!0,whole_line:!0},"function-h2":{search:/(.+)([\n]?)/g,replace:"## $1$2",break_line:!0,whole_line:!0},"function-h3":{search:/(.+)([\n]?)/g,replace:"### $1$2",break_line:!0,whole_line:!0},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.text+"]("+e.href+")"),t},exec:function(e,t){n("Insert Link",[{id:"text",name:"Link Text",type:"text",defaultValue:t},{id:"href",name:"URL",type:"text"}],this.replace)}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="!["+e.alt+"]("+e.url+")"),t},exec:function(e,t){n("Insert Image",[{id:"url",name:"Image Url",type:"text",defaultValue:t},{id:"alt",name:"Alt Text",type:"text"}],this.replace)}},"function-critic-accept":{exec:function(e,t){var n=t.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$2").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");r.GollumEditor.replaceSelection(n)}},"function-critic-reject":{exec:function(e,t){var n=t.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$1").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");r.GollumEditor.replaceSelection(n)}}}}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-hr":undefined,"function-blockquote":{replace:"----\n$1$2\n----"},"function-h1":{replace:"= $1$2"},"function-h2":{replace:"== $1$2"},"function-h3":{replace:"=== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t=e.href+"["+e.text+"]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="image::"+e.url+"["+e.alt+"]"),t}}};e.GollumEditor.defineLanguage("asciidoc",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>AsciiDoc headers can be written in two ways: with differing underlines or with different indentation using <code>=</code> (equals sign). AsciiDoc supports headings 1-4. The editor will automatically use the <code>=</code> notation. To create a level one header, prefix your line with one <code>=</code>. Level two headers are created with <code>==</code> and so on.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>*</code> (asterisks). To display text as <em>italic</em>, wrap the text in <code>_</code> (underscores). To create <code>monospace</code> text, wrap the text in <code>`</code> (backtick)."},{menuName:"Scripts",data:"<p>Superscript and subscript is created the same way as other inline formats. To create superscript text, wrap your text in <code>^</code> (carats). To create subscript text, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Special Characters",data:"<p>AsciiDoc will automatically convert textual representations of commonly-used special characters. For example, <code>(R)</code> becomes &reg;, <code>(C)</code> becomes &copy; and <code>(TM)</code> becomes &trade;.</p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>AsciiDoc allows paragraphs to have optional titles or icons to denote special sections. To make a normal paragraph, simply add a line between blocks and a new paragraph will start. If you want to title your paragraphs, adda line prefixed by <code>.</code> (full stop). An example paragraph with optional title is displayed below:<br><br><code>.Optional Title<br><br>This is my paragraph. It is two sentences long.</code></p>"},{menuName:"Source Blocks",data:"<p>To create source blocks (long blocks of code), follow the same syntax as above but with an extra line denoting the inline source and lines of four dashes (<code>----</code>) delimiting the source block.. An example of Python source is below:<br><br><code>.python.py<br>[source,python]<br>----<br># i just wrote a comment in python<br># and maybe one more<br>----</code></p>"},{menuName:"Comment Blocks",data:"<p>Comment blocks are useful if you want to keep notes for yourself inline but do not want them displayed to the public. To create a comment block, simply wrap the paragraph in dividers with four slashes (<code>////</code>). An example comment block is below:<br><br><code>////<br>My comment block is here now<br><br>It can be multiple paragraphs. Really.<br>////</p>"},{menuName:"Quote Blocks",data:"<p>Quote blocks work much like comment blocks &mdash; simply create dividers using four underscores (<code>____</code>) around your quote. An example quote block is displayed below:<br><code>____<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>____</code></p>"}]},{menuName:"Macros",content:[{menuName:"Links",data:'<p>To create links to external pages, you can simply write the URI if you want the URI to link to itself. (i.e., <code>http://github.com/</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>. If you want different text to be displayed, simply append it to the end of the URI in between <code>[</code> (brackets.) For example, <code>http://github.com/[GitHub]</code> will be parsed as <a href="javascript:void(0);">GitHub</a>, with the URI pointing to <code>http://github.com</code>.</p>'},{menuName:"Images",data:"<p>Images in AsciiDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>"}]}];e.GollumEditor.defineHelp("asciidoc",n)}(jQuery),jQuery.GollumEditor.defineLanguage("bib",{}),function(e){var t={"function-italic":{replace:"//$1//$2"},"function-code":{replace:"{{{$1}}}$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":undefined,"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-h1":{replace:"== $1$2"},"function-h2":{replace:"=== $1$2"},"function-h3":{replace:"==== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="[["+e.href+"|"+e.text+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="{{"+e.url,""!=e.alt&&(t+="|"+e.alt),t+="}}"),t}}};e.GollumEditor.defineLanguage("creole",e.constructLanguageDefinition(t))}(jQuery),function(e){var t={"gollum-helpers":{"find-header-line":function(e,t){if(t.match(/(^[=]+$)/)||t.match(/(^[-]+$)/)){var n=e-1,i=window.ace_editor.getSession().getLine(n);return 0<=n&&!/^\s+$/.test(i)?[i,n]:null}return null}}};e.GollumEditor.defineLanguage("markdown",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p><p>If you want to create a line break, end a line with two or more spaces, then hit Return/Enter.</p>"},{menuName:"Headers",data:"<p>Markdown supports two header formats. The wiki editor uses the &ldquo;atx&rsquo;-style headers. Simply prefix your header text with the number of <code>#</code> characters to specify heading depth. For example: <code># Header 1</code>, <code>## Header 2</code> and <code>### Header 3</code> will be progressively smaller headers. You may end your headers with any number of hashes.</p>"},{menuName:"Blockquotes",data:"<p>Markdown creates blockquotes email-style by prefixing each line with the <code>&gt;</code>. This looks best if you decide to hard-wrap text and prefix each line with a <code>&gt;</code> character, but Markdown supports just putting <code>&gt;</code> before your paragraph.</p>"},{menuName:"Lists",data:"<p>Markdown supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p> List items can contain multiple paragraphs, however each paragraph must be indented by at least 4 spaces or a tab."},{menuName:"Code Blocks",data:"<p>Markdown wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Markdown will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"Horizontal rules are created by placing three or more hyphens, asterisks or underscores on a line by themselves. Spaces are allowed between the hyphens, asterisks or underscores."}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>Markdown has two types of links: <strong>inline</strong> and <strong>reference</strong>. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[GitHub]</code>.</p><p>To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., <code>[GitHub](http://github.com/)</code>). Relative paths are allowed in inline links.</p><p>To create a reference link, use two sets of square brackets. <code>[my internal link][internal-ref]</code> will link to the internal reference <code>internal-ref</code>.</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) and underscores (<code>_</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) or double underscores (<code>__</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Markdown will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (<code>!</code>). For example, if you want to link to an image at <code>http://github.com/unicorn.png</code> with the alternate text <code>My Unicorn</code>, you would write <code>![My Unicorn](http://github.com/unicorn.png)</code>.</p>"}]},{menuName:"Miscellaneous",content:[{menuName:"Automatic Links",data:'<p>If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in <code>&lt;</code> and <code>&gt;</code> to do so. For example, the link <a href="javascript:void(0);">http://github.com/</a> is easily produced by writing <code>&lt;http://github.com/&gt;</code>.</p>'},{menuName:"Escaping",data:"<p>If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Markdown will ignore the character directly after a backslash."},{menuName:"Emoji",data:'<p>See the <a href="http://emojione.com/demo/" target="_blank">EmojiOne demo</a> for all available emoji. To include one, wrap the emoji name in colons and use underscores instead of spaces (e.g. :heart: or :point_up:).'}]}];e.GollumEditor.defineHelp("markdown",n)}(jQuery),function(e){var t={"function-bold":{replace:"'''$1'''$2"},"function-italic":{replace:"''$1''$2"},"function-hr":{append:"\n---\n"},"function-code":{replace:"<code>$1</code>$2"},"function-ol":{link:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"<blockquote>\n$1$2\n</blockquote>"},"function-h1":{replace:"= $1$2 ="},"function-h2":{replace:"== $1$2 =="},"function-h3":{replace:"=== $1$2 ==="},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.href+" | "+e.text+"]"),t}}};e.GollumEditor.defineLanguage("mediawiki",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>MediaWiki headers are written with different indentation using <code>= Title =</code> (equals sign). MediaWiki supports headings 1-6.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>'''</code>. To display text as <em>italic</em>, wrap the text in <code>''</code>. To create <code>monospace</code> text, wrap the text in <code>&lt;code&gt;&lt;/code&gt;</code>."},{menuName:"Special Characters",data:"<p>Use HTML special characters, e.g. <code>&copy;</code> or <code>&euro;</code></p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tag <code><br /></code>.</p>"},{menuName:"Tables",data:'<p>Tables may be authored in wiki pages using either XHTML table elements directly, or using wikicode formatting to define the table. Wikitable syntax overview: <table cellpadding="5" cellspacing="0" border="1"><tr><td><pre> <code>{|</code></pre></td><td><b>table start</b></td></tr><tr><td><pre> <code>|+</code></pre></td><td>table <b>caption,</b> <i>optional;</i> only between <b>table start</b> and first <b>table row</b></td></tr><tr><td><pre> <code>|-</code></pre></td><td><b>table row,</b> <i>optional on first row</i> -- wiki engine assumes the first row</td></tr><tr><td><pre> <code>!</code></pre></td><td><b>table header</b> cell, <i>optional.</i> Consecutive <b>table header</b> cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).</td></tr><tr><td><pre> <code>|</code></pre></td><td><b>table data</b> cell, <i>required!</i> Consecutive <b>table data</b> cells may be added on same line separated by double marks (<code>||</code>) or start on new lines, each with its own single mark (<code>|</code>).</td></tr><tr><td><pre> <code>|}</code></pre></td><td><b>table end</b></td></tr></table></p>'}]},{menuName:"Macros",content:[{menuName:"Links",data:"<p>To create links to external pages, use single brackets, e.g. <code>[https://mediawiki.org MediaWiki]</code>. Internal links use double brackets: <code>[[Main Page]]</code>. To define the link text, use <code>[[Main Page | this is displayed]]</code> (note: the order of the URL/Page Name and the link text is reversed compared to Gollum pages in other markups).</p>"},{menuName:"Images",data:"<p>Use Gollum internal links, e.g. <code>[[sauron.jpg]]<code>, to insert images."}]}];e.GollumEditor.defineHelp("mediawiki",n)}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-italic":{replace:"/$1/$2"},"function-code":{replace:"=$1=$2"},"function-hr":undefined,"function-blockquote":{replace:"#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE"},"function-h1":{replace:"* $1$2"},"function-h2":{replace:"** $1$2"},"function-h3":{replace:"*** $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href?t="[["+e.href+"]["+e.text+"]]":e.href&&(t="[["+e.href+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&(t="[["+e.url+"]]"),t}}};e.GollumEditor.defineLanguage("org",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Simply prefix your header text with the number of <code>*</code> characters to specify heading depth. For example: <code>* Header 1</code>, <code>** Header 2</code> and <code>*** Header 3</code> will be progressively smaller headers.</p>"},{menuName:"Blockquotes",data:"<p>To create a blockquote, simple embed the text between <code>#+BEGIN_QUOTE</code> and <code>#+END_QUOTE</code>. An example quote block is displayed below:<br><code>#+BEGIN_QUOTE<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>#+END_QUOTE</code></p>"},{menuName:"Lists",data:"<p>Org-mode supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Code Blocks are similar to blockquote, except that <code>#+BEGIN_EXAMPLE</code> and <code>#+END_EXAMPLE</code> are used.</p>"},{menuName:"Tables",data:"<p>Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code>&lt;th&gt;</code> tag will be used to render it. </p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:'<p>To create links to external pages, you need to enclose the URI in double square brackets. (i.e., <code>[[http://github.com/]]</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[[http://github.com][GitHub]]</code>.</p>'},{menuName:"Emphasis",data:"<p>Forward slashes (<code>/</code>) are treated as emphasis and are wrapped with an <code>&lt;i&gt;</code> tag. Asterisks (<code>*</code>) are treated as bold using the <code>&lt;b&gt;</code> tag.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in equal signs (<code>=</code>). Orgmode will turn <code>=myFunction=</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.</p>"}]}];e.GollumEditor.defineHelp("org",n)}(jQuery),jQuery.GollumEditor.defineLanguage("txt",{}),function(e){var t={"function-bold":{replace:"B<$1>$2"},"function-italic":{replace:"I<$1>$2"},"function-hr":undefined,"function-code":{replace:"C<$1>$2"},"function-h1":{replace:"=head1 $1$2"},"function-h2":{replace:"=head2 $1$2"},"function-h3":{replace:"=head3 $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="L<"+e.text+"|"+e.href+">"),t}},"function-image":undefined,"function-ul":undefined,"function-ol":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("pod",e.constructLanguageDefinition(t));var n=[{menuName:"Command Paragraphs",content:[{menuName:"Headings",data:"<p>All command paragraphs start with <code>=</code> (equals sign).</p><p>To create headings 1 through 4, begin your command paragraph with <code>=headN</code>, where <code>N</code> is the number of the heading 1 through 4. For example, to make a first-order heading (the largest possible,) write <code>=head1</code>, then on the next line begin your paragraph that you want under the heading.</p>"},{menuName:"Beginning &amp; Ending",data:"<p>Perl pod blocks should begin with <code>=pod</code> and end with <code>=cut</code>, signifying to Pod parsers that the pod block has begun and ended. These command paragraphs only signal the beginning and end of a pod block.</p>"},{menuName:"Other Formats",data:"<p>pod also allows blocks in other formats, such as HTML or plain text. To create one of these blocks, use the <code>=format SYNTAX</code> command paragraph, where <code>SYNTAX</code> is the syntax of the block (e.g. <code>html</code> or <code>txt</code>). At the end of your block, use the <code>=end SYNTAX</code> block.</p>"},{menuName:"Encoding",data:"<p>If you are having encoding troubles, use the <code>=encoding ENC_TYPE</code> command, where <code>ENC_TYPE</code> is the encoding type (e.g. <code>utf8</code>, <code>koi8-r</code>). This will affect the entire document, not just the block below the command.</p>"}]},{menuName:"Formatting",content:[{menuName:"Text",data:"<p>Formatting text as <strong>bold</strong>, <em>italic</em> or <code>code</code> works in the <code>S&lt;word&gt;</code> syntax, where <code>S</code> is an abbreviation for the type of text you are trying to create. For example, <code>B&lt;my bold text&gt;</code> becomes <strong>my bold text</strong>, <code>I&lt;italic text&gt;</code> becomes <em>italic text</em> and <code>C&lt;code here()&gt;</code> becomes <code>code here()</code>.</p>"},{menuName:"Hyperlinks",data:"<p>Writing hyperlinks in pod is much like formatting text, using the same <code>S&lt;&gt;</code> syntax. Instead of <code>B</code>, <code>I</code> or <code>C</code>, use <code>L</code> to begin a hyperlink.</p><p>pod allows you to hyperlink to a <code>man</code> page, a Perl documentation page, or another web page. To link to a <code>man</code> or Perl documentation page, simply include the page name in the link (e.g. <code>L&lt;perl(1)&gt;</code> or <code>L&lt;Net::Ping&gt;</code>). If you want to link to a web page, separate the URL and the link text with a pipe (e.g. to link to github.com, write <code>L&lt;GitHub|http://github.com/&gt;</code>)."}]}];e.GollumEditor.defineHelp("pod",n)}(jQuery),function(e){var t={"function-code":undefined,"function-h1":undefined,"function-h2":undefined,"function-h3":undefined,"function-link":undefined,"function-image":undefined,"function-hr":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("rdoc",e.constructLanguageDefinition(t))}(jQuery),function(s){var o=function(e,t,n){var i="";i=e.length?e:"Title here",adornment=n.repeat(i.length),i=i+"\n"+adornment+"\n",s.GollumEditor.replaceSelection(i,!1,!1,t)},e={"function-bold":{replace:"**$1**$2"},"function-italic":{replace:"*$1*$2"},"function-code":{replace:"``$1``$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":{exec:function(e,t){for(var n=" ",i=t.split("\n"),o=0;o<i.length;o++)i[o]=n+i[o];var r=i.join("\n");s.GollumEditor.replaceSelection(r)}},"function-h1":{symbol:"=",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-h2":{symbol:"-",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-h3":{symbol:"~",exec:function(e,t,n,i){o(t,i,this.symbol)}},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="`"+e.text+" <"+e.href+">`_"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t=".. image:: "+e.url+"\n :alt: "+e.alt),t}},"gollum-helpers":{"find-header-line":function(e){var t=e-1,n=window.ace_editor.getSession().getLine(t);return 0<=t&&!/^\s+$/.test(n)?[n,t]:null}}};s.GollumEditor.defineLanguage("rst",s.constructLanguageDefinition(e));var t=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Rest uses overline/underline adornments to indicate headers. To create a header, underline your header text with adornment characters such as the <code>=, ~, +, ^</code> characters. Make sure that the adornment is of the same length (or longer) as the header text. Use a different adornment character to specify a different heading depth.</p>"},{menuName:"Blockquotes",data:"<p>Rest creates blockquotes using indentation. This looks best if you use four spaces per level of indentation.</p>"},{menuName:"Lists",data:"<p>Rest supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number, or use <code>#</code> for auto enumeration. To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Rest wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Rest will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"<p>Horizontal rules are created by placing four or more hyphens, asterisks or underscores on a line by themselves.</p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>To create an inline link, create a set of backticks, include the link title first, followed by the url in angled brackets (e.g., <code>`Python <http://www.python.org/>`_</code>).</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Rest will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:'<p>Rest image syntax is two dots, followed by a space, the word "image", two colons, another space, and the url: <code>.. image:: http://image.com/image.png</code>.</p>'}]},{menuName:"Miscellaneous",content:[{menuName:"Escaping",data:"<p>If you want to use a special Rest character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Rest will ignore the character directly after a backslash."}]}];s.GollumEditor.defineHelp("rst",t)}(jQuery),function(e){var t={"function-hr":undefined,"function-code":{replace:"bc. $1$2",whole_line:!0},"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"bq. $1$2"},"function-h1":{replace:"h1. $1$2"},"function-h2":{replace:"h2. $1$2"},"function-h3":{replace:"h3. $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t='"'+e.text+'":'+e.href),t}},"function-image":{replace:function(e){var t="";if(e.url){t="!"+e.url;return""!=e.alt&&(t+="("+e.alt+")"),t+="!"}}}};e.GollumEditor.defineLanguage("textile",e.constructLanguageDefinition(t));var n=[{menuName:"Phrase Modifiers",content:[{menuName:"Emphasis / Strength",data:"<p>To place emphasis or strength on inline text, simply place <code>_</code> (underscores) around the text for emphasis or <code>*</code> (asterisks) around the text for strength. In most browsers, <code>_mytext_</code> will appear as italics and <code>*mytext*</code> will appear as bold.</p><p>To force italics or bold, simply double the characters: <code>__mytext__</code> will appear italic and <code>**mytext**</code> will appear as bold text.</p>"},{menuName:"Citations / Editing",data:'<p>To display citations, wrap your text in <code>??</code> (two question marks).</p><p>To display edit marks such as deleted text (strikethrough) or inserted text (underlined text), wrap your text in <code>-</code> (minuses) or <code>+</code> (pluses). For example <code>-mytext-</code> will be rendered as <span style="text-decoration: line-through;">mytext</span> and <code>+mytext+</code> will be rendered as <span style="text-decoration: underline;">mytext</span></p>'},{menuName:"Superscript / Subscript",data:"<p>To display superscript, wrap your text in <code>^</code> (carets). To display subscript, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Code",data:"<p>To display monospace code, wrap your text in <code>@</code> (at symbol). For example, <code>@mytext@</code> will appear as <code>mytext</code>.</p>"},{menuName:"Acronyms",data:'<p>To create an acronym, suffix the acronym with the definition in parentheses. For example, <code>JS(JavaScript)</code> will be displayed as <abbr title="JavaScript">JS</abbr>.</p>'}]},{menuName:"Block Modifiers",content:[{menuName:"Headings",
24
24
  data:"<p>To display a heading in Textile, prefix your line of text with <code>hn.</code>, where <code>n</code> equals the heading size you want (1 is largest, 6 is smallest).</p>"},{menuName:"Paragraphs / Quotes",data:"<p>To create a new paragraph, prefix your first line of a block of text with <code>p.</code>.</p><p>To create a blockquote, make sure at least one blank line exists between your text and any surrounding text, and then prefix that block with <code>bq.</code> If you need to extend a blockquote to more than one text block, write <code>bq..</code> (note the two periods) and prefix your next normal paragraph with <code>p.</code></p>"},{menuName:"Code Blocks",data:"<p>Code blocks in textile are simply prefixed like any other block. To create a code block, place the beginning of the block on a separate line and prefix it with <code>bc.</code></p><p>To display a preformatted block, prefix the block with <code>pre.</code></p>"},{menuName:"Lists",data:"<p>To create ordered lists, prefix each line with <code>#</code>. To create unordered lists, prefix each line with <code>*</code>.</p>"}]},{menuName:"Links / Images",content:[{menuName:"Links",data:'<p>To display a link, put the text you want to display in quotes, then a colon (<code>:</code>), then the URL after the colon. For example <code>&quot;GitHub&quot;:http://github.com/</code> will appear as <a href="javascript:void(0);">GitHub</a>.</p>'},{menuName:"Images",data:"<p>To display an image, simply wrap the image&rsquo;s URL in <code>!</code> (exclamation points). If you want to link the image to a URL, you can blend the image and link syntax: place your image URL in the exclamation points and suffix that with a colon and your URL. For example, an image at <code>http://myurl/image.png</code> that should link to <code>http://myurl/</code> should be written as <code>!http://myurl/image.png!:http://myurl/</code>.</p>"}]}];e.GollumEditor.defineHelp("textile",n)}(jQuery);