tungsten 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/tungsten/_form_helpers.js +21 -0
  3. data/app/assets/javascripts/tungsten/code.js +20 -0
  4. data/app/assets/javascripts/tungsten/tungsten.js +4 -20
  5. data/app/assets/stylesheets/tungsten/_code-color.scss +0 -0
  6. data/app/assets/stylesheets/tungsten/_colors.yml +68 -4
  7. data/app/assets/stylesheets/tungsten/_index.scss +5 -0
  8. data/app/assets/stylesheets/tungsten/code/_codemirror.scss +56 -0
  9. data/app/assets/stylesheets/tungsten/code/_color.scss +58 -0
  10. data/app/assets/stylesheets/tungsten/code/_highlighted.scss +64 -0
  11. data/app/assets/stylesheets/tungsten/code/_index.scss +3 -0
  12. data/app/assets/stylesheets/tungsten/core/_buttons.scss +144 -0
  13. data/app/assets/stylesheets/tungsten/core/_cards.scss +90 -0
  14. data/app/assets/stylesheets/tungsten/core/_colors.scss +20 -0
  15. data/app/assets/stylesheets/tungsten/core/_globals.scss +172 -0
  16. data/app/assets/stylesheets/tungsten/core/_grid.scss +164 -0
  17. data/app/assets/stylesheets/tungsten/core/_index.scss +7 -13
  18. data/app/assets/stylesheets/tungsten/core/_layout.scss +47 -0
  19. data/app/assets/stylesheets/tungsten/core/_text.scss +219 -0
  20. data/app/assets/stylesheets/tungsten/form/_base.scss +235 -0
  21. data/app/assets/stylesheets/tungsten/form/_check-radio.scss +154 -0
  22. data/app/assets/stylesheets/tungsten/form/_check-switch.scss +104 -0
  23. data/app/assets/stylesheets/tungsten/form/_index.scss +4 -0
  24. data/app/assets/stylesheets/tungsten/form/_label-placeholder.scss +98 -0
  25. data/app/assets/stylesheets/tungsten/tungsten.scss +1 -3
  26. data/app/helpers/tungsten/card_helper.rb +76 -0
  27. data/app/helpers/tungsten/deployments_helper.rb +59 -0
  28. data/app/helpers/tungsten/form_helper.rb +509 -0
  29. data/app/helpers/tungsten/layout_helper.rb +7 -0
  30. data/app/helpers/tungsten/toggle_nav_helper.rb +84 -0
  31. data/app/views/layouts/tungsten/default.html.slim +47 -0
  32. data/app/views/shared/tungsten/_defs.html.slim +6 -0
  33. data/app/views/shared/tungsten/_footer.html.slim +2 -0
  34. data/app/views/shared/tungsten/_header.html.slim +2 -0
  35. data/config/data/deployments.yml +110 -0
  36. data/lib/tungsten.rb +26 -2
  37. data/lib/tungsten/helper.rb +4 -0
  38. data/lib/tungsten/version.rb +1 -1
  39. data/public/{tungsten-0.1.0.js → code-0.1.1.js} +43 -69
  40. data/public/code-0.1.1.js.gz +0 -0
  41. data/public/code-0.1.1.map.json +1 -0
  42. data/public/tungsten-0.1.1.css +1523 -0
  43. data/public/tungsten-0.1.1.css.gz +0 -0
  44. data/public/tungsten-0.1.1.js +79 -0
  45. data/public/tungsten-0.1.1.js.gz +0 -0
  46. data/public/tungsten-0.1.1.map.json +1 -0
  47. metadata +120 -16
  48. data/app/helpers/tungsten/application_helper.rb +0 -4
  49. data/app/views/layouts/tungsten/default.html.erb +0 -17
  50. data/public/tungsten-0.1.0.css +0 -17
  51. data/public/tungsten-0.1.0.css.gz +0 -0
  52. data/public/tungsten-0.1.0.js.gz +0 -0
  53. data/public/tungsten-0.1.0.map.json +0 -1
@@ -0,0 +1,7 @@
1
+ module Tungsten
2
+ module LayoutHelper
3
+ def template(name)
4
+ provide(:template, name)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,84 @@
1
+ module Tungsten
2
+ module ToggleNavHelper
3
+ class ToggleNav < Tungsten::Helper
4
+
5
+ def initialize(tag = :div, options = {})
6
+
7
+ if tag.is_a? Hash
8
+ options = tag
9
+ tag = :div
10
+ end
11
+
12
+ options[:tag] = tag
13
+
14
+ @options = options
15
+ @options[:name] ||= "radio-group-#{rand(10000)}-#{rand(10000)}"
16
+ @count = 0
17
+ end
18
+
19
+ def set_toggle_options( options )
20
+ options[:data] ||= {}
21
+ options[:data] = options[:data].merge({
22
+ show: options.delete(:show),
23
+ hide: options.delete(:hide),
24
+ add_class: options.delete(:add_class),
25
+ remove_class: options.delete(:remove_class)
26
+ })
27
+
28
+ options
29
+ end
30
+
31
+ def display(body)
32
+ options = @options
33
+ options.delete(:name)
34
+
35
+ display_tag options.delete(:tag), options, body
36
+ end
37
+
38
+ def display_tag(tag, options, body )
39
+ options[:class] = "toggle-nav #{@options[:class]}"
40
+ content_tag(tag, options) { body }
41
+ end
42
+
43
+ def option(label = nil, options = {}, &block)
44
+
45
+ if label.is_a? Hash
46
+ options = label
47
+ label = options.delete(:label)
48
+ end
49
+
50
+ checked = options.delete(:checked) || false
51
+ name = options.delete(:name) || @options[:name]
52
+ label_text = content_tag(:span, class: 'label-text') { label } if label
53
+
54
+ label_class = "#{options.delete(:class)} toggle-nav-label"
55
+ label_id = "#{name}_#{@count += 1}"
56
+
57
+ # The label should have an active class
58
+ # when the radio is active
59
+ options[:add_class] = "active; ##{label_id}& #{options[:add_clss]}"
60
+
61
+ options = set_toggle_options(options)
62
+
63
+ content_tag(:label, class: label_class, id: label_id ) {
64
+ concat radio_button_tag(name, true, checked, options)
65
+ concat capture(&block).html_safe if block_given?
66
+ concat label_text
67
+ }
68
+ end
69
+ end
70
+
71
+ class ToggleRow < ToggleNav
72
+ def display_tag(tag, options, body )
73
+
74
+ options[:class] = "toggle-row #{@options[:class]}"
75
+ label = content_tag(:span, class: 'toggle-row-label-text') { options.delete(:label) } if options[:label]
76
+
77
+ content_tag(tag, options) {
78
+ concat label
79
+ concat content_tag('div', class: 'toggle-row-panel') { body }
80
+ }
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,47 @@
1
+ doctype html
2
+ html
3
+ head
4
+
5
+ / Document Settings
6
+ meta charset="utf-8"
7
+ meta http-equiv="X-UA-Compatible" content="IE=edge"
8
+ = csrf_meta_tags
9
+
10
+ / Page Meta
11
+ title = Site.title
12
+ / Referrer
13
+ meta name="referrer" content="origin"
14
+
15
+ / Mobile
16
+ meta name="HandheldFriendly" content="True"
17
+ meta name="viewport" content="width=device-width, initial-scale=1.0"
18
+
19
+ / Favicon
20
+ - if content_for?(:favicon)
21
+ = yield :favicon
22
+
23
+ = javascript_tag "tungsten"
24
+ = yield :javascripts
25
+
26
+ = yield :stylesheets
27
+
28
+ / Head
29
+ = yield :head
30
+
31
+ body
32
+ = render "shared/tungsten/defs"
33
+
34
+ - if content_for?(:blank)
35
+
36
+ = yield :blank
37
+
38
+ - else
39
+
40
+ / Document header
41
+ = render "shared/tungsten/header"
42
+
43
+ / Document main
44
+ main role="main"= yield
45
+
46
+ / Document footer
47
+ = render "shared/tungsten/footer"
@@ -0,0 +1,6 @@
1
+ svg#svg-gradient-defs xmlns="http://www.w3.org/2000/svg" height="0" width="0" style="position: absolute; z-index: -1; visibility: hidden;"
2
+ defs
3
+ - sass_data('colors')['gradients'].each do |name, colors|
4
+ linearGradient id="#{name}-gradient-bg" gradientUnits="objectBoundingBox" gradientTransform="rotate(55)"
5
+ - colors.each_with_index do |color, index|
6
+ stop offset=index stop-color=color
@@ -0,0 +1,2 @@
1
+ - if content_for?(:footer)
2
+ footer= yield :footer
@@ -0,0 +1,2 @@
1
+ - if content_for?(:header)
2
+ footer= yield :header
@@ -0,0 +1,110 @@
1
+ deployments:
2
+ - :name: MongoDB
3
+ :slug: mongodb
4
+ :short_name: Mg
5
+ :topology:
6
+ - portal-2
7
+ - config
8
+ - storage
9
+ - storage
10
+ - backup
11
+ - arbiter
12
+
13
+ - :name: Redis
14
+ :slug: redis
15
+ :short_name: Rd
16
+ :topology:
17
+ - haproxy
18
+ - sentinel-memory
19
+ - sentinel-memory
20
+ - sentinel
21
+
22
+ - :name: PostgreSQL
23
+ :slug: postgresql
24
+ :short_name: Pg
25
+ :topology:
26
+ - haproxy
27
+ - storage
28
+ - storage
29
+ - arbiter
30
+
31
+ - :name: MySQL
32
+ :slug: mysql
33
+ :short_name: My
34
+ :topology:
35
+ - haproxy
36
+ - storage
37
+ - storage
38
+ - storage
39
+
40
+ - :name: Elasticsearch
41
+ :slug: elastic_search
42
+ :short_name: Es
43
+ :topology:
44
+ - haproxy-2
45
+ - storage
46
+ - storage
47
+ - storage
48
+
49
+ - :name: ScyllaDB
50
+ :slug: scylla
51
+ :short_name: Sc
52
+ :topology:
53
+ - haproxy-storage
54
+ - haproxy-storage
55
+ - haproxy-storage
56
+
57
+ - :name: JanusGraph
58
+ :slug: janusgraph
59
+ :short_name: Jg
60
+ :topology:
61
+ - haproxy-2
62
+ - memory
63
+ - memory
64
+ - storage
65
+ - storage
66
+ - storage
67
+
68
+ - :name: RabbitMQ
69
+ :slug: rabbitmq
70
+ :short_name: Ra
71
+ :topology:
72
+ - haproxy-2
73
+ - memory
74
+ - memory
75
+ - memory
76
+
77
+ - :max_storage_units: 8
78
+ :name: etcd
79
+ :slug: etcd
80
+ :short_name: Et
81
+ :topology:
82
+ - haproxy-2
83
+ - memory
84
+ - memory
85
+ - memory
86
+
87
+ - :name: RethinkDB
88
+ :slug: rethink
89
+ :short_name: Rt
90
+ :topology:
91
+ - portal
92
+ - storage
93
+ - storage
94
+ - storage
95
+
96
+ parts:
97
+ storage: Storage capsule
98
+ memory: Memory capsule
99
+ config: Config servers
100
+ backup: Dedicated Backup capsule
101
+ arbiter: Arbiter
102
+ portal-2: HAProxy + MongoS (2x)
103
+ portal: HAProxy + Rethink Proxy
104
+ haproxy-storage: HAProxy + Storage capsule
105
+ haproxy: HAProxy
106
+ haproxy-2: 2 HAProxies
107
+ sentinel: Redis Sentinel
108
+ sentinel-memory: Redis Sentinel + Memory Capsule
109
+ janusgraph:
110
+ storage: Storage Member (w/ ScyllaDB nodes)
data/lib/tungsten.rb CHANGED
@@ -1,12 +1,36 @@
1
- require 'cyborg'
1
+ Gem.loaded_specs['tungsten'].dependencies.each do |d|
2
+ require d.name
3
+ end
4
+
2
5
  require 'tungsten/version'
6
+ require 'tungsten/helper'
3
7
 
4
8
  module Tungsten
5
9
  class Plugin < Cyborg::Plugin
6
10
  end
7
11
  end
8
12
 
13
+ module Site
14
+ extend self
15
+
16
+ mattr_accessor :title
17
+ self.title = "Site title"
18
+
19
+ # Map vars from app into engine
20
+ def setup
21
+ yield self
22
+ end
23
+
24
+ def config_data
25
+ @config_data ||= Cyborg.config_data
26
+ end
27
+
28
+ def deployment_icon
29
+ @deployment_icon ||= Esvg.find_symbol('icons/deployment')
30
+ end
31
+ end
32
+
9
33
  Cyborg.register(Tungsten::Plugin, {
10
34
  gem: 'tungsten',
11
35
  engine: 'tungsten'
12
- })
36
+ })
@@ -0,0 +1,4 @@
1
+ module Tungsten
2
+ class Helper < BlockHelpers::Base
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Tungsten
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,118 +1,92 @@
1
1
  (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.tungsten = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- "use strict";!function(){function e(){document.querySelector("#esvg-svg-icons")||document.querySelector("body").insertAdjacentHTML("afterbegin",'<svg id="esvg-svg-icons" data-symbol-class="svg-symbol" data-prefix="svg" version="1.1" style="height:0;position:absolute"><symbol id="svg-deployment" data-name="deployment" viewBox="0 0 176 201" width="176" height="201" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M88 5.985l82.272 47.5v95L88 195.985l-82.272-47.5v-95L88 5.985z"/></symbol></svg>')}"interactive"==document.readyState&&e(),window.Turbolinks&&document.addEventListener("turbolinks:load",function(t){e()}),document.addEventListener("DOMContentLoaded",function(t){e()})}();
3
- },{}],2:[function(require,module,exports){
4
- "use strict";var toggler=require("compose-toggler"),formUp=require("compose-form-up"),toolbox=require("compose-toolbox"),event=toolbox.event,ajax=require("superagent"),highlighter=require("compose-code-highlighter"),loader=require("compose-loader");require("codemirror/mode/htmlmixed/htmlmixed"),require("codemirror/mode/slim/slim"),require("codemirror/mode/javascript/javascript"),require("codemirror/mode/css/css"),require("codemirror/mode/sql/sql"),require("codemirror/mode/php/php"),require("codemirror/mode/ruby/ruby"),require("codemirror/mode/shell/shell"),require("codemirror/mode/go/go"),require("codemirror/mode/python/python"),require("codemirror/mode/yaml/yaml"),require("codemirror/mode/clike/clike"),require("codemirror/addon/runmode/runmode"),require("codemirror/addon/edit/matchbrackets"),event.scroll.disablePointer(),require("compose-slider"),require("./_icons");var tungsten=toolbox.merge({ajax:ajax,form:formUp,toggler:toggler},toolbox);window.tungsten=module.exports=tungsten;
5
- },{"./_icons":1,"codemirror/addon/edit/matchbrackets":4,"codemirror/addon/runmode/runmode":5,"codemirror/mode/clike/clike":7,"codemirror/mode/css/css":8,"codemirror/mode/go/go":9,"codemirror/mode/htmlmixed/htmlmixed":10,"codemirror/mode/javascript/javascript":11,"codemirror/mode/php/php":12,"codemirror/mode/python/python":13,"codemirror/mode/ruby/ruby":14,"codemirror/mode/shell/shell":15,"codemirror/mode/slim/slim":16,"codemirror/mode/sql/sql":17,"codemirror/mode/yaml/yaml":19,"compose-code-highlighter":21,"compose-form-up":37,"compose-loader":40,"compose-slider":41,"compose-toggler":43,"compose-toolbox":44,"superagent":51}],3:[function(require,module,exports){
2
+ "use strict";var event=require("compose-toolbox").event,highlighter=require("compose-code-highlighter");require("codemirror/mode/htmlmixed/htmlmixed"),require("codemirror/mode/slim/slim"),require("codemirror/mode/javascript/javascript"),require("codemirror/mode/css/css"),require("codemirror/mode/sql/sql"),require("codemirror/mode/php/php"),require("codemirror/mode/ruby/ruby"),require("codemirror/mode/shell/shell"),require("codemirror/mode/go/go"),require("codemirror/mode/python/python"),require("codemirror/mode/yaml/yaml"),require("codemirror/mode/clike/clike"),require("codemirror/addon/runmode/runmode"),require("codemirror/addon/edit/matchbrackets"),event.change(highlighter.highlight);
3
+ },{"codemirror/addon/edit/matchbrackets":3,"codemirror/addon/runmode/runmode":4,"codemirror/mode/clike/clike":6,"codemirror/mode/css/css":7,"codemirror/mode/go/go":8,"codemirror/mode/htmlmixed/htmlmixed":9,"codemirror/mode/javascript/javascript":10,"codemirror/mode/php/php":11,"codemirror/mode/python/python":12,"codemirror/mode/ruby/ruby":13,"codemirror/mode/shell/shell":14,"codemirror/mode/slim/slim":15,"codemirror/mode/sql/sql":16,"codemirror/mode/yaml/yaml":18,"compose-code-highlighter":19,"compose-toolbox":35}],2:[function(require,module,exports){
6
4
  !function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define(n):t.bean=n()}(0,this,function(e,t){e=e||"bean",t=t||this;var n,r=window,o=t[e],i=/[^\.]*(?=\..*)\.|.*/,a=/\..*/,l="addEventListener",u=document||{},c=u.documentElement||{},s=c[l],p=s?l:"attachEvent",f={},h=Array.prototype.slice,g=function(e,t){return e.split(t||" ")},d=function(e){return"string"==typeof e},m=function(e){return"function"==typeof e},v=function(e){return"object"==typeof e},y=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);if(!v(t))return n;for(r in n)n.hasOwnProperty(r)&&t.hasOwnProperty(r)&&(n[r]=t[r]);return n},b=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},g("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll "+(s?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":""))),w=function(){var e="compareDocumentPosition"in c?function(e,t){return t.compareDocumentPosition&&16==(16&t.compareDocumentPosition(e))}:"contains"in c?function(e,t){return(t=9===t.nodeType||t===window?c:t)!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},t=function(t){var n=t.relatedTarget;return n?n!==this&&"xul"!==n.prefix&&!/document/.test(this.toString())&&!e(n,this):null==n};return{mouseenter:{base:"mouseover",condition:t},mouseleave:{base:"mouseout",condition:t},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),E=function(){var e=g("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName path"),t=e.concat(g("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement movementX movementY region")),n=t.concat(g("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),o=e.concat(g("char charCode key keyCode keyIdentifier keyLocation location isComposing code")),i=e.concat(g("data")),a=e.concat(g("touches targetTouches changedTouches scale rotation")),l=e.concat(g("data origin source")),s=e.concat(g("state")),p=/over|out/,f=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,o}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){return n.rightClick=3===e.which||2===e.button,n.pos={x:0,y:0},e.pageX||e.pageY?(n.clientX=e.pageX,n.clientY=e.pageY):(e.clientX||e.clientY)&&(n.clientX=e.clientX+u.body.scrollLeft+c.scrollLeft,n.clientY=e.clientY+u.body.scrollTop+c.scrollTop),p.test(r)&&(n.relatedTarget=e.relatedTarget||e[("mouseover"==r?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return n}},{reg:/^text/i,fix:function(){return i}},{reg:/^touch|^gesture/i,fix:function(){return a}},{reg:/^message$/i,fix:function(){return l}},{reg:/^popstate$/i,fix:function(){return s}},{reg:/.*/,fix:function(){return e}}],h={},d=function(e,t,n){if(arguments.length&&(e=e||((t.ownerDocument||t.document||t).parentWindow||r).event,this.originalEvent=e,this.isNative=n,this.isBean=!0,e)){var o,i,a,l,u,c=e.type,s=e.target||e.srcElement;if(this.target=s&&3===s.nodeType?s.parentNode:s,n){if(!(u=h[c]))for(o=0,i=f.length;o<i;o++)if(f[o].reg.test(c)){h[c]=u=f[o].fix;break}for(l=u(e,this,c),o=l.length;o--;)!((a=l[o])in this)&&a in e&&(this[a]=e[a])}}};return d.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},d.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},d.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},d.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},d.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},d.prototype.clone=function(e){var t=new d(this,this.element,this.isNative);return t.currentTarget=e,t},d}(),T=function(e,t){return s||t||e!==u&&e!==r?e:c},D=function(){var e=function(e,t,n,r){var o=function(n,o){return t.apply(e,r?h.call(o,n?0:1).concat(r):o)},i=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},a=n?function(e){var t=i(e,this);if(n.apply(t,arguments))return e&&(e.currentTarget=t),o(e,arguments)}:function(e){return t.__beanDel&&(e=e.clone(i(e))),o(e,arguments)};return a.__beanDel=t.__beanDel,a},t=function(t,n,r,o,i,a,l){var u,c=w[n];"unload"==n&&(r=C(N,t,n,r,o)),c&&(c.condition&&(r=e(t,r,c.condition,a)),n=c.base||n),this.isNative=u=b[n]&&!!t[p],this.customType=!s&&!u&&n,this.element=t,this.type=n,this.original=o,this.namespaces=i,this.eventType=s||u?n:"propertychange",this.target=T(t,u),this[p]=!!this.target[p],this.root=l,this.handler=e(t,r,null,a)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},t}(),P=function(){var e={},t=function(n,r,o,i,a,l){var u=a?"r":"$";if(r&&"*"!=r){var c,s=0,p=e[u+r],f="*"==n;if(!p)return;for(c=p.length;s<c;s++)if((f||p[s].matches(n,o,i))&&!l(p[s],p,s,r))return}else for(var h in e)h.charAt(0)==u&&t(n,h.substr(1),o,i,a,l)};return{has:function(t,n,r,o){var i,a=e[(o?"r":"$")+n];if(a)for(i=a.length;i--;)if(!a[i].root&&a[i].matches(t,r,null))return!0;return!1},get:function(e,n,r,o){var i=[];return t(e,n,r,null,o,function(e){return i.push(e)}),i},put:function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},del:function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,0===n.length&&delete e[(t.root?"r":"$")+t.type],!1})},entries:function(){var t,n=[];for(t in e)"$"==t.charAt(0)&&(n=n.concat(e[t]));return n}}}(),x=function(e){n=arguments.length?e:u.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},k=function(e,t){if(s||!t||!e||e.propertyName=="_on"+t){var n=P.get(this,t||e.type,null,!1),r=n.length,o=0;for(e=new E(e,this,!0),t&&(e.type=t);o<r&&!e.isImmediatePropagationStopped();o++)n[o].removed||n[o].handler.call(this,e)}},_=s?function(e,t,n,r,o){e[n?l:"removeEventListener"](t,k,o)}:function(e,t,n,r){var o;n?(P.put(o=new D(e,r||t,function(t){k.call(e,t,r)},k,null,null,!0)),r&&null==e["_on"+r]&&(e["_on"+r]=0),o.target.attachEvent("on"+o.eventType,o.handler)):(o=P.get(e,r||t,k,!0)[0])&&(o.target.detachEvent("on"+o.eventType,o.handler),P.del(o))},C=function(e,t,n,r,o){return function(){r.apply(this,arguments),e(t,n,o)}},N=function(e,t,n,r,o){var i,l,u=t&&t.replace(a,""),c=P.get(e,u,null,!1),s={};for(i=0,l=c.length;i<l;i++)n&&c[i].original!==n||!c[i].inNamespaces(r)||(P.del(c[i]),!s[c[i].eventType]&&c[i][p]&&(s[c[i].eventType]={t:c[i].eventType,c:c[i].type}));for(i in s)P.has(e,s[i].t,null,!1)||_(e,s[i].t,!1,s[i].c,o)},S=function(e,t){var r=function(t,r){for(var o,i=d(e)?n(e,r):e;t&&t!==r;t=t.parentNode)for(o=i.length;o--;)if(i[o]===t)return t},o=function(e){var n=r(e.target,this);n&&t.apply(n,arguments)};return o.__beanDel={ft:r,selector:e},o},X=s?function(e,t,n){var o=u.createEvent(e?"HTMLEvents":"UIEvents");o[e?"initEvent":"initUIEvent"](t,!0,!0,r,1),n.dispatchEvent(o)}:function(e,t,n){n=T(n,e),e?n.fireEvent("on"+t,u.createEventObject()):n["_on"+t]++},Y=function(e,t,n){var r,o,l,u,c=d(t),s={useCapture:!1},p=y(s,arguments[arguments.length-1]);if(c&&t.indexOf(" ")>0){for(t=g(t),u=t.length;u--;)Y(e,t[u],n);return e}if(o=c&&t.replace(a,""),o&&w[o]&&(o=w[o].base),!t||c)(l=c&&t.replace(i,""))&&(l=g(l,".")),N(e,o,n,l,p.useCapture);else if(m(t))N(e,null,t,null,p.useCapture);else for(r in t)t.hasOwnProperty(r)&&Y(e,r,t[r]);return e},I=function(e,t,n,r){var o,l,u,c,s,d,v,b,w={useCapture:!1};{if(void 0!==n||"object"!=typeof t){for(m(n)?(s=h.call(arguments,3),r=o=n):(o=r,s=h.call(arguments,4),r=S(n,o)),b=y(w,s[s.length-1]),u=g(t),this===f&&(r=C(Y,e,t,r,o)),c=u.length;c--;)v=P.put(d=new D(e,u[c].replace(a,""),r,o,g(u[c].replace(i,""),"."),s,!1)),d[p]&&v&&_(e,d.eventType,!0,d.customType,b.useCapture);return e}for(l in t)t.hasOwnProperty(l)&&I.call(this,e,l,t[l])}},O=function(e,t,n,r,o){return I.apply(null,d(n)?[e,n,t,r].concat(arguments.length>3?h.call(arguments,4):[]):h.call(arguments))},L=function(){return I.apply(f,arguments)},M=function(e,t,n){var r,o,l,u,c,s=g(t);for(r=s.length;r--;)if(t=s[r].replace(a,""),(u=s[r].replace(i,""))&&(u=g(u,".")),u||n||!e[p])for(c=P.get(e,t,null,!1),n=[!1].concat(n),o=0,l=c.length;o<l;o++)c[o].inNamespaces(u)&&c[o].handler.apply(e,n);else X(b[t],t,e);return e},$=function(e,t,n){for(var r,o,i=P.get(t,n,null,!1),a=i.length,l=0;l<a;l++)i[l].original&&(r=[e,i[l].type],(o=i[l].handler.__beanDel)&&r.push(o.selector),r.push(i[l].original),I.apply(null,r));return e},A={on:I,add:O,one:L,off:Y,remove:Y,clone:$,fire:M,Event:E,setSelectorEngine:x,noConflict:function(){return t[e]=o,this}};if(r.attachEvent){var K=function(){var e,t=P.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&Y(t[e].element,t[e].type);r.detachEvent("onunload",K),r.CollectGarbage&&r.CollectGarbage()};r.attachEvent("onunload",K)}return x(),A});
7
- },{}],4:[function(require,module,exports){
5
+ },{}],3:[function(require,module,exports){
8
6
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r){var i=e.getLineHandle(t.line),o=t.ch-1,l=r&&r.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var f=!l&&o>=0&&c[i.text.charAt(o)]||c[i.text.charAt(++o)];if(!f)return null;var s=">"==f.charAt(1)?1:-1;if(r&&r.strict&&s>0!=(o==t.ch))return null;var u=e.getTokenTypeAt(a(t.line,o+1)),h=n(e,a(t.line,o+(s>0?1:0)),s,u||null,r);return null==h?null:{from:a(t.line,o),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:s>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,f=[],s=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,u=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),h=t.line;h!=u;h+=n){var m=e.getLine(h);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(h==t.line&&(d=t.ch-(n<0?1:0));d!=g;d+=n){var p=m.charAt(d);if(s.test(p)&&(void 0===r||e.getTokenTypeAt(a(h,d+1))==r)){var v=c[p];if(">"==v.charAt(1)==n>0)f.push(p);else{if(!f.length)return{pos:a(h,d),ch:p};f.pop()}}}}}return h-n!=(n>0?e.lastLine():e.firstLine())&&null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],l=e.listSelections(),f=0;f<l.length;f++){var s=l[f].empty()&&t(e,l[f].head,r);if(s&&e.getLine(s.from.line).length<=i){var u=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";c.push(e.markText(s.from,a(s.from.line,s.from.ch+1),{className:u})),s.to&&e.getLine(s.to.line).length<=i&&c.push(e.markText(s.to,a(s.to.line,s.to.ch+1),{className:u}))}}if(c.length){o&&e.state.focused&&e.focus();var h=function(){e.operation(function(){for(var e=0;e<c.length;e++)c[e].clear()})};if(!n)return h;setTimeout(h,800)}}function i(e){e.operation(function(){l&&(l(),l=null),l=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",i),l&&(l(),l=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return(r||"boolean"==typeof n)&&(r?(r.strict=n,n=r):n=n?{strict:!0}:null),t(this,e,n)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})});
9
- },{"../../lib/codemirror":6}],5:[function(require,module,exports){
7
+ },{"../../lib/codemirror":5}],4:[function(require,module,exports){
10
8
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),d=/MSIE \d/.test(navigator.userAgent),i=d&&(null==document.documentMode||document.documentMode<9);if(r.appendChild){var c=o&&o.tabSize||e.defaults.tabSize,l=r,u=0;l.innerHTML="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(i?"\r":e)),void(u=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),u+=e.length-r;break}u+=o-r,n+=e.slice(r,o);var a=c-u%c;u+=a;for(var d=0;d<a;++d)n+=" ";r=o+1}if(t){var f=l.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else l.appendChild(document.createTextNode(n))}}for(var f=e.splitLines(t),s=o&&o.state||e.startState(a),p=0,m=f.length;p<m;++p){p&&r("\n");var v=new e.StringStream(f[p]);for(!v.string&&a.blankLine&&a.blankLine(s);!v.eol();){var b=a.token(v,s);r(v.current(),b,p,v.start,s),v.start=v.pos}}}});
11
- },{"../../lib/codemirror":6}],6:[function(require,module,exports){
9
+ },{"../../lib/codemirror":5}],5:[function(require,module,exports){
12
10
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,n,i){var o=r(e,t,n,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function l(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function s(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function a(t,n){for(var r=t.split(" "),i=0;i<r.length;i++)r[i]&&!e(r[i]).test(n)&&(n+=" "+r[i]);return n}function u(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function h(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=n-l%n,o=s+1}}function f(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function d(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function p(e){for(;Bl.length<=e;)Bl.push(g(Bl)+" ");return Bl[e]}function g(e){return e[e.length-1]}function v(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function m(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function y(){}function b(e,t){var n;return Object.create?n=Object.create(e):(y.prototype=e,n=new y),t&&c(t,n),n}function w(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Gl.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function S(e){return e.charCodeAt(0)>=768&&Ul.test(e)}function L(e,t,n){for(;(n<0?t>0:t<e.length)&&S(e.charAt(t));)t+=n;return t}function k(e,t,n){for(;;){if(Math.abs(t-n)<=1)return e(t)?t:n;var r=Math.floor((t+n)/2);e(r)?n=r:t=r}}function M(e,t,n){var o=this;this.input=n,o.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=r("div",null,"CodeMirror-cursors"),o.measure=r("div",null,"CodeMirror-measure"),o.lineMeasure=r("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=r("div",[l],null,"position: relative"),o.sizer=r("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=r("div",null,null,"position: absolute; height: "+El+"px; width: 1px;"),o.gutters=r("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=r("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=r("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),hl&&fl<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),dl||sl&&Cl||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function T(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function N(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function O(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function A(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function W(e){if(null==e.parent)return null;for(var t=e.parent,n=f(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function D(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l],a=s.height;if(t<a)break;t-=a}return n+l}function H(e,t){return t>=e.first&&t<e.first+e.size}function F(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function E(e,t,n){if(void 0===n&&(n=null),!(this instanceof E))return new E(e,t,n);this.line=e,this.ch=t,this.sticky=n}function P(e,t){return e.line-t.line||e.ch-t.ch}function I(e,t){return e.sticky==t.sticky&&0==P(e,t)}function R(e){return E(e.line,e.ch)}function z(e,t){return P(e,t)<0?t:e}function B(e,t){return P(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function U(e,t){if(t.line<e.first)return E(e.first,0);var n=e.first+e.size-1;return t.line>n?E(n,T(e,n).text.length):V(t,T(e,t.line).text.length)}function V(e,t){var n=e.ch;return null==n||n>t?E(e.line,t):n<0?E(e.line,0):e}function K(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=U(e,t[r]);return n}function j(){Vl=!0}function X(){Kl=!0}function Y(e,t,n){this.marker=e,this.from=t,this.to=n}function _(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function $(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function q(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Y(l,o.from,a?null:o.to))}}return r}function Q(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Y(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return r}function J(e,t){if(t.full)return null;var n=H(e,t.from.line)&&T(e,t.from.line).markedSpans,r=H(e,t.to.line)&&T(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==P(t.from,t.to),s=Z(n,i,l),a=Q(r,o,l),u=1==t.text.length,c=g(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=_(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var v=a[p];if(null!=v.to&&(v.to+=c),null==v.from){var m=_(s,v.marker);m||(v.from=c,u&&(s||(s=[])).push(v))}else v.from+=c,u&&(s||(s=[])).push(v)}s&&(s=ee(s)),a&&a!=s&&(a=ee(a));var y=[s];if(!u){var b,w=t.text.length-2;if(w>0&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(b||(b=[])).push(new Y(s[x].marker,null,null));for(var C=0;C<w;++C)y.push(b);y.push(a)}return y}function ee(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function te(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=f(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(P(u.to,s.from)<0||P(u.from,s.to)>0)){var c=[a,1],h=P(u.from,s.from),d=P(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}function ne(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function re(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function le(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=P(r.from,i.from)||ie(e)-ie(t);if(o)return-o;var l=P(r.to,i.to)||oe(e)-oe(t);return l||t.id-e.id}function se(e,t){var n,r=Kl&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||le(n,i.marker)<0)&&(n=i.marker);return n}function ae(e){return se(e,!0)}function ue(e){return se(e,!1)}function ce(e,t,n,r,i){var o=T(e,t),l=Kl&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=P(u.from,n)||ie(a.marker)-ie(i),h=P(u.to,r)||oe(a.marker)-oe(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?P(u.to,n)>=0:P(u.to,n)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?P(u.from,r)<=0:P(u.from,r)<0)))return!0}}}function he(e){for(var t;t=ae(e);)e=t.find(-1,!0).line;return e}function fe(e){for(var t;t=ue(e);)e=t.find(1,!0).line;return e}function de(e){for(var t,n;t=ue(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function pe(e,t){var n=T(e,t),r=he(n);return n==r?t:W(r)}function ge(e,t){if(t>e.lastLine())return t;var n,r=T(e,t);if(!ve(e,r))return t;for(;n=ue(r);)r=n.find(1,!0).line;return W(r)+1}function ve(e,t){var n=Kl&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&me(e,t,r))return!0}}function me(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return me(e,r.line,_(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&me(e,t,i))return!0}function ye(e){e=he(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==n)break;t+=s.height}return t}function be(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=ae(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=ue(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function we(e){var t=e.display,n=e.doc;t.maxLine=T(n,n.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=be(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function xe(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function Ce(e,t,n){var r;jl=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:jl=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:jl=i)}return null!=r?r:jl}function Se(e,t){var n=e.order;return null==n&&(n=e.order=Xl(e.text,t)),n}function Le(e,t,n){var r=L(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ke(e,t,n){var r=Le(e,t.ch,n);return null==r?null:new E(t.line,r,n<0?"after":"before")}function Me(e,t,n,r,i){if(e){var o=Se(n,t.doc.direction);if(o){var l,s=i<0?g(o):o[0],a=i<0==(1==s.level),u=a?"after":"before";if(s.level>0){var c=Zt(t,n);l=i<0?n.text.length-1:0;var h=Qt(t,c,l).top;l=k(function(e){return Qt(t,c,e).top==h},i<0==(1==s.level)?s.from:s.to-1,l),"before"==u&&(l=Le(n,l,1))}else l=i<0?s.to:s.from;return new E(r,l,u)}}return new E(r,i<0?n.text.length:0,i<0?"before":"after")}function Te(e,t,n,r){var i=Se(t,e.doc.direction);if(!i)return ke(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Ce(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return ke(t,n,r);var s,a=function(e,n){return Le(t,e instanceof E?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(s=s||Zt(e,t),mn(e,t,s,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?a(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var h=1==l.level==r<0,f=a(n,h?1:-1);if(null!=f&&(h?f<=l.to&&f<=c.end:f>=l.from&&f>=c.begin)){var d=h?"before":"after";return new E(n.line,f,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new E(n.line,a(e,1),"before"):new E(n.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?r.begin:a(r.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),r.begin<=u&&u<r.end)return o(u,s)}},g=p(o+r,r,c);if(g)return g;var v=r>0?c.end:a(c.begin,-1);return null==v||r>0&&v==t.text.length||!(g=p(r>0?0:i.length-1,r,u(v)))?null:g}function Ne(e,t){return e._handlers&&e._handlers[t]||Yl}function Oe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=f(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ae(e,t){var n=Ne(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function We(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,n||t.type,e,t),Ie(t)||t.codemirrorIgnore}function De(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==f(n,t[r])&&n.push(t[r])}function He(e,t){return Ne(e,t).length>0}function Fe(e){e.prototype.on=function(e,t){_l(this,e,t)},e.prototype.off=function(e,t){Oe(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ie(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Re(e){Ee(e),Pe(e)}function ze(e){return e.target||e.srcElement}function Be(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Sl&&e.ctrlKey&&1==t&&(t=3),t}function Ge(e){if(null==Hl){var t=r("span","​");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Hl=t.offsetWidth<=1&&t.offsetHeight>2&&!(hl&&fl<8))}var i=Hl?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ue(e){if(null!=Fl)return Fl;var r=n(e,document.createTextNode("AخA")),i=Tl(r,0,1).getBoundingClientRect(),o=Tl(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Fl=o.right-i.right<3)}function Ve(e){if(null!=Jl)return Jl;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=Tl(t,0,1).getBoundingClientRect();return Jl=Math.abs(i.left-o.left)>1}function Ke(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),es[e]=t}function je(e,t){ts[e]=t}function Xe(e){if("string"==typeof e&&ts.hasOwnProperty(e))e=ts[e];else if(e&&"string"==typeof e.name&&ts.hasOwnProperty(e.name)){var t=ts[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=Xe(t);var n=es[t.name];if(!n)return Ye(e,"text/plain");var r=n(e,t);if(ns.hasOwnProperty(t.name)){var i=ns[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}function _e(e,t){c(t,ns.hasOwnProperty(e)?ns[e]:ns[e]={})}function $e(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function qe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ze(e,t,n){return!e.startState||e.startState(t,n)}function Qe(e,t,n,r){var i=[e.state.modeGen],o={};lt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var l=n.state,s=0;s<e.state.overlays.length;++s)!function(r){var l=e.state.overlays[r],s=1,a=0;n.state=!0,lt(e,t.text,l.mode,n,function(e,t){for(var n=s;a<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,a=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o)}(s);return n.state=l,{styles:i,classes:o.bgClass||o.textClass?o:null}}function Je(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=et(e,W(t)),i=t.text.length>e.options.maxHighlightLength&&$e(e.doc.mode,r.state),o=Qe(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function et(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new os(r,!0,t);var o=st(e,t,n),l=o>r.first&&T(r,o-1).stateAfter,s=l?os.fromSaved(r,l,o):new os(r,Ze(r.mode),o);return r.iter(o,t,function(n){tt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function tt(e,t,n,r){var i=e.doc.mode,o=new rs(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&nt(i,n.state);!o.eol();)rt(i,o,n.state),o.start=o.pos}function nt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=qe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function rt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=qe(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,n,r){var i,o=e.doc,l=o.mode;t=U(o,t);var s,a=T(o,t.line),u=et(e,t.line,n),c=new rs(a.text,e.options.tabSize,u);for(r&&(s=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=rt(l,c,u.state),r&&s.push(new ls(c,i,$e(o.mode,u.state)));return r?s:new ls(c,i,u.state)}function ot(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function lt(e,t,n,r,i,o,l){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new rs(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&ot(nt(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&tt(e,t,r,h.pos),h.pos=t.length,a=null):a=ot(rt(n,h,r.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)u=Math.min(h.start,u+5e3),i(u,c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}function st(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=T(o,s-1),u=a.stateAfter;if(u&&(!n||s+(u instanceof is?u.lookAhead:0)<=o.modeFrontier))return s;var c=h(a.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function at(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=T(e,r).stateAfter;if(i&&(!(i instanceof is)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}function ut(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),ne(e),re(e,n);var i=r?r(e):1;i!=e.height&&A(e,i)}function ct(e){e.parent=null,ne(e)}function ht(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?cs:us;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ft(e,t){var n=i("span",null,null,dl?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(hl||dl)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,s=void 0;r.pos=0,r.addToken=pt,Ue(e.display.measure)&&(s=Se(l,e.doc.direction))&&(r.addToken=vt(r.addToken,s)),r.map=[];yt(l,r,Je(e,l,t!=e.display.externalMeasured&&W(l))),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=a(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=a(l.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ge(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(dl){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=a(r.pre.className,r.textClass||"")),r}function dt(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,n,i,o,l,s){if(t){var a,u=e.splitSpaces?gt(t,e.trailingSpace):t,c=e.cm.state.specialChars,h=!1;if(c.test(t)){a=document.createDocumentFragment();for(var f=0;;){c.lastIndex=f;var d=c.exec(t),g=d?d.index-f:t.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));hl&&fl<9?a.appendChild(r("span",[v])):a.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!d)break;f+=g+1;var m=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=a.appendChild(r("span",p(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(m=a.appendChild(r("span","\r"==d[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",d[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(d[0]),m.setAttribute("cm-text",d[0]),hl&&fl<9?a.appendChild(r("span",[m])):a.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,a=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,a),hl&&fl<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||i||o||h||s){var w=n||"";i&&(w+=i),o&&(w+=o);var x=r("span",[a],w,s);return l&&(x.title=l),e.content.appendChild(x)}e.content.appendChild(a)}}function gt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function vt(e,t){return function(n,r,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var h=void 0,f=0;f<t.length&&(h=t[f],!(h.to>u&&h.from<=u));f++);if(h.to>=c)return e(n,r,i,o,l,s,a);e(n,r.slice(0,h.to-u),i,o,null,s,a),o=null,r=r.slice(h.to-u),u=h.to}}}function mt(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function yt(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?y.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||le(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!f||f.from==p)for(var L=0;L<y.length;++L)mt(t,0,y[L]);if(f&&(f.from||0)==p){if(mt(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var k=Math.min(d,m);;){if(v){var M=p+v.length;if(!f){var T=M>k?v.slice(0,k-p):v;t.addToken(t,T,l?l+a:a,c,p+T.length==m?u:"",h,s)}if(M>=k){v=v.slice(k-p),p=k;break}p=M,c=""}v=i.slice(o,o=n[g++]),l=ht(n[g++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,i.slice(o,o=n[N]),ht(n[N+1],t.cm.options))}function bt(e,t,n){this.line=t,this.rest=de(t),this.size=this.rest?W(g(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ve(e,t)}function wt(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new bt(e.doc,T(e.doc,o),o);r=o+l.size,i.push(l)}return i}function xt(e){hs?hs.ops.push(e):e.ownsGroup=hs={ops:[e],delayedCallbacks:[]}}function Ct(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function St(e,t){var n=e.ownsGroup;if(n)try{Ct(n)}finally{hs=null,t(n)}}function Lt(e,t){var n=Ne(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);hs?r=hs.delayedCallbacks:fs?r=fs:(r=fs=[],setTimeout(kt,0));for(var o=0;o<n.length;++o)!function(e){r.push(function(){return n[e].apply(null,i)})}(o)}}function kt(){var e=fs;fs=null;for(var t=0;t<e.length;++t)e[t]()}function Mt(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Dt(e,t,n,r):"class"==o?Wt(e,t):"widget"==o&&Ht(e,t,r)}t.changes=null}function Tt(e){return e.node==e.text&&(e.node=r("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),hl&&fl<8&&(e.node.style.zIndex=2)),e.node}function Nt(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=Tt(t);t.background=i.insertBefore(r("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Ot(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ft(e,t)}function At(e,t){var n=t.text.className,r=Ot(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Wt(e,t)):n&&(t.text.className=n)}function Wt(e,t){Nt(e,t),t.line.wrapClass?Tt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Dt(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Tt(t);t.gutterBackground=r("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var l=t.line.gutterMarkers;if(e.options.lineNumbers||l){var s=Tt(t),a=t.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||l&&l["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(r("div",F(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l)for(var u=0;u<e.options.gutters.length;++u){var c=e.options.gutters[u],h=l.hasOwnProperty(c)&&l[c];h&&a.appendChild(r("div",[h],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function Ht(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);Et(e,t,n)}function Ft(e,t,n,r){var i=Ot(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wt(e,t),Dt(e,t,n,r),Et(e,t,r),t.node}function Et(e,t,n){if(Pt(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Pt(e,t.rest[r],t,n,!1)}function Pt(e,t,n,i,o){if(t.widgets)for(var l=Tt(n),s=0,a=t.widgets;s<a.length;++s){var u=a[s],c=r("div",[u.node],"CodeMirror-linewidget");u.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),It(u,c,n,i),e.display.input.setUneditable(c),o&&u.above?l.insertBefore(c,n.gutter||n.text):l.appendChild(c),Lt(u,"redraw")}}function It(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Rt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,r("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function zt(e,t){for(var n=ze(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Bt(e){return e.lineSpace.offsetTop}function Gt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ut(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=n(e.measure,r("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Vt(e){return El-e.display.nativeBarWidth}function Kt(e){return e.display.scroller.clientWidth-Vt(e)-e.display.barWidth}function jt(e){return e.display.scroller.clientHeight-Vt(e)-e.display.barHeight}function Xt(e,t,n){var r=e.options.lineWrapping,i=r&&Kt(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Yt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(W(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function _t(e,t){t=he(t);var r=W(t),i=e.display.externalMeasured=new bt(e.doc,t,r);i.lineN=r;var o=i.built=ft(e,i);return i.text=o.pre,
13
11
  n(e.display.lineMeasure,o.pre),i}function $t(e,t,n,r){return Qt(e,Zt(e,t),n,r)}function qt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Mn(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Zt(e,t){var n=W(t),r=qt(e,n);r&&!r.text?r=null:r&&r.changes&&(Mt(e,r,n,xn(e)),e.curOp.forceUpdate=!0),r||(r=_t(e,t));var i=Yt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Qt(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xt(e,t.view,t.rect),t.hasHeights=!0),o=tn(e,t,n,r),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Jt(e,t,n){for(var r,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?(i=t-s,o=i+1):(u==e.length-3||t==a&&e[u+3]>t)&&(o=a-s,i=o-1,t>=a&&(l="right")),null!=i){if(r=e[u+2],s==a&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],l="left";if("right"==n&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function en(e,t){var n=ds;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function tn(e,t,n,r){var i,o=Jt(t.map,n,r),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;s&&S(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&S(t.line.text.charAt(o.coverStart+a));)++a;if(i=hl&&fl<9&&0==s&&a==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():en(Tl(l,s,a).getClientRects(),r),i.left||i.right||0==s)break;a=s,s-=1,u="right"}hl&&fl<11&&(i=nn(e.display.measure,i))}else{s>0&&(u=r="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(hl&&fl<9&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+wn(e.display),top:f.top,bottom:f.bottom}:ds}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;m<v.length-1&&!(g<v[m]);m++);var y=m?v[m-1]:0,b=v[m],w={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=p),w}function nn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ve(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function on(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)rn(e.display.view[n])}function ln(e){on(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function sn(){return gl&&xl?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function an(){return gl&&xl?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function un(e,t,n,r,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var l=Rt(t.widgets[o]);n.top+=l,n.bottom+=l}if("line"==r)return n;r||(r="local");var s=ye(t);if("local"==r?s+=Bt(e.display):s-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:an());var u=a.left+("window"==r?0:sn());n.left+=u,n.right+=u}return n.top+=s,n.bottom+=s,n}function cn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=sn(),i-=an();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function hn(e,t,n,r,i){return r||(r=T(e.doc,t.line)),un(e,r,$t(e,r,t.ch,i),n)}function fn(e,t,n,r,i,o){function l(t,l){var s=Qt(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,un(e,r,s,n)}function s(e,t,n){var r=a[t],i=r.level%2!=0;return l(n?e-1:e,i!=n)}r=r||T(e.doc,t.line),i||(i=Zt(e,r));var a=Se(r,e.doc.direction),u=t.ch,c=t.sticky;if(u>=r.text.length?(u=r.text.length,c="before"):u<=0&&(u=0,c="after"),!a)return l("before"==c?u-1:u,"before"==c);var h=Ce(a,u,c),f=jl,d=s(u,h,"before"==c);return null!=f&&(d.other=s(u,f,"before"!=c)),d}function dn(e,t){var n=0;t=U(e.doc,t),e.options.lineWrapping||(n=wn(e.display)*t.ch);var r=T(e.doc,t.line),i=ye(r)+Bt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function pn(e,t,n,r,i){var o=E(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function gn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return pn(r.first,0,null,!0,-1);var i=D(r,n),o=r.first+r.size-1;if(i>o)return pn(r.first+r.size-1,T(r,o).text.length,null,!0,1);t<0&&(t=0);for(var l=T(r,i);;){var s=yn(e,l,i,t,n),a=ue(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=W(l=u.to.line)}}function vn(e,t,n,r){var i=function(r){return un(e,t,Qt(e,n,r),"line")},o=t.text.length,l=k(function(e){return i(e-1).bottom<=r},o,0);return o=k(function(e){return i(e).top>r},l,o),{begin:l,end:o}}function mn(e,t,n,r){return vn(e,t,n,un(e,t,Qt(e,n,r),"line").top)}function yn(e,t,n,r,i){i-=ye(t);var o,l=0,s=t.text.length,a=Zt(e,t);if(Se(t,e.doc.direction)){if(e.options.lineWrapping){var u;u=vn(e,t,a,i),l=u.begin,s=u.end}o=new E(n,Math.floor(l+(s-l)/2));var c,h,f=fn(e,o,"line",t,a).left,d=f<r?1:-1,p=f-r,g=Math.ceil((s-l)/4);e:do{c=p,h=o;for(var v=0;v<g;++v){var m=o;if(null==(o=Te(e,t,o,d))||o.ch<l||s<=("before"==o.sticky?o.ch-1:o.ch)){o=m;break e}}if(p=fn(e,o,"line",t,a).left-r,g>1){var y=Math.abs(p-c)/g;g=Math.min(g,Math.ceil(Math.abs(p)/y)),d=p<0?1:-1}}while(0!=p&&(g>1||d<0!=p<0&&Math.abs(p)<=Math.abs(c)));if(Math.abs(p)>Math.abs(c)){if(p<0==c<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var b=k(function(n){var o=un(e,t,Qt(e,a,n),"line");return o.top>i?(s=Math.min(n,s),!0):!(o.bottom<=i)&&(o.left>r||!(o.right<r)&&r-o.left<o.right-r)},l,s);b=L(t.text,b,1),o=new E(n,b,b==s?"before":"after")}var w=fn(e,o,"line",t,a);return(i<w.top||w.bottom<i)&&(o.outside=!0),o.xRel=r<w.left?-1:r>w.right?1:0,o}function bn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==as){as=r("pre");for(var i=0;i<49;++i)as.appendChild(document.createTextNode("x")),as.appendChild(r("br"));as.appendChild(document.createTextNode("x"))}n(e.measure,as);var o=as.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function wn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=r("span","xxxxxxxxxx"),i=r("pre",[t]);n(e.measure,i);var o=t.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function xn(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)n[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[l]]=o.clientWidth;return{fixedPos:Cn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Cn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Sn(e){var t=bn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/wn(e.display)-3);return function(i){if(ve(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ln(e){var t=e.doc,n=Sn(e);t.iter(function(e){var t=n(e);t!=e.height&&A(e,t)})}function kn(e,t,n,r){var i=e.display;if(!n&&"true"==ze(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=gn(e,o,l);if(r&&1==u.xRel&&(a=T(e.doc,u.line).text).length==u.ch){var c=h(a,a.length,e.options.tabSize)-a.length;u=E(u.line,Math.max(0,Math.round((o-Ut(e.display).left)/wn(e.display))-c))}return u}function Mn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Tn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Nn(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)if(!1!==t||l!=n.sel.primIndex){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&On(e,s.head,i),a||An(e,s,o)}}return r}function On(e,t,n){var i=fn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(r("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var l=n.appendChild(r("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=i.other.left+"px",l.style.top=i.other.top+"px",l.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function An(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?h-e:n)+"px;\n height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return hn(e,E(t,n),"div",u,r)}var l,a,u=T(s,t),f=u.text.length;return xe(Se(u,s.direction),n||0,null==r?f:r,function(e,t,s){var u,d,p,g=o(e,"left");if(e==t)u=g,d=p=g.left;else{if(u=o(t-1,"right"),"rtl"==s){var v=g;g=u,u=v}d=g.left,p=u.right}null==n&&0==e&&(d=c),u.top-g.top>3&&(i(d,g.top,null,g.bottom),d=c,g.bottom<u.top&&i(d,g.bottom,null,u.top)),null==r&&t==f&&(p=h),(!l||g.top<l.top||g.top==l.top&&g.left<l.left)&&(l=g),(!a||u.bottom>a.bottom||u.bottom==a.bottom&&u.right>a.right)&&(a=u),d<c+1&&(d=c),i(d,u.top,p-d,u.bottom)}),{start:l,end:a}}var l=e.display,s=e.doc,a=document.createDocumentFragment(),u=Ut(e.display),c=u.left,h=Math.max(l.sizerWidth,Kt(e)-l.sizer.offsetLeft)-u.right,f=t.from(),d=t.to();if(f.line==d.line)o(f.line,f.ch,d.ch);else{var p=T(s,f.line),g=T(s,d.line),v=he(p)==he(g),m=o(f.line,f.ch,v?p.text.length+1:null).end,y=o(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(i(m.right,m.top,null,m.bottom),i(c,y.top,y.left,y.bottom)):i(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&i(c,m.bottom,null,y.top)}n.appendChild(a)}function Wn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Dn(e){e.state.focused||(e.display.input.focus(),Fn(e))}function Hn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,En(e))},100)}function Fn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),dl&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wn(e))}function En(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,Al(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=void 0;if(!i.hidden){if(hl&&fl<8){var l=i.node.offsetTop+i.node.offsetHeight;o=l-n,n=l}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var a=i.line.height-o;if(o<2&&(o=bn(t)),(a>.005||a<-.005)&&(A(i.line,o),In(i.line),i.rest))for(var u=0;u<i.rest.length;u++)In(i.rest[u])}}}function In(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Rn(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Bt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=D(t,r),l=D(t,i);if(n&&n.ensure){var s=n.ensure.from.line,a=n.ensure.to.line;s<o?(o=s,l=D(t,ye(T(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=D(t,ye(T(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function zn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Cn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var s=n[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Bn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=F(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=o.firstChild.offsetWidth,s=o.offsetWidth-l;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(l,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Wr(e),!0}return!1}function Gn(e,t){if(!We(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!bl){var l=r("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Bt(e.display))+"px;\n height: "+(t.bottom-t.top+Vt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(o),e.display.lineSpace.removeChild(l)}}}function Un(e,t,n,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=n||(t=t.ch?E(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?E(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=fn(e,t),a=n&&n!=t?fn(e,n):s;i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-r,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+r};var u=Kn(e,i),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Zn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(Jn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}function Vn(e,t){var n=Kn(e,t);null!=n.scrollTop&&Zn(e,n.scrollTop),null!=n.scrollLeft&&Jn(e,n.scrollLeft)}function Kn(e,t){var n=e.display,r=bn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=jt(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Gt(n),a=t.top<r,u=t.bottom>s-r;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Kt(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function jn(e,t){null!=t&&($n(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Xn(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Yn(e,t,n){null==t&&null==n||$n(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function _n(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;qn(e,dn(e,t.from),dn(e,t.to),t.margin)}}function qn(e,t,n,r){var i=Kn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Yn(e,i.scrollLeft,i.scrollTop)}function Zn(e,t){Math.abs(e.doc.scrollTop-t)<2||(sl||Or(e,{top:t}),Qn(e,t,!0),sl&&Or(e),Cr(e,100))}function Qn(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Jn(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,zn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function er(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Gt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Vt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function tr(e,t){t||(t=er(e));var n=e.display.barWidth,r=e.display.barHeight;nr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Pn(e),nr(e,er(e)),n=e.display.barWidth,r=e.display.barHeight}function nr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function rr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Al(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new vs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),_l(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Jn(e,t):Zn(e,t)},e),e.display.scrollbars.addClass&&s(e.display.wrapper,e.display.scrollbars.addClass)}function ir(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ms},xt(e.curOp)}function or(e){St(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;lr(e)})}function lr(e){for(var t=e.ops,n=0;n<t.length;n++)sr(t[n]);for(var r=0;r<t.length;r++)ar(t[r]);for(var i=0;i<t.length;i++)ur(t[i]);for(var o=0;o<t.length;o++)cr(t[o]);for(var l=0;l<t.length;l++)hr(t[l])}function sr(e){var t=e.cm,n=t.display;Lr(t),e.updateMaxLine&&we(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ys(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ar(e){e.updatedDisplay=e.mustUpdate&&Tr(e.cm,e.update)}function ur(e){var t=e.cm,n=t.display;e.updatedDisplay&&Pn(t),e.barMeasure=er(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function cr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Jn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==l()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Dr(t,e.barMeasure),e.selectionChanged&&Wn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Dn(e.cm)}function hr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Nr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Qn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Jn(t,e.scrollLeft,!0,!0),e.scrollToPos){Gn(t,Un(t,U(r,e.scrollToPos.from),U(r,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||Ae(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Ae(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ae(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function fr(e,t){if(e.curOp)return t();ir(e);try{return t()}finally{or(e)}}function dr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ir(e);try{return t.apply(e,arguments)}finally{or(e)}}}function pr(e){return function(){if(this.curOp)return e.apply(this,arguments);ir(this);try{return e.apply(this,arguments)}finally{or(this)}}}function gr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ir(t);try{return e.apply(this,arguments)}finally{or(t)}}}function vr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Kl&&pe(e.doc,t)<i.viewTo&&yr(e);else if(n<=i.viewFrom)Kl&&ge(e.doc,n+r)>i.viewFrom?yr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)yr(e);else if(t<=i.viewFrom){var o=br(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):yr(e)}else if(n>=i.viewTo){var l=br(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):yr(e)}else{var s=br(e,t,t,-1),a=br(e,n,n+r,1);s&&a?(i.view=i.view.slice(0,s.index).concat(wt(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=r):yr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function mr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Mn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==f(l,n)&&l.push(n)}}}function yr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function br(e,t,n,r){var i,o=Mn(e,t),l=e.display.view;if(!Kl||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(r>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;pe(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function wr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=wt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=wt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Mn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(wt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Mn(e,n)))),r.viewTo=n}function xr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Cr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,u(Sr,e))}function Sr(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=et(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?$e(t.mode,r.state):null,a=Qe(e,o,r,!0);s&&(r.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&tt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Cr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&fr(e,function(){for(var t=0;t<i.length;t++)mr(e,i[t],"text")})}}function Lr(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Vt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Vt(e)+"px",t.scrollbarsClipped=!0)}function kr(e){if(e.hasFocus())return null;var t=l();if(!t||!o(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&o(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Mr(e){if(e&&e.activeElt&&e.activeElt!=l()&&(e.activeElt.focus(),e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Tr(e,n){var r=e.display,i=e.doc;if(n.editorIsHidden)return yr(e),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==xr(e))return!1;Bn(e)&&(yr(e),n.dims=xn(e));var o=i.first+i.size,l=Math.max(n.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,n.visible.to+e.options.viewportMargin);r.viewFrom<l&&l-r.viewFrom<20&&(l=Math.max(i.first,r.viewFrom)),r.viewTo>s&&r.viewTo-s<20&&(s=Math.min(o,r.viewTo)),Kl&&(l=pe(e.doc,l),s=ge(e.doc,s));var a=l!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;wr(e,l,s),r.viewOffset=ye(T(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=xr(e);if(!a&&0==u&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=kr(e);return u>4&&(r.lineDiv.style.display="none"),Ar(e,r.updateLineNumbers,n.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Mr(c),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,a&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,Cr(e,400)),r.updateLineNumbers=null,!0}function Nr(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Kt(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gt(e.display)-jt(e),n.top)}),t.visible=Rn(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Tr(e,t);r=!1){Pn(e);var i=er(e);Tn(e),tr(e,i),Dr(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Or(e,t){var n=new ys(e,t);if(Tr(e,n)){Pn(e),Nr(e,n);var r=er(e);Tn(e),tr(e,r),Dr(e,r),n.finish()}}function Ar(e,n,r){function i(t){var n=t.nextSibling;return dl&&Sl&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,l=e.options.lineNumbers,s=o.lineDiv,a=s.firstChild,u=o.view,c=o.viewFrom,h=0;h<u.length;h++){var d=u[h];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;a!=d.node;)a=i(a);var p=l&&null!=n&&n<=c&&d.lineNumber;d.changes&&(f(d.changes,"gutter")>-1&&(p=!1),Mt(e,d,c,r)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(F(e.options,c)))),a=d.node.nextSibling}else{var g=Ft(e,d,c,r);s.insertBefore(g,a)}c+=d.size}for(;a;)a=i(a)}function Wr(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Dr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vt(e)+"px"}function Hr(e){var n=e.display.gutters,i=e.options.gutters;t(n);for(var o=0;o<i.length;++o){var l=i[o],s=n.appendChild(r("div",null,"CodeMirror-gutter "+l));"CodeMirror-linenumbers"==l&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}n.style.display=o?"":"none",Wr(e)}function Fr(e){var t=f(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Er(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Pr(e){var t=Er(e);return t.x*=ws,t.y*=ws,t}function Ir(e,t){var n=Er(t),r=n.x,i=n.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(r&&s||i&&a){if(i&&Sl&&dl)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==u){e.display.currentWheelTarget=u;break e}if(r&&!sl&&!vl&&null!=ws)return i&&a&&Zn(e,Math.max(0,l.scrollTop+i*ws)),Jn(e,Math.max(0,l.scrollLeft+r*ws)),(!i||i&&a)&&Ee(t),void(o.wheelStartX=null);if(i&&null!=ws){var f=i*ws,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;f<0?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),Or(e,{top:d,bottom:p})}bs<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(ws=(ws*bs+n)/(bs+1),++bs)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function Rr(e,t){var n=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=f(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(P(o.to(),i.from())>=0){var l=B(o.from(),i.from()),s=z(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new Cs(a?s:l,a?l:s))}}return new xs(e,t)}function zr(e,t){return new xs([new Cs(e,t||e)],0)}function Br(e){return e.text?E(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Gr(e,t){if(P(e,t.from)<0)return e;if(P(e,t.to)<=0)return Br(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Br(t).ch-t.to.ch),E(n,r)}function Ur(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r]
14
12
  ;n.push(new Cs(Gr(i.anchor,t),Gr(i.head,t)))}return Rr(n,e.sel.primIndex)}function Vr(e,t,n){return e.line==t.line?E(n.line,e.ch-t.ch+n.ch):E(n.line+(e.line-t.line),e.ch)}function Kr(e,t,n){for(var r=[],i=E(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Vr(s.from,i,o),u=Vr(Br(s),i,o);if(i=s.to,o=u,"around"==n){var c=e.sel.ranges[l],h=P(c.head,c.anchor)<0;r[l]=new Cs(h?u:a,h?a:u)}else r[l]=new Cs(a,a)}return new xs(r,e.sel.primIndex)}function jr(e){e.doc.mode=Ye(e.options,e.doc.modeOption),Xr(e)}function Xr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Cr(e,100),e.state.modeGen++,e.curOp&&vr(e)}function Yr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==g(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function _r(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){ut(e,n,i,r),Lt(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new ss(u[o],i(o),r));return n}var s=t.from,a=t.to,u=t.text,c=T(e,s.line),h=T(e,a.line),f=g(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Yr(e,t)){var v=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),v.length&&e.insert(s.line,v)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var m=l(1,u.length-1);m.push(new ss(f+c.text.slice(a.ch),d,r)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var y=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}Lt(e,"change",e,t)}function $r(e,t,n){function r(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;n&&!a||(t(s.doc,a),r(s.doc,e,a))}}}r(e,null,!0)}function qr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ln(e),jr(e),Zr(e),e.options.lineWrapping||we(e),e.options.mode=t.modeOption,vr(e)}function Zr(e){("rtl"==e.doc.direction?s:Al)(e.display.lineDiv,"CodeMirror-rtl")}function Qr(e){fr(e,function(){Zr(e),vr(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ei(e,t){var n={from:R(t.from),to:Br(t),text:N(e,t.from,t.to)};return si(e,n,t.from.line,t.to.line+1),$r(e,function(e){return si(e,n,t.from.line,t.to.line+1)},!0),n}function ti(e){for(;e.length;){if(!g(e).ranges)break;e.pop()}}function ni(e,t){return t?(ti(e.done),g(e.done)):e.done.length&&!g(e.done).ranges?g(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function ri(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ni(i,i.lastOp==r)))l=g(o.changes),0==P(t.from,t.to)&&0==P(t.from,l.to)?l.to=Br(t):o.changes.push(ei(e,t));else{var a=g(i.done);for(a&&a.ranges||li(e.sel,i.done),o={changes:[ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Ae(e,"historyAdded")}function ii(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function oi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ii(e,o,g(i.done),t))?i.done[i.done.length-1]=t:li(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&ti(i.undone)}function li(e,t){var n=g(t);n&&n.ranges&&n.equals(e)||t.push(e)}function si(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function ai(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function ui(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(ai(n[i]));return r}function ci(e,t){var n=ui(e,t),r=J(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(n[i]=l)}return n}function hi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?xs.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];r.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&f(t,Number(c[1]))>-1&&(g(s)[h]=u[h],delete u[h])}}}return r}function fi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=P(t,i)<0;o!=P(n,i)<0?(i=t,t=n):o!=P(t,n)<0&&(t=n)}return new Cs(i,t)}return new Cs(n||t,t)}function di(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),bi(e,new xs([fi(e.sel.primary(),t,n,i)],0),r)}function pi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=fi(e.sel.ranges[o],t[o],null,i);bi(e,Rr(r,e.sel.primIndex),n)}function gi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,bi(e,Rr(i,e.sel.primIndex),r)}function vi(e,t,n,r){bi(e,zr(t,n),r)}function mi(e,t,n){var r={ranges:t.ranges,update:function(t){var n=this;this.ranges=[];for(var r=0;r<t.length;r++)n.ranges[r]=new Cs(U(e,t[r].anchor),U(e,t[r].head))},origin:n&&n.origin};return Ae(e,"beforeSelectionChange",e,r),e.cm&&Ae(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Rr(r.ranges,r.ranges.length-1):t}function yi(e,t,n){var r=e.history.done,i=g(r);i&&i.ranges?(r[r.length-1]=t,wi(e,t,n)):bi(e,t,n)}function bi(e,t,n){wi(e,t,n),oi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function wi(e,t,n){(He(e,"beforeSelectionChange")||e.cm&&He(e.cm,"beforeSelectionChange"))&&(t=mi(e,t,n)),xi(e,Si(e,t,n&&n.bias||(P(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!e.cm||Xn(e.cm)}function xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,De(e.cm)),Lt(e,"cursorActivity",e))}function Ci(e){xi(e,Si(e,e.sel,null,!1))}function Si(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=ki(e,l.anchor,s&&s.anchor,n,r),u=ki(e,l.head,s&&s.head,n,r);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Cs(a,u))}return i?Rr(i,t.primIndex):t}function Li(e,t,n,r,i){var o=T(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(Ae(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(n){var u=a.find(r<0?1:-1),c=void 0;if((r<0?a.inclusiveRight:a.inclusiveLeft)&&(u=Mi(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=P(u,n))&&(r<0?c<0:c>0))return Li(e,u,t,r,i)}var h=a.find(r<0?-1:1);return(r<0?a.inclusiveLeft:a.inclusiveRight)&&(h=Mi(e,h,r,h.line==t.line?o:null)),h?Li(e,h,t,r,i):null}}return t}function ki(e,t,n,r,i){var o=r||1,l=Li(e,t,n,o,i)||!i&&Li(e,t,n,o,!0)||Li(e,t,n,-o,i)||!i&&Li(e,t,n,-o,!0);return l||(e.cantEdit=!0,E(e.first,0))}function Mi(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?U(e,E(t.line-1)):null:n>0&&t.ch==(r||T(e,t.line)).text.length?t.line<e.first+e.size-1?E(t.line+1,0):null:new E(t.line,t.ch+n)}function Ti(e){e.setSelection(E(e.firstLine(),0),E(e.lastLine()),Il)}function Ni(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=U(e,t)),n&&(r.to=U(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),Ae(e,"beforeChange",e,r),e.cm&&Ae(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Oi(e,t,n){if(e.cm){if(!e.cm.curOp)return dr(e.cm,Oi)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(He(e,"beforeChange")||e.cm&&He(e.cm,"beforeChange"))||(t=Ni(e,t,!0))){var r=Vl&&!n&&te(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ai(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Ai(e,t)}}function Ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=P(t.from,t.to)){var n=Ur(e,t);ri(e,t,n,e.cm?e.cm.curOp.id:NaN),Hi(e,t,n,J(e,t));var r=[];$r(e,function(e,n){n||-1!=f(r,e.history)||(Ri(e.history,t),r.push(e.history)),Hi(e,t,null,J(e,t))})}}function Wi(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(r=l[a],n?!r.ranges||r.equals(e.sel):r.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;r=l.pop(),r.ranges;){if(li(r,s),n&&!r.equals(e.sel))return void bi(e,r,{clearRedo:!1});o=r}var u=[];li(o,s),s.push({changes:u,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var c=He(e,"beforeChange")||e.cm&&He(e.cm,"beforeChange"),h=r.changes.length-1;h>=0;--h){var d=function(n){var i=r.changes[n];if(i.origin=t,c&&!Ni(e,i,!1))return l.length=0,{};u.push(ei(e,i));var o=n?Ur(e,i):g(l);Hi(e,i,o,ci(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Br(i)});var s=[];$r(e,function(e,t){t||-1!=f(s,e.history)||(Ri(e.history,i),s.push(e.history)),Hi(e,i,null,ci(e,i))})}(h);if(d)return d.v}}}}function Di(e,t){if(0!=t&&(e.first+=t,e.sel=new xs(v(e.sel.ranges,function(e){return new Cs(E(e.anchor.line+t,e.anchor.ch),E(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){vr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)mr(e.cm,r,"gutter")}}function Hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return dr(e.cm,Hi)(e,t,n,r);if(t.to.line<e.first)return void Di(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Di(e,i),t={from:E(e.first,0),to:E(t.to.line+i,t.to.ch),text:[g(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:E(o,T(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=N(e,t.from,t.to),n||(n=Ur(e,t)),e.cm?Fi(e.cm,t,r):_r(e,t,r),wi(e,n,Il)}}function Fi(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=W(he(T(r,o.line))),r.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&De(e),_r(r,t,n,Sn(e)),e.options.lineWrapping||(r.iter(a,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),at(r,o.line),Cr(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?vr(e):o.line!=l.line||1!=t.text.length||Yr(e.doc,t)?vr(e,o.line,l.line+1,u):mr(e,o.line,"text");var c=He(e,"changes"),h=He(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&Lt(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ei(e,t,n,r,i){if(r||(r=n),P(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Oi(e,{from:n,to:r,text:t,origin:i})}function Pi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ii(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)Pi(o.ranges[s].anchor,t,n,r),Pi(o.ranges[s].head,t,n,r)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(n<u.from.line)u.from=E(u.from.line+r,u.from.ch),u.to=E(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function Ri(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ii(e.done,n,r,i),Ii(e.undone,n,r,i)}function zi(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=T(e,G(e,t)):i=W(t),null==i?null:(r(o,i)&&e.cm&&mr(e.cm,i,n),o)}function Bi(e){var t=this;this.lines=e,this.parent=null;for(var n=0,r=0;r<e.length;++r)e[r].parent=t,n+=e[r].height;this.height=n}function Gi(e){var t=this;this.children=e;for(var n=0,r=0,i=0;i<e.length;++i){var o=e[i];n+=o.chunkSize(),r+=o.height,o.parent=t}this.size=n,this.height=r,this.parent=null}function Ui(e,t,n){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&jn(e,n)}function Vi(e,t,n,r){var i=new Ss(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),zi(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ve(e,t)){var r=ye(t)<e.scrollTop;A(t,t.height+Rt(i)),r&&jn(o,i.height),o.curOp.forceUpdate=!0}return!0}),Lt(o,"lineWidgetAdded",o,i,"number"==typeof t?t:W(t)),i}function Ki(e,t,n,r,o){if(r&&r.shared)return ji(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return dr(e.cm,Ki)(e,t,n,r,o);var l=new ks(e,o),s=P(t,n);if(r&&c(r,l,!1),s>0||0==s&&!1!==l.clearWhenEmpty)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=i("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ce(e,t.line,t,n,l)||t.line!=n.line&&ce(e,n.line,t,n,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");X()}l.addToHistory&&ri(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,u=t.line,h=e.cm;if(e.iter(u,n.line+1,function(e){h&&l.collapsed&&!h.options.lineWrapping&&he(e)==h.display.maxLine&&(a=!0),l.collapsed&&u!=t.line&&A(e,0),q(e,new Y(l,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),l.collapsed&&e.iter(t.line,n.line+1,function(t){ve(e,t)&&A(t,0)}),l.clearOnEnter&&_l(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(j(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++Ls,l.atomic=!0),h){if(a&&(h.curOp.updateMaxLine=!0),l.collapsed)vr(h,t.line,n.line+1);else if(l.className||l.title||l.startStyle||l.endStyle||l.css)for(var f=t.line;f<=n.line;f++)mr(h,f,"text");l.atomic&&Ci(h.doc),Lt(h,"markerAdded",h,l)}return l}function ji(e,t,n,r,i){r=c(r),r.shared=!1;var o=[Ki(e,t,n,r,i)],l=o[0],s=r.widgetNode;return $r(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Ki(e,U(e,t),U(e,n),r,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=g(o)}),new Ms(o,l)}function Xi(e){return e.findMarks(E(e.first,0),e.clipPos(E(e.lastLine())),function(e){return e.parent})}function Yi(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(P(o,l)){var s=Ki(e,o,l,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function _i(e){for(var t=0;t<e.length;t++)!function(t){var n=e[t],r=[n.primary.doc];$r(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==f(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}(t)}function $i(e){var t=this;if(Qi(t),!We(t,e)&&!zt(t.display,e)){Ee(e),hl&&(Os=+new Date);var n=kn(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,s=0;s<i;++s)!function(e,r){if(!t.options.allowDropFileTypes||-1!=f(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=dr(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++l==i){n=U(t.doc,n);var a={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Oi(t.doc,a),yi(t.doc,zr(n,Br(a)))}}),s.readAsText(e)}}(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var a=e.dataTransfer.getData("Text");if(a){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),wi(t.doc,zr(n,n)),u)for(var c=0;c<u.length;++c)Ei(t.doc,"",u[c].anchor,u[c].head,"drag");t.replaceSelection(a,"around","paste"),t.display.input.focus()}}catch(e){}}}}function qi(e,t){if(hl&&(!e.state.draggingText||+new Date-Os<100))return void Re(t);if(!We(e,t)&&!zt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ml)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",vl&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),vl&&n.parentNode.removeChild(n)}}function Zi(e,t){var i=kn(e,t);if(i){var o=document.createDocumentFragment();On(e,i,o),e.display.dragCursor||(e.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,o)}}function Qi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ji(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function eo(){As||(to(),As=!0)}function to(){var e;_l(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ji(no)},100))}),_l(window,"blur",function(){return Ji(En)})}function no(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function ro(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,l=0;l<t.length-1;l++){var s=t[l];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function io(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=v(n.split(" "),ro),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=r):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[n]}for(var u in t)e[u]=t[u];return e}function oo(e,t,n,r){t=uo(t);var i=t.call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return oo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=oo(e,t.fallthrough[o],n,r);if(l)return l}}}function lo(e){var t="string"==typeof e?e:Ws[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function so(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(Nl?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(Nl?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function ao(e,t){if(vl&&34==e.keyCode&&e.char)return!1;var n=Ws[e.keyCode];return null!=n&&!e.altGraphKey&&so(n,e,t)}function uo(e){return"string"==typeof e?Es[e]:e}function co(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&P(o.from,g(r).to)<=0;){var l=r.pop();if(P(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}fr(e,function(){for(var t=r.length-1;t>=0;t--)Ei(e.doc,"",r[t].from,r[t].to,"+delete");Xn(e)})}function ho(e,t){var n=T(e.doc,t),r=he(n);return r!=n&&(t=W(r)),Me(!0,e,r,t,1)}function fo(e,t){var n=T(e.doc,t),r=fe(n);return r!=n&&(t=W(r)),Me(!0,e,n,t,-1)}function po(e,t){var n=ho(e,t.line),r=T(e.doc,n.line),i=Se(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return E(n.line,l?0:o,n.sticky)}return n}function go(e,t,n){if("string"==typeof t&&!(t=Ps[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Pl}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function vo(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=oo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&oo(t,e.options.extraKeys,n,e)||oo(t,e.options.keyMap,n,e)}function mo(e,t,n,r){var i=e.state.keySeq;if(i){if(lo(t))return"handled";Is.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=vo(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Lt(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ee(n),Wn(e)),i&&!o&&/\'$/.test(t)?(Ee(n),!0):!!o}function yo(e,t){var n=ao(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?mo(e,"Shift-"+n,t,function(t){return go(e,t,!0)})||mo(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return go(e,t)}):mo(e,n,t,function(t){return go(e,t)}))}function bo(e,t,n){return mo(e,"'"+n+"'",t,function(t){return go(e,t,!0)})}function wo(e){var t=this;if(t.curOp.focus=l(),!We(t,e)){hl&&fl<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=yo(t,e);vl&&(Rs=r?n:null,!r&&88==n&&!Ql&&(Sl?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||xo(t)}}function xo(e){function t(e){18!=e.keyCode&&e.altKey||(Al(n,"CodeMirror-crosshair"),Oe(document,"keyup",t),Oe(document,"mouseover",t))}var n=e.display.lineDiv;s(n,"CodeMirror-crosshair"),_l(document,"keyup",t),_l(document,"mouseover",t)}function Co(e){16==e.keyCode&&(this.doc.sel.shift=!1),We(this,e)}function So(e){var t=this;if(!(zt(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||Sl&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(vl&&n==Rs)return Rs=null,void Ee(e);if(!vl||e.which&&!(e.which<10)||!yo(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(bo(t,e,i)||t.display.input.onKeyPress(e))}}}function Lo(e,t){var n=+new Date;return Gs&&Gs.compare(n,e,t)?(Bs=Gs=null,"triple"):Bs&&Bs.compare(n,e,t)?(Gs=new zs(n,e,t),Bs=null,"double"):(Bs=new zs(n,e,t),Gs=null,"single")}function ko(e){var t=this,n=t.display;if(!(We(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,zt(n,e))return void(dl||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Ho(t,e)){var r=kn(t,e),i=Be(e),o=r?Lo(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&Mo(t,i,r,o,e)||(1==i?r?No(t,r,o,e):ze(e)==n.scroller&&Ee(e):2==i?(r&&di(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(Ol?Fo(t,e):Hn(t)))}}}function Mo(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,mo(e,so(o,i),i,function(t){if("string"==typeof t&&(t=Ps[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=Pl}finally{e.state.suppressEdits=!1}return r})}function To(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=Ll?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=Sl?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(Sl?n.altKey:n.ctrlKey)),i}function No(e,t,n,r){hl?setTimeout(u(Dn,e),0):e.curOp.focus=l();var i,o=To(e,n,r),s=e.doc.sel;e.options.dragDrop&&$l&&!e.isReadOnly()&&"single"==n&&(i=s.contains(t))>-1&&(P((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(P(i.to(),t)>0||t.xRel<0)?Oo(e,r,t,o):Wo(e,r,t,o)}function Oo(e,t,n,r){var i=e.display,o=!1,l=dr(e,function(t){dl&&(i.scroller.draggable=!1),e.state.draggingText=!1,Oe(document,"mouseup",l),Oe(document,"mousemove",s),Oe(i.scroller,"dragstart",a),Oe(i.scroller,"drop",l),o||(Ee(t),r.addNew||di(e.doc,n,null,null,r.extend),dl||hl&&9==fl?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),s=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},a=function(){return o=!0};dl&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),_l(document,"mouseup",l),_l(document,"mousemove",s),_l(i.scroller,"dragstart",a),_l(i.scroller,"drop",l),Hn(e),setTimeout(function(){return i.input.focus()},20)}function Ao(e,t,n){if("char"==n)return new Cs(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Cs(E(t.line,0),U(e.doc,E(t.line+1,0)));var r=n(e,t);return new Cs(r.from,r.to)}function Wo(e,t,n,r){function i(t){if(0!=P(m,t))if(m=t,"rectangle"==r.unit){for(var i=[],o=e.options.tabSize,l=h(T(u,n.line).text,n.ch,o),s=h(T(u,t.line).text,t.ch,o),a=Math.min(l,s),g=Math.max(l,s),v=Math.min(n.line,t.line),y=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=y;v++){var b=T(u,v).text,w=d(b,a,o);a==g?i.push(new Cs(E(v,w),E(v,w))):b.length>w&&i.push(new Cs(E(v,w),E(v,d(b,g,o))))}i.length||i.push(new Cs(n,n)),bi(u,Rr(p.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,C=c,S=Ao(e,t,r.unit),L=C.anchor;P(S.anchor,L)>0?(x=S.head,L=B(C.from(),S.anchor)):(x=S.anchor,L=z(C.to(),S.head));var k=p.ranges.slice(0);k[f]=new Cs(U(u,L),x),bi(u,Rr(k,f),Rl)}}function o(t){var n=++b,s=kn(e,t,!0,"rectangle"==r.unit);if(s)if(0!=P(s,m)){e.curOp.focus=l(),i(s);var c=Rn(a,u);(s.line>=c.to||s.line<c.from)&&setTimeout(dr(e,function(){b==n&&o(t)}),150)}else{var h=t.clientY<y.top?-20:t.clientY>y.bottom?20:0;h&&setTimeout(dr(e,function(){b==n&&(a.scroller.scrollTop+=h,o(t))}),50)}}function s(t){e.state.selectingText=!1,b=1/0,Ee(t),a.input.focus(),Oe(document,"mousemove",w),Oe(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;Ee(t);var c,f,p=u.sel,g=p.ranges;if(r.addNew&&!r.extend?(f=u.sel.contains(n),c=f>-1?g[f]:new Cs(n,n)):(c=u.sel.primary(),f=u.sel.primIndex),"rectangle"==r.unit)r.addNew||(c=new Cs(n,n)),n=kn(e,t,!0,!0),f=-1;else{var v=Ao(e,n,r.unit);c=r.extend?fi(c,v.anchor,v.head,r.extend):v}r.addNew?-1==f?(f=g.length,bi(u,Rr(g.concat([c]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&"char"==r.unit&&!r.extend?(bi(u,Rr(g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):gi(u,f,c,Rl):(f=0,bi(u,new xs([c],0),Rl),p=u.sel);var m=n,y=a.wrapper.getBoundingClientRect(),b=0,w=dr(e,function(e){Be(e)?o(e):s(e)}),x=dr(e,s);e.state.selectingText=x,_l(document,"mousemove",w),_l(document,"mouseup",x)}function Do(e,t,n,r){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ee(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!He(e,n))return Ie(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){return Ae(e,n,e,D(e.doc,o),e.options.gutters[a],t),Ie(t)}}}function Ho(e,t){return Do(e,t,"gutterClick",!0)}function Fo(e,t){zt(e.display,t)||Eo(e,t)||We(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Eo(e,t){return!!He(e,"gutterContextMenu")&&Do(e,t,"gutterContextMenu",!1)}function Po(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ln(e)}function Io(e){Hr(e),vr(e),zn(e)}function Ro(e,t,n){if(!t!=!(n&&n!=Us)){var r=e.display.dragFunctions,i=t?_l:Oe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function zo(e){e.options.lineWrapping?(s(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Al(e.display.wrapper,"CodeMirror-wrap"),we(e)),Ln(e),vr(e),ln(e),setTimeout(function(){return tr(e)},100)}function Bo(e,t){var n=this;if(!(this instanceof Bo))return new Bo(e,t);this.options=t=t?c(t):{},c(Vs,t,!1),Fr(t);var r=t.value;"string"==typeof r&&(r=new Ns(r,t.mode,null,t.lineSeparator,t.direction)),this.doc=r;var i=new Bo.inputStyles[t.inputStyle](this),o=this.display=new M(e,r,i);o.wrapper.CodeMirror=this,Hr(this),Po(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),rr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Dl,keySeq:null,specialChars:null},t.autofocus&&!Cl&&o.input.focus(),hl&&fl<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Go(this),eo(),ir(this),this.curOp.forceUpdate=!0,qr(this,r),t.autofocus&&!Cl||this.hasFocus()?setTimeout(u(Fn,this),20):En(this);for(var l in Ks)Ks.hasOwnProperty(l)&&Ks[l](n,t[l],Us);Bn(this),t.finishInit&&t.finishInit(this);for(var s=0;s<js.length;++s)js[s](n);or(this),dl&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Go(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;_l(i.scroller,"mousedown",dr(e,ko)),hl&&fl<11?_l(i.scroller,"dblclick",dr(e,function(t){if(!We(e,t)){var n=kn(e,t);if(n&&!Ho(e,t)&&!zt(e.display,t)){Ee(t);var r=e.findWordAt(n);di(e.doc,r.anchor,r.head)}}})):_l(i.scroller,"dblclick",function(t){return We(e,t)||Ee(t)}),Ol||_l(i.scroller,"contextmenu",function(t){return Fo(e,t)});var o,l={end:0};_l(i.scroller,"touchstart",function(t){if(!We(e,t)&&!n(t)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),_l(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),_l(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!zt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||r(o,o.prev)?new Cs(s,s):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(s):new Cs(E(s.line,0),U(e.doc,E(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ee(n)}t()}),_l(i.scroller,"touchcancel",t),_l(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Zn(e,i.scroller.scrollTop),Jn(e,i.scroller.scrollLeft,!0),Ae(e,"scroll",e))}),_l(i.scroller,"mousewheel",function(t){return Ir(e,t)}),_l(i.scroller,"DOMMouseScroll",function(t){return Ir(e,t)}),_l(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){We(e,t)||Re(t)},over:function(t){We(e,t)||(Zi(e,t),Re(t))},start:function(t){return qi(e,t)},drop:dr(e,$i),leave:function(t){We(e,t)||Qi(e)}};var s=i.input.getField();_l(s,"keyup",function(t){return Co.call(e,t)}),_l(s,"keydown",dr(e,wo)),_l(s,"keypress",dr(e,So)),_l(s,"focus",function(t){return Fn(e,t)}),_l(s,"blur",function(t){return En(e,t)})}function Uo(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=et(e,t).state:n="prev");var l=e.options.tabSize,s=T(o,t),a=h(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==Pl||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?h(T(o,t-1).text,null,l):0:"add"==n?u=a+e.options.indentUnit:"subtract"==n?u=a-e.options.indentUnit:"number"==typeof n&&(u=a+n),u=Math.max(0,u);var f="",d=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/l);g;--g)d+=l,f+="\t";if(d<u&&(f+=p(u-d)),
15
13
  f!=c)return Ei(o,f,E(t,0),E(t,c.length),"+input"),s.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<c.length){var y=E(t,c.length);gi(o,v,new Cs(y,y));break}}}function Vo(e){Xs=e}function Ko(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=ql(t),a=null;if(l&&r.ranges.length>1)if(Xs&&Xs.text.join("\n")==t){if(r.ranges.length%Xs.text.length==0){a=[];for(var u=0;u<Xs.text.length;u++)a.push(o.splitLines(Xs.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(a=v(s,function(e){return[e]}));for(var c,h=r.ranges.length-1;h>=0;h--){var f=r.ranges[h],d=f.from(),p=f.to();f.empty()&&(n&&n>0?d=E(d.line,d.ch-n):e.state.overwrite&&!l?p=E(p.line,Math.min(T(o,p.line).text.length,p.ch+g(s).length)):Xs&&Xs.lineWise&&Xs.text.join("\n")==t&&(d=p=E(d.line,0))),c=e.curOp.updateInput;var m={from:d,to:p,text:a?a[h%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Oi(e.doc,m),Lt(e,"inputRead",e,m)}t&&!l&&Xo(e,t),Xn(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function jo(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||fr(t,function(){return Ko(t,n,0,null,"paste")}),!0}function Xo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Uo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(T(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Uo(e,i.head.line,"smart"));l&&Lt(e,"electricInput",e,i.head.line)}}}function Yo(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:E(i,0),head:E(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function _o(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function $o(){var e=r("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=r("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return dl?e.style.width="1000px":e.setAttribute("wrap","off"),wl&&(e.style.border="1px solid black"),_o(e),t}function qo(e,t,n,r,i){function o(){var r=t.line+n;return!(r<e.first||r>=e.first+e.size)&&(t=new E(r,t.ch,t.sticky),u=T(e,r))}function l(r){var l;if(null==(l=i?Te(e.cm,u,t,n):ke(u,t,n))){if(r||!o())return!1;t=Me(i,e.cm,u,t.line,n)}else t=l;return!0}var s=t,a=n,u=T(e,t.line);if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,h="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var p=u.text.charAt(t.ch)||"\n",g=x(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){n<0&&(n=1,l(),t.sticky="after");break}if(g&&(c=g),n>0&&!l(!d))break}var v=ki(e,t,s,a,!0);return I(s,v)&&(v.hitSide=!0),v}function Zo(e,t,n,r){var i,o=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(s-.5*bn(e.display),3);i=(n>0?t.bottom:t.top)+n*a}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(var u;u=gn(e,l,i),u.outside;){if(n<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*n}return u}function Qo(e,t){var n=qt(e,t.line);if(!n||n.hidden)return null;var r=T(e.doc,t.line),i=Yt(n,r,t.line),o=Se(r,e.doc.direction),l="left";if(o){l=Ce(o,t.ch)%2?"right":"left"}var s=Jt(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Jo(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function el(e,t){return t&&(e.bad=!0),e}function tl(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function l(){c&&(u+=h,c=!1)}function s(e){e&&(l(),u+=e)}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void s(n||t.textContent.replace(/\u200b/g,""));var u,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(E(r,0),E(i+1,0),o(+f));return void(d.length&&(u=d[0].find())&&s(N(e.doc,u.from,u.to).join(h)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&l();for(var g=0;g<t.childNodes.length;g++)a(t.childNodes[g]);p&&(c=!0)}else 3==t.nodeType&&s(t.nodeValue)}for(var u="",c=!1,h=e.doc.lineSeparator();a(t),t!=n;)t=t.nextSibling;return u}function nl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return el(e.clipPos(E(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return rl(o,t,n)}}function rl(e,t,n){function r(t,n,r){for(var i=-1;i<(h?h.length:0);i++)for(var o=i<0?c.map:h[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==n){var a=W(i<0?e.line:e.rest[i]),u=o[l]+r;return(r<0||s!=t)&&(u=o[l+(r?1:0)]),E(a,u)}}}var i=e.text.firstChild,l=!1;if(!t||!o(i,t))return el(E(W(e.line),0),!0);if(t==i&&(l=!0,t=i.childNodes[n],n=0,!t)){var s=e.rest?g(e.rest):e.line;return el(E(W(s),s.text.length),l)}var a=3==t.nodeType?t:null,u=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));u.parentNode!=i;)u=u.parentNode;var c=e.measure,h=c.maps,f=r(a,u,n);if(f)return el(f,l);for(var d=u.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return el(E(f.line,f.ch-p),l);p+=d.textContent.length}for(var v=u.previousSibling,m=n;v;v=v.previousSibling){if(f=r(v,v.firstChild,-1))return el(E(f.line,f.ch+m),l);m+=v.textContent.length}}function il(e,t){function n(){e.value=a.getValue()}if(t=t?c(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=l();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}var i;if(e.form&&(_l(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Oe(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var a=Bo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a}var ol=navigator.userAgent,ll=navigator.platform,sl=/gecko\/\d/i.test(ol),al=/MSIE \d/.test(ol),ul=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ol),cl=/Edge\/(\d+)/.exec(ol),hl=al||ul||cl,fl=hl&&(al?document.documentMode||6:+(cl||ul)[1]),dl=!cl&&/WebKit\//.test(ol),pl=dl&&/Qt\/\d+\.\d+/.test(ol),gl=!cl&&/Chrome\//.test(ol),vl=/Opera\//.test(ol),ml=/Apple Computer/.test(navigator.vendor),yl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ol),bl=/PhantomJS/.test(ol),wl=!cl&&/AppleWebKit/.test(ol)&&/Mobile\/\w+/.test(ol),xl=/Android/.test(ol),Cl=wl||xl||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ol),Sl=wl||/Mac/.test(ll),Ll=/\bCrOS\b/.test(ol),kl=/win/i.test(ll),Ml=vl&&ol.match(/Version\/(\d*\.\d*)/);Ml&&(Ml=Number(Ml[1])),Ml&&Ml>=15&&(vl=!1,dl=!0);var Tl,Nl=Sl&&(pl||vl&&(null==Ml||Ml<12.11)),Ol=sl||hl&&fl>=9,Al=function(t,n){var r=t.className,i=e(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);t.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Tl=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Wl=function(e){e.select()};wl?Wl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:hl&&(Wl=function(e){try{e.select()}catch(e){}});var Dl=function(){this.id=null};Dl.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Hl,Fl,El=30,Pl={toString:function(){return"CodeMirror.Pass"}},Il={scroll:!1},Rl={origin:"*mouse"},zl={origin:"+move"},Bl=[""],Gl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ul=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Vl=!1,Kl=!1,jl=null,Xl=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;return function(n,r){var u="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(var c=n.length,h=[],f=0;f<c;++f)h.push(e(n.charCodeAt(f)));for(var d=0,p=u;d<c;++d){var v=h[d];"m"==v?h[d]=p:p=v}for(var m=0,y=u;m<c;++m){var b=h[m];"1"==b&&"r"==y?h[m]="n":l.test(b)&&(y=b,"r"==b&&(h[m]="R"))}for(var w=1,x=h[0];w<c-1;++w){var C=h[w];"+"==C&&"1"==x&&"1"==h[w+1]?h[w]="1":","!=C||x!=h[w+1]||"1"!=x&&"n"!=x||(h[w]=x),x=C}for(var S=0;S<c;++S){var L=h[S];if(","==L)h[S]="N";else if("%"==L){var k=void 0;for(k=S+1;k<c&&"%"==h[k];++k);for(var M=S&&"!"==h[S-1]||k<c&&"1"==h[k]?"1":"N",T=S;T<k;++T)h[T]=M;S=k-1}}for(var N=0,O=u;N<c;++N){var A=h[N];"L"==O&&"1"==A?h[N]="L":l.test(A)&&(O=A)}for(var W=0;W<c;++W)if(o.test(h[W])){var D=void 0;for(D=W+1;D<c&&o.test(h[D]);++D);for(var H="L"==(W?h[W-1]:u),F="L"==(D<c?h[D]:u),E=H==F?H?"L":"R":u,P=W;P<D;++P)h[P]=E;W=D-1}for(var I,R=[],z=0;z<c;)if(s.test(h[z])){var B=z;for(++z;z<c&&s.test(h[z]);++z);R.push(new t(0,B,z))}else{var G=z,U=R.length;for(++z;z<c&&"L"!=h[z];++z);for(var V=G;V<z;)if(a.test(h[V])){G<V&&R.splice(U,0,new t(1,G,V));var K=V;for(++V;V<z&&a.test(h[V]);++V);R.splice(U,0,new t(2,K,V)),G=V}else++V;G<z&&R.splice(U,0,new t(1,G,z))}return 1==R[0].level&&(I=n.match(/^\s+/))&&(R[0].from=I[0].length,R.unshift(new t(0,0,I[0].length))),1==g(R).level&&(I=n.match(/\s+$/))&&(g(R).to-=I[0].length,R.push(new t(0,c-I[0].length,c))),"rtl"==r?R.reverse():R}}(),Yl=[],_l=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Yl).concat(n)}},$l=function(){if(hl&&fl<9)return!1;var e=r("div");return"draggable"in e||"dragDrop"in e}(),ql=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Zl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ql=function(){var e=r("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Jl=null,es={},ts={},ns={},rs=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};rs.prototype.eol=function(){return this.pos>=this.string.length},rs.prototype.sol=function(){return this.pos==this.lineStart},rs.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},rs.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},rs.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},rs.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},rs.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},rs.prototype.skipToEnd=function(){this.pos=this.string.length},rs.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},rs.prototype.backUp=function(e){this.pos-=e},rs.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=h(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},rs.prototype.indentation=function(){return h(this.string,null,this.tabSize)-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},rs.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},rs.prototype.current=function(){return this.string.slice(this.start,this.pos)},rs.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},rs.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};var is=function(e,t){this.state=e,this.lookAhead=t},os=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0};os.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},os.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},os.fromSaved=function(e,t,n){return t instanceof is?new os(e,$e(e.mode,t.state),n,t.lookAhead):new os(e,$e(e.mode,t),n)},os.prototype.save=function(e){var t=!1!==e?$e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new is(t,this.maxLookAhead):t};var ls=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n},ss=function(e,t,n){this.text=e,re(this,t),this.height=n?n(this):1};ss.prototype.lineNo=function(){return W(this)},Fe(ss);var as,us={},cs={},hs=null,fs=null,ds={left:0,right:0,top:0,bottom:0},ps=function(e,t,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),_l(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),_l(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,hl&&fl<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ps.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},ps.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ps.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ps.prototype.zeroWidthHack=function(){var e=Sl&&!yl?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Dl,this.disableVert=new Dl},ps.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},ps.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gs=function(){};gs.prototype.update=function(){return{bottom:0,right:0}},gs.prototype.setScrollLeft=function(){},gs.prototype.setScrollTop=function(){},gs.prototype.clear=function(){};var vs={native:ps,null:gs},ms=0,ys=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Rn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Kt(e),this.force=n,this.dims=xn(e),this.events=[]};ys.prototype.signal=function(e,t){He(e,t)&&this.events.push(arguments)},ys.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Ae.apply(null,e.events[t])};var bs=0,ws=null;hl?ws=-.53:sl?ws=15:gl?ws=-.7:ml&&(ws=-1/3);var xs=function(e,t){this.ranges=e,this.primIndex=t};xs.prototype.primary=function(){return this.ranges[this.primIndex]},xs.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var r=t.ranges[n],i=e.ranges[n];if(!I(r.anchor,i.anchor)||!I(r.head,i.head))return!1}return!0},xs.prototype.deepCopy=function(){for(var e=this,t=[],n=0;n<this.ranges.length;n++)t[n]=new Cs(R(e.ranges[n].anchor),R(e.ranges[n].head));return new xs(t,this.primIndex)},xs.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},xs.prototype.contains=function(e,t){var n=this;t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=n.ranges[r];if(P(t,i.from())>=0&&P(e,i.to())<=0)return r}return-1};var Cs=function(e,t){this.anchor=e,this.head=t};Cs.prototype.from=function(){return B(this.anchor,this.head)},Cs.prototype.to=function(){return z(this.anchor,this.head)},Cs.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Bi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,r=e,i=e+t;r<i;++r){var o=n.lines[r];n.height-=o.height,ct(o),Lt(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){var r=this;this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=r},iterN:function(e,t,n){for(var r=this,i=e+t;e<i;++e)if(n(r.lines[e]))return!0}},Gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),s=i.height;if(i.removeInner(e,l),n.height-=s-i.height,o==l&&(n.children.splice(r--,1),i.parent=null),0==(t-=l))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bi))){var a=[];this.collapse(a),this.children=[new Bi(a)],this.children[0].parent=this}},collapse:function(e){for(var t=this,n=0;n<this.children.length;++n)t.children[n].collapse(e)},insertInner:function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var o=r.children[i],l=o.chunkSize();if(e<=l){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,a=s;a<o.lines.length;){var u=new Bi(o.lines.slice(a,a+=25));o.height-=u.height,r.children.splice(++i,0,u),u.parent=r}o.lines=o.lines.slice(0,s),r.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Gi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=f(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Gi(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=this,i=0;i<this.children.length;++i){var o=r.children[i],l=o.chunkSize();if(e<l){var s=Math.min(t,l-e);if(o.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=l}}};var Ss=function(e,t,n){var r=this;if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);this.doc=e,this.node=t};Ss.prototype.clear=function(){var e=this,t=this.doc.cm,n=this.line.widgets,r=this.line,i=W(r);if(null!=i&&n){for(var o=0;o<n.length;++o)n[o]==e&&n.splice(o--,1);n.length||(r.widgets=null);var l=Rt(this);A(r,Math.max(0,r.height-l)),t&&(fr(t,function(){Ui(t,r,-l),mr(t,i,"widget")}),Lt(t,"lineWidgetCleared",t,this,i))}},Ss.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Rt(this)-t;i&&(A(r,r.height+i),n&&fr(n,function(){n.curOp.forceUpdate=!0,Ui(n,r,i),Lt(n,"lineWidgetChanged",n,e,W(r))}))},Fe(Ss);var Ls=0,ks=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ls};ks.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&ir(t),He(this,"clear")){var r=this.find();r&&Lt(this,"clear",r.from,r.to)}for(var i=null,o=null,l=0;l<this.lines.length;++l){var s=e.lines[l],a=_(s.markedSpans,e);t&&!e.collapsed?mr(t,W(s),"text"):t&&(null!=a.to&&(o=W(s)),null!=a.from&&(i=W(s))),s.markedSpans=$(s.markedSpans,a),null==a.from&&e.collapsed&&!ve(e.doc,s)&&t&&A(s,bn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=he(e.lines[u]),h=be(c);h>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&vr(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ci(t.doc)),t&&Lt(t,"markerCleared",t,this,i,o),n&&or(t),this.parent&&this.parent.clear()}},ks.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var r,i,o=0;o<this.lines.length;++o){var l=n.lines[o],s=_(l.markedSpans,n);if(null!=s.from&&(r=E(t?l:W(l),s.from),-1==e))return r;if(null!=s.to&&(i=E(t?l:W(l),s.to),1==e))return i}return r&&{from:r,to:i}},ks.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&fr(r,function(){var i=t.line,o=W(t.line),l=qt(r,o);if(l&&(rn(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ve(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var a=Rt(n)-s;a&&A(i,i.height+a)}Lt(r,"markerChanged",r,e)})},ks.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=f(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ks.prototype.detachLine=function(e){if(this.lines.splice(f(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Fe(ks);var Ms=function(e,t){var n=this;this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=n};Ms.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Lt(this,"clear")}},Ms.prototype.find=function(e,t){return this.primary.find(e,t)},Fe(Ms);var Ts=0,Ns=function(e,t,n,r,i){if(!(this instanceof Ns))return new Ns(e,t,n,r,i);null==n&&(n=0),Gi.call(this,[new Bi([new ss("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=E(n,0);this.sel=zr(o),this.history=new Jr(null),this.id=++Ts,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),_r(this,{from:o,to:o,text:e}),bi(this,zr(o),Il)};Ns.prototype=b(Gi.prototype,{constructor:Ns,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=O(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:gr(function(e){var t=E(this.first,0),n=this.first+this.size-1;Oi(this,{from:t,to:E(n,T(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Yn(this.cm,0,0),bi(this,zr(t),Il)}),replaceRange:function(e,t,n,r){t=U(this,t),n=n?U(this,n):t,Ei(this,e,t,n,r)},getRange:function(e,t,n){var r=N(this,U(this,e),U(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(H(this,e))return T(this,e)},getLineNumber:function(e){return W(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=T(this,e)),he(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return U(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:gr(function(e,t,n){vi(this,U(this,"number"==typeof e?E(e,t||0):e),null,n)}),setSelection:gr(function(e,t,n){vi(this,U(this,e),U(this,t||e),n)}),extendSelection:gr(function(e,t,n){di(this,U(this,e),t&&U(this,t),n)}),extendSelections:gr(function(e,t){pi(this,K(this,e),t)}),extendSelectionsBy:gr(function(e,t){pi(this,K(this,v(this.sel.ranges,e)),t)}),setSelections:gr(function(e,t,n){var r=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new Cs(U(r,e[o].anchor),U(r,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),bi(this,Rr(i,t),n)}}),addSelection:gr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Cs(U(this,e),U(this,t||e))),bi(this,Rr(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this,r=this.sel.ranges,i=0;i<r.length;i++){var o=N(n,r[i].from(),r[i].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,n=[],r=this.sel.ranges,i=0;i<r.length;i++){var o=N(t,r[i].from(),r[i].to());!1!==e&&(o=o.join(e||t.lineSeparator())),n[i]=o}return n},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:gr(function(e,t,n){for(var r=this,i=[],o=this.sel,l=0;l<o.ranges.length;l++){var s=o.ranges[l];i[l]={from:s.from(),to:s.to(),text:r.splitLines(e[l]),origin:n}}for(var a=t&&"end"!=t&&Kr(this,i,t),u=i.length-1;u>=0;u--)Oi(r,i[u]);a?yi(this,a):this.cm&&Xn(this.cm)}),undo:gr(function(){Wi(this,"undo")}),redo:gr(function(){Wi(this,"redo")}),undoSelection:gr(function(){Wi(this,"undo",!0)}),redoSelection:gr(function(){Wi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Jr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:hi(this.history.done),undone:hi(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=hi(e.done.slice(0),null,!0),t.undone=hi(e.undone.slice(0),null,!0)},setGutterMarker:gr(function(e,t,n){return zi(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&C(r)&&(e.gutterMarkers=null),!0})}),clearGutter:gr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&zi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,C(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!H(this,e))return null;if(t=e,!(e=T(this,e)))return null}else if(null==(t=W(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:gr(function(t,n,r){return zi(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(t[i]){if(e(r).test(t[i]))return!1;t[i]+=" "+r}else t[i]=r;return!0})}),removeLineClass:gr(function(t,n,r){return zi(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==r)t[i]=null;else{var l=o.match(e(r));if(!l)return!1;var s=l.index+l[0].length;t[i]=o.slice(0,l.index)+(l.index&&s!=o.length?" ":"")+o.slice(s)||null}return!0})}),addLineWidget:gr(function(e,t,n){return Vi(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ki(this,U(this,e),U(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,
16
14
  handleMouseEvents:t&&t.handleMouseEvents};return e=U(this,e),Ki(this,e,e,n,"bookmark")},findMarksAt:function(e){e=U(this,e);var t=[],n=T(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=U(this,e),t=U(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||n&&!n(a.marker)||r.push(a.marker.parent||a.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),U(this,E(n,t))},indexFromPos:function(e){e=U(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ns(O(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ns(O(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Yi(r,Xi(this)),r},unlinkDoc:function(e){var t=this;if(e instanceof Bo&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=t.linked[n];if(r.doc==e){t.linked.splice(n,1),e.unlinkDoc(t),_i(Xi(t));break}}if(e.history==this.history){var i=[e.id];$r(e,function(e){return i.push(e.id)},!0),e.history=new Jr(null),e.history.done=hi(this.history.done,i),e.history.undone=hi(this.history.undone,i)}},iterLinkedDocs:function(e){$r(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ql(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:gr(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Qr(this.cm))})}),Ns.prototype.eachLine=Ns.prototype.iter;for(var Os=0,As=!1,Ws={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ds=0;Ds<10;Ds++)Ws[Ds+48]=Ws[Ds+96]=String(Ds);for(var Hs=65;Hs<=90;Hs++)Ws[Hs]=String.fromCharCode(Hs);for(var Fs=1;Fs<=12;Fs++)Ws[Fs+111]=Ws[Fs+63235]="F"+Fs;var Es={};Es.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Es.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Es.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Es.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Es.default=Sl?Es.macDefault:Es.pcDefault;var Ps={selectAll:Ti,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Il)},killLine:function(e){return co(e,function(t){if(t.empty()){var n=T(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:E(t.head.line+1,0)}:{from:t.head,to:E(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return co(e,function(t){return{from:E(t.from().line,0),to:U(e.doc,E(t.to().line+1,0))}})},delLineLeft:function(e){return co(e,function(e){return{from:E(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return co(e,function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}})},delWrappedLineRight:function(e){return co(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(E(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(E(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return po(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return fo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},zl)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},zl)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?po(e,t.head):r},zl)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=h(e.getLine(o.line),o.ch,r);t.push(p(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return fr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=T(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new E(i.line,i.ch-1)),i.ch>0)i=new E(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),E(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=T(e.doc,i.line-1).text;l&&(i=new E(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),E(i.line-1,l.length-1),i,"+transpose"))}n.push(new Cs(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return fr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Xn(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Is=new Dl,Rs=null,zs=function(e,t,n){this.time=e,this.pos=t,this.button=n};zs.prototype.compare=function(e,t,n){return this.time+400>e&&0==P(t,this.pos)&&n==this.button};var Bs,Gs,Us={toString:function(){return"CodeMirror.Init"}},Vs={},Ks={};Bo.defaults=Vs,Bo.optionHandlers=Ks;var js=[];Bo.defineInitHook=function(e){return js.push(e)};var Xs=null,Ys=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Dl,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ys.prototype.init=function(e){function t(e){if(!We(i,e)){if(i.somethingSelected())Vo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Yo(i);Vo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Il),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var n=Xs.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var l=$o(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=Xs.text.join("\n");var a=document.activeElement;Wl(s),setTimeout(function(){i.display.lineSpace.removeChild(l),a.focus(),a==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=e.lineDiv;_o(o,i.options.spellcheck),_l(o,"paste",function(e){We(i,e)||jo(e,i)||fl<=11&&setTimeout(dr(i,function(){return n.updateFromDOM()}),20)}),_l(o,"compositionstart",function(e){n.composing={data:e.data,done:!1}}),_l(o,"compositionupdate",function(e){n.composing||(n.composing={data:e.data,done:!1})}),_l(o,"compositionend",function(e){n.composing&&(e.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),_l(o,"touchstart",function(){return r.forceCompositionEnd()}),_l(o,"input",function(){n.composing||n.readFromDOMSoon()}),_l(o,"copy",t),_l(o,"cut",t)},Ys.prototype.prepareSelection=function(){var e=Nn(this.cm,!1);return e.focus=this.cm.state.focused,e},Ys.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ys.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom)return void e.removeAllRanges();var o=nl(t,e.anchorNode,e.anchorOffset),l=nl(t,e.focusNode,e.focusOffset);if(!o||o.bad||!l||l.bad||0!=P(B(o,l),r)||0!=P(z(o,l),i)){var s=t.display.view,a=r.line>=t.display.viewFrom&&Qo(t,r)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Qo(t,i);if(!u){var c=s[s.length-1].measure,h=c.maps?c.maps[c.maps.length-1]:c.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!a||!u)return void e.removeAllRanges();var f,d=e.rangeCount&&e.getRangeAt(0);try{f=Tl(a.node,a.offset,u.offset,u.node)}catch(e){}f&&(!sl&&t.state.focused?(e.collapse(a.node,a.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),d&&null==e.anchorNode?e.addRange(d):sl&&this.startGracePeriod()),this.rememberSelection()}},Ys.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ys.prototype.showMultipleSelections=function(e){n(this.cm.display.cursorDiv,e.cursors),n(this.cm.display.selectionDiv,e.selection)},Ys.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ys.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},Ys.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ys.prototype.blur=function(){this.div.blur()},Ys.prototype.getField=function(){return this.div},Ys.prototype.supportsTouch=function(){return!0},Ys.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():fr(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Ys.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ys.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(xl&&gl&&this.cm.options.gutters.length&&Jo(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=nl(t,e.anchorNode,e.anchorOffset),r=nl(t,e.focusNode,e.focusOffset);n&&r&&fr(t,function(){bi(t.doc,zr(n,r),Il),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ys.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(0==r.ch&&r.line>e.firstLine()&&(r=E(r.line-1,T(e.doc,r.line-1).length)),i.ch==T(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=E(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,s;r.line==t.viewFrom||0==(o=Mn(e,r.line))?(l=W(t.view[0].line),s=t.view[0].node):(l=W(t.view[o].line),s=t.view[o-1].node.nextSibling);var a,u,c=Mn(e,i.line);if(c==t.view.length-1?(a=t.viewTo-1,u=t.lineDiv.lastChild):(a=W(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var h=e.doc.splitLines(tl(e,s,u,l,a)),f=N(e.doc,E(l,0),E(a,T(e.doc,a).text.length));h.length>1&&f.length>1;)if(g(h)==g(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,v=h[0],m=f[0],y=Math.min(v.length,m.length);d<y&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var b=g(h),w=g(f),x=Math.min(b.length-(1==h.length?d:0),w.length-(1==f.length?d:0));p<x&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==h.length&&1==f.length&&l==r.line)for(;d&&d>r.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)d--,p++;h[h.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var C=E(l,d),S=E(a,f.length?g(f).length-p:0);return h.length>1||h[0]||P(C,S)?(Ei(e.doc,h,C,S,"+input"),!0):void 0},Ys.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ys.prototype.reset=function(){this.forceCompositionEnd()},Ys.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ys.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Ys.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||fr(this.cm,function(){return vr(e.cm)})},Ys.prototype.setUneditable=function(e){e.contentEditable="false"},Ys.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||dr(this.cm,Ko)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ys.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ys.prototype.onContextMenu=function(){},Ys.prototype.resetPosition=function(){},Ys.prototype.needsContentAttribute=!0;var _s=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Dl,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};_s.prototype.init=function(e){function t(e){if(!We(i,e)){if(i.somethingSelected())Vo({lineWise:!1,text:i.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,l.value=Xs.text.join("\n"),Wl(l));else{if(!i.options.lineWiseCopyCut)return;var t=Yo(i);Vo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Il):(r.prevInput="",l.value=t.text.join("\n"),Wl(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var n=this,r=this,i=this.cm,o=this.wrapper=$o(),l=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),wl&&(l.style.width="0px"),_l(l,"input",function(){hl&&fl>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),_l(l,"paste",function(e){We(i,e)||jo(e,i)||(i.state.pasteIncoming=!0,r.fastPoll())}),_l(l,"cut",t),_l(l,"copy",t),_l(e.scroller,"paste",function(t){zt(e,t)||We(i,t)||(i.state.pasteIncoming=!0,r.focus())}),_l(e.lineSpace,"selectstart",function(t){zt(e,t)||Ee(t)}),_l(l,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),_l(l,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},_s.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Nn(e);if(e.options.moveInputWithCursor){var i=fn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},_s.prototype.showSelection=function(e){var t=this.cm,r=t.display;n(r.cursorDiv,e.cursors),n(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},_s.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Ql&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var l=t?"-":n||r.getSelection();this.textarea.value=l,r.state.focused&&Wl(this.textarea),hl&&fl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",hl&&fl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},_s.prototype.getField=function(){return this.textarea},_s.prototype.supportsTouch=function(){return!1},_s.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Cl||l()!=this.textarea))try{this.textarea.focus()}catch(e){}},_s.prototype.blur=function(){this.textarea.blur()},_s.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},_s.prototype.receivedFocus=function(){this.slowPoll()},_s.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},_s.prototype.fastPoll=function(){function e(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},_s.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Zl(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(hl&&fl>=9&&this.hasSelection===i||Sl&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(r.length,i.length);l<s&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return fr(t,function(){Ko(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},_s.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},_s.prototype.onKeyPress=function(){hl&&fl>=9&&(this.hasSelection=null),this.fastPoll()},_s.prototype.onContextMenu=function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,r.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=c,l.style.cssText=u,hl&&fl<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!hl||hl&&fl<9)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==r.prevInput?dr(i,Ti)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,l=r.textarea,s=kn(i,e),a=o.scroller.scrollTop;if(s&&!vl){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&dr(i,bi)(i.doc,zr(s),Il);var u=l.style.cssText,c=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(hl?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(dl&&(f=window.scrollY),o.input.focus(),dl&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(l.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),hl&&fl>=9&&t(),Ol){Re(e);var d=function(){Oe(window,"mouseup",d),setTimeout(n,20)};_l(window,"mouseup",d)}else setTimeout(n,50)}},_s.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},_s.prototype.setUneditable=function(){},_s.prototype.needsContentAttribute=!1,function(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=Us&&i(e,t,n)}:i)}var n=e.optionHandlers;e.defineOption=t,e.Init=Us,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,jr(e)},!0),t("indentUnit",2,jr,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Xr(e),ln(e),vr(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(E(r,o))}r++});for(var i=n.length-1;i>=0;i--)Ei(e.doc,t,n[i],E(n[i].line,n[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Us&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",Cl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!kl),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Po(e),Io(e)},!0),t("keyMap","default",function(e,t,n){var r=uo(t),i=n!=Us&&uo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,zo,!0),t("gutters",[],function(e){Fr(e.options),Io(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Cn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return tr(e)},!0),t("scrollbarStyle","native",function(e){rr(e),tr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Fr(e.options),Io(e)},!0),t("firstLineNumber",1,Io,!0),t("lineNumberFormatter",function(e){return e},Io,!0),t("showCursorWhenSelecting",!1,Tn,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(En(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Ro),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Tn,!0),t("singleCursorHeightPerLine",!0,Tn,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Xr,!0),t("addModeClass",!1,Xr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Xr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Bo),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&dr(this,t[e])(this,n,i),Ae(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](uo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:pr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,vr(this)}),removeOverlay:pr(function(e){for(var t=this,n=this.state.overlays,r=0;r<n.length;++r){var i=n[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return n.splice(r,1),t.state.modeGen++,void vr(t)}}),indentLine:pr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),H(this.doc,e)&&Uo(this,e,t,n)}),indentSelection:pr(function(e){for(var t=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var o=n[i];if(o.empty())o.head.line>r&&(Uo(t,o.head.line,e,!0),r=o.head.line,i==t.doc.sel.primIndex&&Xn(t));else{var l=o.from(),s=o.to(),a=Math.max(r,l.line);r=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u<r;++u)Uo(t,u,e);var c=t.doc.sel.ranges;0==l.ch&&n.length==c.length&&c[i].from().ch>0&&gi(t.doc,i,new Cs(l,c[i].to()),Il)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,E(e),t,!0)},getTokenTypeAt:function(e){e=U(this.doc,e);var t,n=Je(this,T(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=this,i=[];if(!n.hasOwnProperty(t))return i;var o=n[t],l=this.getModeAt(e);if("string"==typeof l[t])o[l[t]]&&i.push(o[l[t]]);else if(l[t])for(var s=0;s<l[t].length;s++){var a=o[l[t][s]];a&&i.push(a)}else l.helperType&&o[l.helperType]?i.push(o[l.helperType]):o[l.name]&&i.push(o[l.name]);for(var u=0;u<o._global.length;u++){var c=o._global[u];c.pred(l,r)&&-1==f(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var n=this.doc;return e=G(n,null==e?n.first+n.size-1:e),et(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?U(this.doc,e):e?r.from():r.to(),fn(this,n,t||"page")},charCoords:function(e,t){return hn(this,U(this.doc,e),t||"page")},coordsChar:function(e,t){return e=cn(this,e,t||"page"),gn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=cn(this,{top:e,left:0},t||"page").top,D(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=T(this.doc,e)}else r=e;return un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-ye(r):0)},defaultTextHeight:function(){return bn(this.display)},defaultCharWidth:function(){return wn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=fn(this,U(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Vn(this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:pr(wo),triggerOnKeyPress:pr(So),triggerOnKeyUp:Co,triggerOnMouseDown:pr(ko),execCommand:function(e){if(Ps.hasOwnProperty(e))return Ps[e].call(null,this)},triggerElectric:pr(function(e){Xo(this,e)}),findPosH:function(e,t,n,r){var i=this,o=1;t<0&&(o=-1,t=-t)
17
15
  ;for(var l=U(this.doc,e),s=0;s<t&&(l=qo(i.doc,l,o,n,r),!l.hitSide);++s);return l},moveH:pr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?qo(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},zl)}),deleteH:pr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):co(this,function(n){var i=qo(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=this,o=1,l=r;t<0&&(o=-1,t=-t);for(var s=U(this.doc,e),a=0;a<t;++a){var u=fn(i,s,"div");if(null==l?l=u.left:u.left=l,s=Zo(i,u,o,n),s.hitSide)break}return s},moveV:pr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var s=fn(n,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Zo(n,s,e,t);return"page"==t&&l==r.sel.primary()&&jn(n,hn(n,a,"div").top-s.top),a},zl),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,n=T(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;for(var l=n.charAt(r),s=x(l,o)?function(e){return x(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!x(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new Cs(E(e.line,r),E(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?s(this.display.cursorDiv,"CodeMirror-overwrite"):Al(this.display.cursorDiv,"CodeMirror-overwrite"),Ae(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==l()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:pr(function(e,t){Yn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Vt(this)-this.display.barHeight,width:e.scrollWidth-Vt(this)-this.display.barWidth,clientHeight:jt(this),clientWidth:Kt(this)}},scrollIntoView:pr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:E(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?_n(this,e):qn(this,e.from,e.to,e.margin)}),setSize:pr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&on(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ae(this,"refresh",this)}),operation:function(e){return fr(this,e)},refresh:pr(function(){var e=this.display.cachedTextHeight;vr(this),this.curOp.forceUpdate=!0,ln(this),Yn(this,this.doc.scrollLeft,this.doc.scrollTop),Wr(this),(null==e||Math.abs(e-bn(this.display))>.5)&&Ln(this),Ae(this,"refresh",this)}),swapDoc:pr(function(e){var t=this.doc;return t.cm=null,qr(this,e),ln(this),this.display.input.reset(),Yn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Lt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Fe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Bo);var $s="iter insert remove copy getEditor constructor".split(" ");for(var qs in Ns.prototype)Ns.prototype.hasOwnProperty(qs)&&f($s,qs)<0&&(Bo.prototype[qs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ns.prototype[qs]));return Fe(Ns),Bo.inputStyles={textarea:_s,contenteditable:Ys},Bo.defineMode=function(e){Bo.defaults.mode||"null"==e||(Bo.defaults.mode=e),Ke.apply(this,arguments)},Bo.defineMIME=je,Bo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Bo.defineMIME("text/plain","null"),Bo.defineExtension=function(e,t){Bo.prototype[e]=t},Bo.defineDocExtension=function(e,t){Ns.prototype[e]=t},Bo.fromTextArea=il,function(e){e.off=Oe,e.on=_l,e.wheelEventPixels=Pr,e.Doc=Ns,e.splitLines=ql,e.countColumn=h,e.findColumn=d,e.isWordChar=w,e.Pass=Pl,e.signal=Ae,e.Line=ss,e.changeEnd=Br,e.scrollbarModel=vs,e.Pos=E,e.cmpPos=P,e.modes=es,e.mimeModes=ts,e.resolveMode=Xe,e.getMode=Ye,e.modeExtensions=ns,e.extendMode=_e,e.copyState=$e,e.startState=Ze,e.innerMode=qe,e.commands=Ps,e.keyMap=Es,e.keyName=ao,e.isModifierKey=lo,e.lookupKey=oo,e.normalizeKeyMap=io,e.StringStream=rs,e.SharedTextMarker=Ms,e.TextMarker=ks,e.LineWidget=Ss,e.e_preventDefault=Ee,e.e_stopPropagation=Pe,e.e_stop=Re,e.addClass=s,e.contains=o,e.rmClass=Al,e.keyNames=Ws}(Bo),Bo.version="5.27.4",Bo});
18
- },{}],7:[function(require,module,exports){
16
+ },{}],6:[function(require,module,exports){
19
17
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,o,a){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=o,this.prev=a}function n(e,n,r,o){var a=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(a=e.context.indented),e.context=new t(a,n,r,o,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function o(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function a(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function l(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function s(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=s;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function c(e,t){return"type"==t.prevToken&&"type"}function u(e){return e.eatWhile(/[\w\.']/),"number"}function d(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=m,m(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function f(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function p(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function m(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function h(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&o.push(t)}"string"==typeof t&&(t=[t]);var o=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),o.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],o));for(var a=0;a<t.length;++a)e.defineMIME(t[a],n)}function g(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}function y(e){return function(t,n){for(var r,o=!1,a=!1;!t.eol();){if(!e&&!o&&t.match('"')){a=!0;break}if(e&&t.match('"""')){a=!0;break}r=t.next(),!o&&"$"==r&&t.match("{")&&t.skipTo("}"),o=!o&&"\\"==r&&!e}return!a&&e||(n.tokenize=null),"string"}}function x(e){return function(t,n){for(var r,o=!1,a=!1;!t.eol();){if(!o&&t.match('"')&&("single"==e||t.match('""'))){a=!0;break}if(!o&&t.match("``")){w=x(e),a=!0;break}r=t.next(),o="single"==e&&!o&&"\\"==r}return a&&(n.tokenize=null),"string"}}e.defineMode("clike",function(i,s){function c(e,t){var n=e.next();if(S[n]){var r=S[n](e,t);if(!1!==r)return r}if('"'==n||"'"==n)return t.tokenize=u(n),t.tokenize(e,t);if(D.test(n))return p=n,null;if(L.test(n)){if(e.backUp(1),e.match(I))return"number";e.next()}if("/"==n){if(e.eat("*"))return t.tokenize=d,d(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(F.test(n)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(F););return"operator"}if(e.eatWhile(z),P)for(;e.match(P);)e.eatWhile(z);var o=e.current();return l(x,o)?(l(w,o)&&(p="newstatement"),l(v,o)&&(m=!0),"keyword"):l(b,o)?"type":l(k,o)?(l(w,o)&&(p="newstatement"),"builtin"):l(_,o)?"atom":"variable"}function u(e){return function(t,n){for(var r,o=!1,a=!1;null!=(r=t.next());){if(r==e&&!o){a=!0;break}o=!o&&"\\"==r}return(a||!o&&!C)&&(n.tokenize=null),"string"}}function d(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function f(e,t){s.typeFirstDefinitions&&e.eol()&&a(t.context)&&(t.typeAtEndOfLine=o(e,t,e.pos))}var p,m,h=i.indentUnit,g=s.statementIndentUnit||h,y=s.dontAlignCalls,x=s.keywords||{},b=s.types||{},k=s.builtin||{},w=s.blockKeywords||{},v=s.defKeywords||{},_=s.atoms||{},S=s.hooks||{},C=s.multiLineStrings,T=!1!==s.indentStatements,M=!1!==s.indentSwitch,P=s.namespaceSeparator,D=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,L=s.numberStart||/[\d\.]/,I=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,F=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,z=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-h,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return f(e,t),null;p=m=null;var l=(t.tokenize||c)(e,t);if("comment"==l||"meta"==l)return l;if(null==i.align&&(i.align=!0),";"==p||":"==p||","==p&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==i.type;)i=r(t);for("}"==i.type&&(i=r(t));"statement"==i.type;)i=r(t)}else p==i.type?r(t):T&&(("}"==i.type||"top"==i.type)&&";"!=p||"statement"==i.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&o(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),S.token){var u=S.token(e,t,l);void 0!==u&&(l=u)}return"def"==l&&!1===s.styleDefs&&(l="variable"),t.startOfLine=!1,t.prevToken=m?"def":l||p,f(e,t),l},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,o=n&&n.charAt(0);if("statement"==r.type&&"}"==o&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(S.indent){var a=S.indent(t,r,n);if("number"==typeof a)return a}var i=o==r.type,l=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(o)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==o?0:g):!r.align||y&&")"==r.type?")"!=r.type||i?r.indented+(i?0:h)+(i||!l||/^(?:case|default)\b/.test(n)?0:h):r.indented+g:r.column+(i?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",k="int long char short double float unsigned signed void size_t ptrdiff_t";h(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:i(b),types:i(k+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:i("case do else for if switch while struct"),defKeywords:i("struct"),typeFirstDefinitions:!0,atoms:i("null true false"),hooks:{"#":s,"*":c},modeProps:{fold:["brace","include"]}}),h(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:i(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:i(k+" bool wchar_t"),blockKeywords:i("catch class do else finally for if struct switch try while"),defKeywords:i("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:i("true false null"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":s,"*":c,u:d,U:d,L:d,R:d,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&f(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),h("text/x-java",{name:"clike",keywords:i("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:i("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:i("catch class do else finally for if switch try while"),defKeywords:i("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:i("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),h("text/x-csharp",{name:"clike",keywords:i("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:i("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:i("catch class do else finally for foreach if struct switch try while"),defKeywords:i("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:i("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),h("text/x-scala",{name:"clike",keywords:i("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:i("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:i("catch class enum do else finally for forSome if match switch try while"),defKeywords:i("class enum def object package trait type val var"),atoms:i("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),h("text/x-kotlin",{name:"clike",keywords:i("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend"),types:i("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:i("catch class do else finally for if where try while enum"),defKeywords:i("class val var object package interface fun"),atoms:i("true false null this"),hooks:{'"':function(e,t){return t.tokenize=y(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:i("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:i("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:i("for while do if else struct"),builtin:i("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:i("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":s},modeProps:{fold:["brace","include"]}}),h("text/x-nesc",{name:"clike",keywords:i(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:i(k),blockKeywords:i("case do else for if switch while struct"),atoms:i("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),h("text/x-objectivec",{name:"clike",keywords:i(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:i(k),atoms:i("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":s,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),h("text/x-squirrel",{name:"clike",keywords:i("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:i(k),blockKeywords:i("case catch class else for foreach if switch try while"),defKeywords:i("function local class"),typeFirstDefinitions:!0,atoms:i("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var w=null;h("text/x-ceylon",{name:"clike",keywords:i("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:i("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:i("class dynamic function interface module object package value"),builtin:i("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:i("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=x(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!w||!e.match("`"))&&(t.tokenize=w,w=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})});
20
- },{"../../lib/codemirror":6}],8:[function(require,module,exports){
18
+ },{"../../lib/codemirror":5}],7:[function(require,module,exports){
21
19
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,o=!1;null!=(r=e.next());){if(o&&"/"==r){t.tokenize=null;break}o="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function o(e,t){return h=t,e}function a(e,t){var r=e.next();if(f[r]){var a=f[r](e,t);if(!1!==a)return a}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=n,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0}function i(e){return function(t,r){for(var a,i=!1;null!=(a=t.next());){if(a==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==a}return(a==e||!i&&")"!=e)&&(r.tokenize=null),o("string","string")}}function n(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=i(")"),o(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,o){return e.context=new l(r,t.indentation()+(!1===o?0:b),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function d(e,t,r){return _[r.context.type](e,t,r)}function p(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return d(e,t,r)}function u(e){var t=e.current().toLowerCase();g=K.hasOwnProperty(t)?"atom":P.hasOwnProperty(t)?"keyword":"variable"}var m=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var h,g,b=t.indentUnit,f=r.tokenHooks,y=r.documentTypes||{},w=r.mediaTypes||{},k=r.mediaFeatures||{},v=r.mediaValueKeywords||{},x=r.propertyKeywords||{},z=r.nonStandardPropertyKeywords||{},j=r.fontProperties||{},q=r.counterDescriptors||{},P=r.colorKeywords||{},K=r.valueKeywords||{},B=r.allowNested,C=r.lineComment,T=!0===r.supportsAtComponent,_={};return _.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(T&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(B&&"("==e)return s(r,t,"parens")}return r.context.type},_.block=function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return x.hasOwnProperty(o)?(g="property","maybeprop"):z.hasOwnProperty(o)?(g="string-2","maybeprop"):B?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":B||"hash"!=e&&"qualifier"!=e?_.top(e,t,r):(g="error","block")},_.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},_.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&B)return s(r,t,"propBlock");if("}"==e||"{"==e)return p(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)u(t);else if("interpolation"==e)return s(r,t,"interpolation")}else g+=" error";return"prop"},_.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(g="property","maybeprop"):r.context.type},_.parens=function(e,t,r){return"{"==e||"}"==e?p(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&u(t),"parens")},_.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(g="variable-3",r.context.type):d(e,t,r)},_.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(g="tag",r.context.type):_.atBlock(e,t,r)},_.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return p(e,t,r);if("{"==e)return c(r)&&s(r,t,B?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var o=t.current().toLowerCase();g="only"==o||"not"==o||"and"==o||"or"==o?"keyword":w.hasOwnProperty(o)?"attribute":k.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"keyword":x.hasOwnProperty(o)?"property":z.hasOwnProperty(o)?"string-2":K.hasOwnProperty(o)?"atom":P.hasOwnProperty(o)?"keyword":"error"}return r.context.type},_.atComponentBlock=function(e,t,r){return"}"==e?p(e,t,r):"{"==e?c(r)&&s(r,t,B?"block":"top",!1):("word"==e&&(g="error"),r.context.type)},_.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?p(e,t,r,2):_.atBlock(e,t,r)},_.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(g="variable","restricted_atBlock_before"):d(e,t,r)},_.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(g="@font-face"==r.stateArg&&!j.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!q.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},_.keyframes=function(e,t,r){return"word"==e?(g="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},_.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?p(e,t,r):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},_.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?p(e,t,r):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:m?"block":"top",stateArg:null,context:new l(m?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||a)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),g=r,t.state=_[t.state](h,e,t),g},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),r.prev&&("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=Math.max(0,r.indent-b)):(r=r.prev,a=r.indent)),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:C,fold:"brace"}});var o=["domain","regexp","url","url-prefix"],a=t(o),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],n=t(i),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],d=t(c),p=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(p),m=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(m),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],b=t(g),f=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(f),w=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],k=t(w),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(v),z=o.concat(i).concat(l).concat(c).concat(p).concat(m).concat(w).concat(v);e.registerHelper("hintWords","css",z),e.defineMIME("text/css",{documentTypes:a,mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:b,counterDescriptors:y,colorKeywords:k,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:x,fontProperties:b,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:x,fontProperties:b,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:a,mediaTypes:n,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:b,counterDescriptors:y,colorKeywords:k,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})});
22
- },{"../../lib/codemirror":6}],9:[function(require,module,exports){
20
+ },{"../../lib/codemirror":5}],8:[function(require,module,exports){
23
21
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("go",function(t){function n(e,t){var n=e.next();if('"'==n||"'"==n||"`"==n)return t.tokenize=r(n),t.tokenize(e,t);if(/[\d\.]/.test(n))return"."==n?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==n?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(n))return u=n,null;if("/"==n){if(e.eat("*"))return t.tokenize=i,i(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(n))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return f.propertyIsEnumerable(o)?("case"!=o&&"default"!=o||(u="case"),"keyword"):s.propertyIsEnumerable(o)?"atom":"variable"}function r(e){return function(t,r){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}o=!o&&"`"!=e&&"\\"==i}return(a||!o&&"`"!=e)&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("/"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function o(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function a(e,t,n){return e.context=new o(e.indented,t,n,null,e.context)}function c(e){if(e.context.prev){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}}var u,l=t.indentUnit,f={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0},s={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new o((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;u=null;var i=(t.tokenize||n)(e,t);return"comment"==i?i:(null==r.align&&(r.align=!0),"{"==u?a(t,e.column(),"}"):"["==u?a(t,e.column(),"]"):"("==u?a(t,e.column(),")"):"case"==u?r.type="case":"}"==u&&"}"==r.type?c(t):u==r.type&&c(t),t.startOfLine=!1,i)},indent:function(t,r){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var i=t.context,o=r&&r.charAt(0);if("case"==i.type&&/^(?:case|default)\b/.test(r))return t.context.type="}",i.indented;var a=o==i.type;return i.align?i.column+(a?0:1):i.indented+(a?0:l)},electricChars:"{}):",closeBrackets:"()[]{}''\"\"``",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")});
24
- },{"../../lib/codemirror":6}],10:[function(require,module,exports){
22
+ },{"../../lib/codemirror":5}],9:[function(require,module,exports){
25
23
  !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e,a){var n=t.current(),l=n.search(e);return l>-1?t.backUp(n.length-l):n.match(/<\/?$/)&&(t.backUp(n.length),t.match(e,!1)||t.match(n)),a}function a(t){var e=i[t];return e||(i[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function n(t,e){var n=t.match(a(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function l(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function r(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],r=l.length-1;r>=0;r--)n.unshift(l[r])}function o(t,e){for(var a=0;a<t.length;a++){var l=t[a];if(!l[0]||l[1].test(n(e,l[0])))return l[2]}}var c={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},i={};t.defineMode("htmlmixed",function(a,n){function i(n,r){var c,m=s.token(n,r.htmlState),d=/\btag\b/.test(m);if(d&&!/[<>\s\/]/.test(n.current())&&(c=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(c))r.inTag=c+" ";else if(r.inTag&&d&&/>$/.test(n.current())){var f=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var p=">"==n.current()&&o(u[f[1]],f[2]),g=t.getMode(a,p),h=l(f[1],!0),S=l(f[1],!1);r.token=function(t,a){return t.match(h,!1)?(a.token=i,a.localState=a.localMode=null,null):e(t,S,a.localMode.token(t,a.localState))},r.localMode=g,r.localState=t.startState(g,s.indent(r.htmlState,""))}else r.inTag&&(r.inTag+=n.current(),n.eol()&&(r.inTag+=" "));return m}var s=t.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},m=n&&n.tags,d=n&&n.scriptTypes;if(r(c,u),m&&r(m,u),d)for(var f=d.length-1;f>=0;f--)u.script.unshift(["type",d[f].matches,d[f].mode]);return{startState:function(){return{token:i,inTag:null,localMode:null,localState:null,htmlState:t.startState(s)}},copyState:function(e){var a;return e.localState&&(a=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:a,htmlState:t.copyState(s,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,a,n){return!e.localMode||/^\s*<\//.test(a)?s.indent(e.htmlState,a):e.localMode.indent?e.localMode.indent(e.localState,a,n):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||s}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")});
26
- },{"../../lib/codemirror":6,"../css/css":8,"../javascript/javascript":11,"../xml/xml":18}],11:[function(require,module,exports){
24
+ },{"../../lib/codemirror":5,"../css/css":7,"../javascript/javascript":10,"../xml/xml":17}],10:[function(require,module,exports){
27
25
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function a(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return Ve=e,Ee=r,t}function o(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=c(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(r.tokenize=u,u(e,r)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,r,1)?(a(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Oe),i("operator","operator",e.current()));if("`"==n)return r.tokenize=l,l(e,r);if("#"==n)return e.skipToEnd(),i("error","error");if(Oe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(Oe),i("operator","operator",e.current());if(qe.test(n)){e.eatWhile(qe);var o=e.current();if("."!=r.lastType){if(Ce.propertyIsEnumerable(o)){var s=Ce[o];return i(s.type,s.style,o)}if("async"==o&&e.match(/^\s*[\(\w]/,!1))return i("async","keyword",o)}return i("variable","variable",o)}}function c(e){return function(t,r){var n,a=!1;if(Ae&&"@"==t.peek()&&t.match(We))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function u(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if($e){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,i=!1,o=r-1;o>=0;--o){var c=e.string.charAt(o),u=Pe.indexOf(c);if(u>=0&&u<3){if(!a){++o;break}if(0==--a){"("==c&&(i=!0);break}}else if(u>=3&&u<6)++a;else if(qe.test(c))i=!0;else{if(/["'\/]/.test(c))return;if(i&&!a){++o;break}}}i&&!a&&(t.fatArrowAt=o)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,a){var i=e.cc;for(Ne.state=e,Ne.stream=a,Ne.marked=null,Ne.cc=i,Ne.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((i.length?i.pop():Te?j:g)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Ne.marked?Ne.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Ne.cc.push(arguments[e])}function v(){return m.apply(null,arguments),!0}function y(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ne.state;if(Ne.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function k(){Ne.state.context={prev:Ne.state.context,vars:Ne.state.localVars},Ne.state.localVars=Be}function b(){Ne.state.localVars=Ne.state.context.vars,Ne.state.context=Ne.state.context.prev}function x(e,t){var r=function(){var r=Ne.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,Ne.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function h(){var e=Ne.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?v():";"==e?m():v(t)}return t}function g(e,t){return"var"==e?v(x("vardef",t.length),Z,w(";"),h):"keyword a"==e?v(x("form"),V,g,h):"keyword b"==e?v(x("form"),g,h):"{"==e?v(x("}"),J,h):";"==e?v():"if"==e?("else"==Ne.state.lexical.info&&Ne.state.cc[Ne.state.cc.length-1]==h&&Ne.state.cc.pop()(),v(x("form"),V,g,h,ne)):"function"==e?v(le):"for"==e?v(x("form"),ae,g,h):"variable"==e?$e&&"type"==t?(Ne.marked="keyword",v(L,w("operator"),L,w(";"))):v(x("stat"),N):"switch"==e?v(x("form"),V,w("{"),x("}","switch"),J,h,h):"case"==e?v(j,w(":")):"default"==e?v(w(":")):"catch"==e?v(x("form"),k,w("("),se,w(")"),g,h,b):"class"==e?v(x("form"),de,h):"export"==e?v(x("stat"),ye,h):"import"==e?v(x("stat"),be,h):"module"==e?v(x("form"),_,w("{"),x("}"),J,h,h):"async"==e?v(g):"@"==t?v(j,g):m(x("stat"),j,w(";"),h)}function j(e){return E(e,!1)}function M(e){return E(e,!0)}function V(e){return"("!=e?m():v(x(")"),j,w(")"),h)}function E(e,t){if(Ne.state.fatArrowAt==Ne.stream.start){var r=t?O:C;if("("==e)return v(k,x(")"),F(_,")"),h,w("=>"),r,b);if("variable"==e)return m(k,_,w("=>"),r,b)}var n=t?T:A;return Se.hasOwnProperty(e)?v(n):"function"==e?v(le,n):"class"==e?v(x("form"),fe,h):"keyword c"==e||"async"==e?v(t?z:I):"("==e?v(x(")"),I,w(")"),h,n):"operator"==e||"spread"==e?v(t?M:j):"["==e?v(x("]"),je,h,n):"{"==e?G(H,"}",null,n):"quasi"==e?m($,n):"new"==e?v(W(t)):v()}function I(e){return e.match(/[;\}\)\],]/)?m():m(j)}function z(e){return e.match(/[;\}\)\],]/)?m():m(M)}function A(e,t){return","==e?v(j):T(e,t,!1)}function T(e,t,r){var n=0==r?A:T,a=0==r?j:M;return"=>"==e?v(k,r?O:C,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(j,w(":"),a):v(a):"quasi"==e?m($,n):";"!=e?"("==e?G(M,")","call",n):"."==e?v(B,n):"["==e?v(x("]"),I,w("]"),h,n):$e&&"as"==t?(Ne.marked="keyword",v(L,n)):void 0:void 0}function $(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?v($):v(j,q)}function q(e){if("}"==e)return Ne.marked="string-2",Ne.state.tokenize=l,v($)}function C(e){return s(Ne.stream,Ne.state),m("{"==e?g:j)}function O(e){return s(Ne.stream,Ne.state),m("{"==e?g:M)}function W(e){return function(t){return"."==t?v(e?S:P):m(e?M:j)}}function P(e,t){if("target"==t)return Ne.marked="keyword",v(A)}function S(e,t){if("target"==t)return Ne.marked="keyword",v(T)}function N(e){return":"==e?v(h,g):m(A,w(";"),h)}function B(e){if("variable"==e)return Ne.marked="property",v()}function H(e,t){return"async"==e?(Ne.marked="property",v(H)):"variable"==e||"keyword"==Ne.style?(Ne.marked="property",v("get"==t||"set"==t?U:D)):"number"==e||"string"==e?(Ne.marked=Ae?"property":Ne.style+" property",v(D)):"jsonld-keyword"==e?v(D):"modifier"==e?v(H):"["==e?v(j,w("]"),D):"spread"==e?v(j,D):":"==e?m(D):void 0}function U(e){return"variable"!=e?m(D):(Ne.marked="property",v(le))}function D(e){return":"==e?v(M):"("==e?m(le):void 0}function F(e,t,r){function n(a,i){if(r?r.indexOf(a)>-1:","==a){var o=Ne.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),v(function(r,n){return r==t||n==t?m():m(e)},n)}return a==t||i==t?v():v(w(t))}return function(r,a){return r==t||a==t?v():m(e,n)}}function G(e,t,r){for(var n=3;n<arguments.length;n++)Ne.cc.push(arguments[n]);return v(x(t,r),F(e,t),h)}function J(e){return"}"==e?v():m(g,J)}function K(e,t){if($e){if(":"==e)return v(L);if("?"==t)return v(K)}}function L(e){return"variable"==e?(Ne.marked="type",v(Y)):"string"==e||"number"==e||"atom"==e?v(Y):"{"==e?v(x("}"),F(R,"}",",;"),h,Y):"("==e?v(F(X,")"),Q):void 0}function Q(e){if("=>"==e)return v(L)}function R(e,t){return"variable"==e||"keyword"==Ne.style?(Ne.marked="property",v(R)):"?"==t?v(R):":"==e?v(L):"["==e?v(j,K,w("]"),R):void 0}function X(e){return"variable"==e?v(X):":"==e?v(L):void 0}function Y(e,t){return"<"==t?v(x(">"),F(L,">"),h,Y):"|"==t||"."==e?v(L):"["==e?v(w("]"),Y):"extends"==t?v(L):void 0}function Z(){return m(_,K,te,re)}function _(e,t){return"modifier"==e?v(_):"variable"==e?(y(t),v()):"spread"==e?v(_):"["==e?G(_,"]"):"{"==e?G(ee,"}"):void 0}function ee(e,t){return"variable"!=e||Ne.stream.match(/^\s*:/,!1)?("variable"==e&&(Ne.marked="property"),"spread"==e?v(_):"}"==e?m():v(w(":"),_,te)):(y(t),v(te))}function te(e,t){if("="==t)return v(M)}function re(e){if(","==e)return v(Z)}function ne(e,t){if("keyword b"==e&&"else"==t)return v(x("form","else"),g,h)}function ae(e){if("("==e)return v(x(")"),ie,w(")"),h)}function ie(e){return"var"==e?v(Z,w(";"),ce):";"==e?v(ce):"variable"==e?v(oe):m(j,w(";"),ce)}function oe(e,t){return"in"==t||"of"==t?(Ne.marked="keyword",v(j)):v(A,ce)}function ce(e,t){return";"==e?v(ue):"in"==t||"of"==t?(Ne.marked="keyword",v(j)):m(j,w(";"),ue)}function ue(e){")"!=e&&v(j)}function le(e,t){return"*"==t?(Ne.marked="keyword",v(le)):"variable"==e?(y(t),v(le)):"("==e?v(k,x(")"),F(se,")"),h,K,g,b):$e&&"<"==t?v(x(">"),F(L,">"),h,le):void 0}function se(e){return"spread"==e?v(se):m(_,K,te)}function fe(e,t){return"variable"==e?de(e,t):pe(e,t)}function de(e,t){if("variable"==e)return y(t),v(pe)}function pe(e,t){return"<"==t?v(x(">"),F(L,">"),h,pe):"extends"==t||"implements"==t||$e&&","==e?v($e?L:j,pe):"{"==e?v(x("}"),me,h):void 0}function me(e,t){return"variable"==e||"keyword"==Ne.style?("async"==t||"static"==t||"get"==t||"set"==t||$e&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&Ne.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ne.marked="keyword",v(me)):(Ne.marked="property",v($e?ve:le,me)):"["==e?v(j,w("]"),$e?ve:le,me):"*"==t?(Ne.marked="keyword",v(me)):";"==e?v(me):"}"==e?v():"@"==t?v(j,me):void 0}function ve(e,t){return"?"==t?v(ve):":"==e?v(L,te):"="==t?v(M):m(le)}function ye(e,t){return"*"==t?(Ne.marked="keyword",v(ge,w(";"))):"default"==t?(Ne.marked="keyword",v(j,w(";"))):"{"==e?v(F(ke,"}"),ge,w(";")):m(g)}function ke(e,t){return"as"==t?(Ne.marked="keyword",v(w("variable"))):"variable"==e?m(M,ke):void 0}function be(e){return"string"==e?v():m(xe,he,ge)}function xe(e,t){return"{"==e?G(xe,"}"):("variable"==e&&y(t),"*"==t&&(Ne.marked="keyword"),v(we))}function he(e){if(","==e)return v(xe,he)}function we(e,t){if("as"==t)return Ne.marked="keyword",v(xe)}function ge(e,t){if("from"==t)return Ne.marked="keyword",v(j)}function je(e){return"]"==e?v():m(F(M,"]"))}function Me(e,t){return"operator"==e.lastType||","==e.lastType||Oe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Ve,Ee,Ie=r.indentUnit,ze=n.statementIndent,Ae=n.jsonld,Te=n.json||Ae,$e=n.typescript,qe=n.wordCharacters||/[\w$\xa1-\uffff]/,Ce=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n};if($e){var c={type:"variable",style:"type"},u={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),string:c,number:c,boolean:c,any:c};for(var l in u)o[l]=u[l]}return o}(),Oe=/[+\-*&%=<>!?|~^@]/,We=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Pe="([{}])",Se={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ne={state:null,column:null,marked:null,cc:null},Be={name:"this",next:{name:"arguments"}};return h.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new f((e||0)-Ie,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=u&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Ve?r:(t.lastType="operator"!=Ve||"++"!=Ee&&"--"!=Ee?Ve:"incdec",p(t,r,Ve,Ee,e))},indent:function(t,r){if(t.tokenize==u)return e.Pass;if(t.tokenize!=o)return 0;var a,i=r&&r.charAt(0),c=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var s=t.cc[l];if(s==h)c=c.prev;else if(s!=ne)break}for(;("stat"==c.type||"form"==c.type)&&("}"==i||(a=t.cc[t.cc.length-1])&&(a==A||a==T)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;ze&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var f=c.type,d=i==f;return"vardef"==f?c.indented+("operator"==t.lastType||","==t.lastType?c.info+1:0):"form"==f&&"{"==i?c.indented:"form"==f?c.indented+Ie:"stat"==f?c.indented+(Me(t,r)?ze||Ie:0):"switch"!=c.info||d||0==n.doubleIndentSwitch?c.align?c.column+(d?0:1):c.indented+(d?0:Ie):c.indented+(/^(?:case|default)\b/.test(r)?Ie:2*Ie)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Te?null:"/*",blockCommentEnd:Te?null:"*/",lineComment:Te?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Te?"json":"javascript",jsonldMode:Ae,jsonMode:Te,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})});
28
- },{"../../lib/codemirror":6}],12:[function(require,module,exports){
26
+ },{"../../lib/codemirror":5}],11:[function(require,module,exports){
29
27
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},_=e.split(" "),r=0;r<_.length;++r)t[_[r]]=!0;return t}function _(e,t,s){return 0==e.length?r(t):function(i,l){for(var n=e[0],a=0;a<n.length;a++)if(i.match(n[a][0]))return l.tokenize=_(e.slice(1),t),n[a][1];return l.tokenize=r(t,s),"string"}}function r(e,t){return function(_,r){return s(_,r,e,t)}}function s(e,t,r,s){if(!1!==s&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(!1!==s&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=_([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,s)),e.match(/\-\>\w/,!1)&&(t.tokenize=_([[["->",null]],[[/[\w]+/,"variable"]]],r,s)),"variable-2";for(var i=!1;!e.eol()&&(i||!1===s||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}var i="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",l="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[i,l,n].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var a={name:"clike",helperType:"php",keywords:t(i),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(l),builtin:t(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var _;if(_=e.match(/<<\s*/)){var s=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(_[0].length+(s?2:1));if(s&&e.eat(s),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=r(i,"'"!=s),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,_){function r(t,_){var r=_.curMode==i;if(t.sol()&&_.pending&&'"'!=_.pending&&"'"!=_.pending&&(_.pending=null),r)return r&&null==_.php.tokenize&&t.match("?>")?(_.curMode=s,_.curState=_.html,_.php.context.prev||(_.php=null),"meta"):i.token(t,_.curState);if(t.match(/^<\?\w*/))return _.curMode=i,_.php||(_.php=e.startState(i,s.indent(_.html,""))),_.curState=_.php,"meta";if('"'==_.pending||"'"==_.pending){for(;!t.eol()&&t.next()!=_.pending;);var l="string"}else if(_.pending&&t.pos<_.pending.end){t.pos=_.pending.end;var l=_.pending.style}else var l=s.token(t,_.curState);_.pending&&(_.pending=null);var n,a=t.current(),o=a.search(/<\?/);return-1!=o&&("string"==l&&(n=a.match(/[\'\"]$/))&&!/\?>/.test(a)?_.pending=n[0]:_.pending={end:t.pos,style:l},t.backUp(a.length-o)),l}var s=e.getMode(t,"text/html"),i=e.getMode(t,a);return{startState:function(){var t=e.startState(s),r=_.startOpen?e.startState(i):null;return{html:t,php:r,curMode:_.startOpen?i:s,curState:_.startOpen?r:t,pending:null}},copyState:function(t){var _,r=t.html,l=e.copyState(s,r),n=t.php,a=n&&e.copyState(i,n);return _=t.curMode==s?l:a,{html:l,php:a,curMode:t.curMode,curState:_,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?s.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",a)});
30
- },{"../../lib/codemirror":6,"../clike/clike":7,"../htmlmixed/htmlmixed":10}],13:[function(require,module,exports){
28
+ },{"../../lib/codemirror":5,"../clike/clike":6,"../htmlmixed/htmlmixed":9}],12:[function(require,module,exports){
31
29
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(a,s){function l(e,t){if(e.sol()&&(t.indent=e.indentation()),e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?p(t):i<r&&d(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var o=c(e,t);return r>0&&d(e,t)&&(o+=" "+h),o}return c(e,t)}function c(e,t){if(e.eatSpace())return null;if("#"==e.peek())return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var n=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),e.match(/^[\d_]+\.\d*/)&&(n=!0),e.match(/^\.\d+/)&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}return e.match(E)?(t.tokenize=u(e.current()),t.tokenize(e,t)):e.match(v)||e.match(g)?"punctuation":e.match(y)||e.match(z)?"operator":e.match(b)?"punctuation":"."==t.lastToken&&e.match(F)?"property":e.match(T)||e.match(r)?"keyword":e.match(O)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(F)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),h)}function u(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=l,r;t.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return h;i.tokenize=l}return r}for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e){for(;"py"!=n(e).type;)e.scopes.pop();e.scopes.push({offset:n(e).offset+a.indentUnit,type:"py",align:null})}function f(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+x,type:n,align:r})}function d(e,t){for(var r=e.indentation();t.scopes.length>1&&n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){e.sol()&&(t.beginningOfLine=!0);var r=t.tokenize(e,t),i=e.current();if(t.beginningOfLine&&"@"==i)return e.match(F,!1)?"meta":w?"operator":h;/\S/.test(i)&&(t.beginningOfLine=!1),"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),"pass"!=i&&"return"!=i||(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(t);var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&f(e,t,"])}".slice(o,o+1)),-1!=(o="])}".indexOf(i))){if(n(t).type!=i)return h;t.indent=t.scopes.pop().offset-x}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var h="error",b=s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,y=s.doubleOperators||/^([!<>]==|<>|<<|>>|\/\/|\*\*)/,g=s.doubleDelimiters||/^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/,v=s.tripleDelimiters||/^(\/\/=|>>=|<<=|\*\*=)/,x=s.hangingIndent||a.indentUnit,k=i,_=o;void 0!=s.extra_keywords&&(k=k.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(_=_.concat(s.extra_builtins));var w=!(s.version&&Number(s.version)<3);if(w){var z=s.singleOperators||/^[\+\-\*\/%&|\^~<>!@]/,F=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;k=k.concat(["nonlocal","False","True","None","async","await"]),_=_.concat(["ascii","bytes","exec","print"]);var E=new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))","i")}else{var z=s.singleOperators||/^[\+\-\*\/%&|\^~<>!]/,F=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;k=k.concat(["exec","print"]),_=_.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);var E=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var T=t(k),O=t(_);return{startState:function(e){return{tokenize:l,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+h:r},indent:function(t,r){if(t.tokenize!=l)return t.tokenize.isString?e.Pass:0;var i=n(t),o=i.type==r.charAt(0);return null!=i.align?i.align-(o?1:0):i.offset-(o?x:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");e.defineMIME("text/x-cython",{name:"python",extra_keywords:function(e){return e.split(" ")}("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})});
32
- },{"../../lib/codemirror":6}],14:[function(require,module,exports){
30
+ },{"../../lib/codemirror":5}],13:[function(require,module,exports){
33
31
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(l),"comment";if(e.eatSpace())return null;var r,o=e.next();if("`"==o||"'"==o||'"'==o)return n(u(o,"string",'"'==o||"`"==o),e,t);if("/"==o)return i(e)?n(u(o,"string-2",!0),e,t):"operator";if("%"==o){var a="string",s=!0;e.eat("s")?a="atom":e.eat(/[WQ]/)?a="string":e.eat(/[r]/)?a="string-2":e.eat(/[wxq]/)&&(a="string",s=!1);var c=e.eat(/[^\w\s=]/);return c?(k.propertyIsEnumerable(c)&&(c=k[c]),n(u(c,a,s,!0),e,t)):"operator"}if("#"==o)return e.skipToEnd(),"comment";if("<"==o&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(f(r[1]),e,t);if("0"==o)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(o))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==o){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==o)return e.eat("'")?n(u("'","atom",!1),e,t):e.eat('"')?n(u('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==o&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==o)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(o))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=o||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(o))return d=o,null;if("-"==o&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(o)){var p=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=o||p||(d="."),"operator"}return null}return d="|",null}function i(e){for(var t,n=e.pos,r=0,i=!1,o=!1;null!=(t=e.next());)if(o)o=!1;else{if("[{(".indexOf(t)>-1)r++;else if("]})".indexOf(t)>-1){if(--r<0)break}else if("/"==t&&0==r){i=!0;break}o="\\"==t}return e.backUp(e.pos-n),i}function o(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=o(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=o(e+1));return r(t,n)}}function a(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function u(e,t,n,r){return function(i,u){var f,l=!1;for("read-quoted-paused"===u.context.type&&(u.context=u.context.prev,i.eat("}"));null!=(f=i.next());){if(f==e&&(r||!l)){u.tokenize.pop();break}if(n&&"#"==f&&!l){if(i.eat("{")){"}"==e&&(u.context={prev:u.context,type:"read-quoted-paused"}),u.tokenize.push(o());break}if(/[@\$]/.test(i.peek())){u.tokenize.push(a());break}}l=!l&&"\\"==f}return t}}function f(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var d,s=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),p=t(["end","until"]),k={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){d=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=d;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":s.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":p.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(d||r&&"comment"!=r)&&(t.lastTok=i),"|"==d&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(d)?t.context={prev:t.context,type:d||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(d))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==d||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==k[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")});
34
- },{"../../lib/codemirror":6}],15:[function(require,module,exports){
32
+ },{"../../lib/codemirror":5}],14:[function(require,module,exports){
35
33
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var s=e.sol(),u=e.next();if("\\"===u)return e.next(),null;if("'"===u||'"'===u||"`"===u)return t.tokens.unshift(n(u,"`"===u?"quote":"string")),r(e,t);if("#"===u)return s&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===u)return t.tokens.unshift(o),r(e,t);if("+"===u||"="===u)return"operator";if("-"===u)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(u)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var f=e.current();return"="===e.peek()&&/\w+/.test(f)?"def":i.hasOwnProperty(f)?i[f]:null}function n(e,t){var i="("==e?")":"{"==e?"}":e;return function(s,u){for(var f,l=!1,c=!1;null!=(f=s.next());){if(f===i&&!c){l=!0;break}if("$"===f&&!c&&"'"!==e){c=!0,s.backUp(1),u.tokens.unshift(o);break}if(!c&&f===e&&e!==i)return u.tokens.unshift(n(e,t)),r(s,u);c=!c&&"\\"===f}return!l&&c||u.tokens.shift(),t}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo svn tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next();return/['"({]/.test(i)?(t.tokens[0]=n(i,"("==i?"quote":"{"==i?"def":"string"),r(e,t)):(/\d/.test(i)||e.eatWhile(/\w/),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")});
36
- },{"../../lib/codemirror":6}],16:[function(require,module,exports){
34
+ },{"../../lib/codemirror":5}],15:[function(require,module,exports){
37
35
  !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("slim",function(e){function n(t,e,n){var i=function(i,r){return r.tokenize=e,i.pos<t?(i.pos=t,n):r.tokenize(i,r)};return function(t,n){return n.tokenize=i,e(t,n)}}function i(t,e,i,r,o){var u=t.current(),a=u.search(i);return a>-1&&(e.tokenize=n(t.pos,e.tokenize,o),t.backUp(u.length-a-r)),o}function r(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line},t.line=t.tokenize}function o(t){t.line==t.tokenize&&(t.line=t.stack.tokenize,t.stack=t.stack.parent)}function u(t,e){return function(n,i){if(o(i),n.match(/^\\$/))return r(i,t),"lineContinuation";var u=e(n,i);return n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&n.backUp(1),u}}function a(t,e){return function(n,i){o(i);var u=e(n,i);return n.eol()&&n.current().match(/,$/)&&r(i,t),u}}function c(t,e){return function(n,i){return n.peek()==t&&1==i.rubyState.tokenize.length?(n.next(),i.tokenize=e,"closeAttributeTag"):s(n,i)}}function l(e){var n,i=function(t,i){if(1==i.rubyState.tokenize.length&&!i.rubyState.context.prev){if(t.backUp(1),t.eatSpace())return i.rubyState=n,i.tokenize=e,e(t,i);t.next()}return s(t,i)};return function(e,r){return n=r.rubyState,r.rubyState=t.startState(Z),r.tokenize=i,s(e,r)}}function s(t,e){return Z.token(t,e.rubyState)}function k(t,e){return t.match(/^\\$/)?"lineContinuation":d(t,e)}function d(t,e){return t.match(/^#\{/)?(e.tokenize=c("}",e.tokenize),null):i(t,e,/[^\\]#\{/,1,P.token(t,e.htmlState))}function m(t){return function(e,n){var i=k(e,n);return e.eol()&&(n.tokenize=t),i}}function f(t,e,n){return e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line},e.line=e.tokenize=d,null}function b(t,e){return t.skipToEnd(),e.stack.style}function z(t,e){return e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line},e.line=b,b(t,e)}function p(t,e){return t.eat(e.stack.endQuote)?(e.line=e.stack.line,e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,null):t.match(K)?(e.tokenize=x,"slimAttribute"):(t.next(),null)}function x(t,e){return t.match(/^==?/)?(e.tokenize=h,null):p(t,e)}function h(t,e){var n=t.peek();return'"'==n||"'"==n?(e.tokenize=q(n,"string",!0,!1,p),t.next(),e.tokenize(t,e)):"["==n?l(p)(t,e):t.match(/^(true|false|nil)\b/)?(e.tokenize=p,"keyword"):l(p)(t,e)}function y(t,e,n){return t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e},t.line=t.tokenize=p,null}function S(e,n){if(e.match(/^#\{/))return n.tokenize=c("}",n.tokenize),null;var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented,i.start=e.start-n.stack.indented,i.lastColumnPos=e.lastColumnPos-n.stack.indented,i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);return e.pos=i.pos+n.stack.indented,r}function w(t,e){return e.stack.indented=t.column(),e.line=e.tokenize=S,e.tokenize(t,e)}function g(n){var i=D[n],r=t.mimeModes[i];if(r)return t.getMode(e,r);var o=t.modes[i];return o?o(e,{name:i}):t.getMode(e,"null")}function M(t){return _.hasOwnProperty(t)?_[t]:_[t]=g(t)}function v(e,n){var i=M(e),r=t.startState(i);return n.subMode=i,n.subState=r,n.stack={parent:n.stack,style:"sub",indented:n.indented+1,tokenize:n.line},n.line=n.tokenize=w,"slimSubmode"}function C(t,e){return t.skipToEnd(),"slimDoctype"}function E(t,e){if("<"==t.peek())return(e.tokenize=m(e.tokenize))(t,e);if(t.match(/^[|']/))return f(t,e,1);if(t.match(/^\/(!|\[\w+])?/))return z(t,e);if(t.match(/^(-|==?[<>]?)/))return e.tokenize=u(t.column(),a(t.column(),s)),"slimSwitch";if(t.match(/^doctype\b/))return e.tokenize=C,"keyword";var n=t.match(Q);return n?v(n[1],e):L(t,e)}function A(t,e){return e.startOfLine?E(t,e):L(t,e)}function L(t,e){return t.eat("*")?(e.tokenize=l($),null):t.match(H)?(e.tokenize=$,"slimTag"):T(t,e)}function $(t,e){return t.match(/^(<>?|><?)/)?(e.tokenize=T,null):T(t,e)}function T(t,e){return t.match(W)?(e.tokenize=T,"slimId"):t.match(N)?(e.tokenize=T,"slimClass"):U(t,e)}function U(t,e){return t.match(/^([\[\{\(])/)?y(e,B[RegExp.$1],U):t.match(J)?(e.tokenize=j,"slimAttribute"):"*"==t.peek()?(t.next(),e.tokenize=l(I),null):I(t,e)}function j(t,e){return t.match(/^==?/)?(e.tokenize=O,null):U(t,e)}function O(t,e){var n=t.peek();return'"'==n||"'"==n?(e.tokenize=q(n,"string",!0,!1,U),t.next(),e.tokenize(t,e)):"["==n?l(U)(t,e):":"==n?l(R)(t,e):t.match(/^(true|false|nil)\b/)?(e.tokenize=U,"keyword"):l(U)(t,e)}function R(t,e){return t.backUp(1),t.match(/^[^\s],(?=:)/)?(e.tokenize=l(R),null):(t.next(),U(t,e))}function q(t,e,n,i,u){return function(a,l){o(l);var s=0==a.current().length;if(a.match(/^\\$/,s))return s?(r(l,l.indented),"lineContinuation"):e;if(a.match(/^#\{/,s))return s?(l.tokenize=c("}",l.tokenize),null):e;for(var k,d=!1;null!=(k=a.next());){if(k==t&&(i||!d)){l.tokenize=u;break}if(n&&"#"==k&&!d&&a.eat("{")){a.backUp(2);break}d=!d&&"\\"==k}return a.eol()&&d&&a.backUp(1),e}}function I(t,e){return t.match(/^==?/)?(e.tokenize=s,"slimSwitch"):t.match(/^\/$/)?(e.tokenize=A,null):t.match(/^:/)?(e.tokenize=L,"slimSwitch"):(f(t,e,0),e.tokenize(t,e))}var P=t.getMode(e,{name:"htmlmixed"}),Z=t.getMode(e,"ruby"),_={html:P,ruby:Z},D={ruby:"ruby",javascript:"javascript",css:"text/css",sass:"text/x-sass",scss:"text/x-scss",less:"text/x-less",styl:"text/x-styl",coffee:"coffeescript",asciidoc:"text/x-asciidoc",markdown:"text/x-markdown",textile:"text/x-textile",creole:"text/x-creole",wiki:"text/x-wiki",mediawiki:"text/x-mediawiki",rdoc:"text/x-rdoc",builder:"text/x-builder",nokogiri:"text/x-nokogiri",erb:"application/x-erb"},Q=function(t){var e=[];for(var n in t)e.push(n);return new RegExp("^("+e.join("|")+"):")}(D),V={commentLine:"comment",slimSwitch:"operator special",slimTag:"tag",slimId:"attribute def",slimClass:"attribute qualifier",slimAttribute:"attribute",slimSubmode:"keyword special",closeAttributeTag:null,slimDoctype:null,lineContinuation:null},B={"{":"}","[":"]","(":")"},F="_a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",G=F+"\\-0-9·̀-ͯ‿-⁀",H=new RegExp("^[:"+F+"](?::["+G+"]|["+G+"]*)"),J=new RegExp("^[:"+F+"][:\\."+G+"]*(?=\\s*=)"),K=new RegExp("^[:"+F+"][:\\."+G+"]*"),N=/^\.-?[_a-zA-Z]+[\w\-]*/,W=/^#[_a-zA-Z]+[\w\-]*/,X={startState:function(){return{htmlState:t.startState(P),rubyState:t.startState(Z),stack:null,last:null,tokenize:A,line:A,indented:0}},copyState:function(e){return{htmlState:t.copyState(P,e.htmlState),rubyState:t.copyState(Z,e.rubyState),subMode:e.subMode,subState:e.subMode&&t.copyState(e.subMode,e.subState),stack:e.stack,last:e.last,tokenize:e.tokenize,line:e.line}},token:function(t,e){if(t.sol())for(e.indented=t.indentation(),e.startOfLine=!0,e.tokenize=e.line;e.stack&&e.stack.indented>e.indented&&"slimSubmode"!=e.last;)e.line=e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,e.subMode=null,e.subState=null;if(t.eatSpace())return null;var n=e.tokenize(t,e);return e.startOfLine=!1,n&&(e.last=n),V.hasOwnProperty(n)?V[n]:n},blankLine:function(t){if(t.subMode&&t.subMode.blankLine)return t.subMode.blankLine(t.subState)},innerMode:function(t){return t.subMode?{state:t.subState,mode:t.subMode}:{state:t,mode:X}}};return X},"htmlmixed","ruby"),t.defineMIME("text/x-slim","slim"),t.defineMIME("application/x-slim","slim")});
38
- },{"../../lib/codemirror":6,"../htmlmixed/htmlmixed":10,"../ruby/ruby":14}],17:[function(require,module,exports){
36
+ },{"../../lib/codemirror":5,"../htmlmixed/htmlmixed":9,"../ruby/ruby":13}],16:[function(require,module,exports){
39
37
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,r){function a(e,t){var r=e.next();if(g[r]){var a=g[r](e,t);if(!1!==a)return a}if(p.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(p.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),p.decimallessFloat&&e.eat("."),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&p.doubleQuote)return t.tokenize=n(r),t.tokenize(e,t);if((p.nCharCast&&("n"==r||"N"==r)||p.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(r))return null;if(p.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=i(1),t.tokenize(e,t);if("."!=r){if(d.test(r))return e.eatWhile(d),null;if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var o=e.current().toLowerCase();return b.hasOwnProperty(o)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(o)?"atom":u.hasOwnProperty(o)?"builtin":m.hasOwnProperty(o)?"keyword":l.hasOwnProperty(o)?"string-2":null}return p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function n(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){r.tokenize=a;break}i=!i&&"\\"==n}return"string"}}function i(e){return function(t,r){var n=t.match(/^.*?(\/\*|\*\/)/);return n?"/*"==n[1]?r.tokenize=i(e+1):r.tokenize=e>1?i(e-1):a:t.skipToEnd(),"comment"}}function o(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=r.client||{},c=r.atoms||{false:!0,true:!0,null:!0},u=r.builtin||{},m=r.keywords||{},d=r.operatorChars||/^[*+\-%<>!=&|~^]/,p=r.support||{},g=r.hooks||{},b=r.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:a,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==a&&e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var n=e.current();return"("==n?o(e,t,")"):"["==n?o(e,t,"]"):t.context&&t.context.type==n&&s(t),r},indent:function(r,a){var n=r.context;if(!n)return e.Pass;var i=a.charAt(0)==n.type;return n.align?n.col+(i?0:1):n.indent+(i?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){for(var t;null!=(t=e.next());)if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function a(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function n(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},r=e.split(" "),a=0;a<r.length;++a)t[r[a]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":a}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":a,"`":t,"\\":n}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":a,"`":t,"\\":n}}),e.defineMIME("text/x-sqlite",{name:"sql",client:i("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:i(o+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:i("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|\/~]/,dateSQL:i("date time timestamp datetime"),support:i("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":a,":":a,"?":a,$:a,'"':r,"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:i("source"),keywords:i(o+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"),builtin:i("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:i("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:i("false true"),builtin:i("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/})}()});
40
- },{"../../lib/codemirror":6}],18:[function(require,module,exports){
38
+ },{"../../lib/codemirror":5}],17:[function(require,module,exports){
41
39
  !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};t.defineMode("xml",function(r,o){function a(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(u("atom","]]>")):null:t.match("--")?n(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(d(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=u("meta","?>"),"meta"):(C=t.eat("/")?"closeTag":"openTag",e.tokenize=i,"tag bracket");if("&"==r){var o;return o=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),o?"atom":"error"}return t.eatWhile(/[^&<]/),null}function i(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=a,C=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return C="equals",null;if("<"==n){e.tokenize=a,e.state=m,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=l(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=i;break}return"string"};return e.isInAttribute=!0,e}function u(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=a;break}n.next()}return t}}function d(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=d(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=a;break}return n.tokenize=d(t-1),n.tokenize(e,n)}}return"meta"}}function c(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(z.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function f(t){t.context&&(t.context=t.context.prev)}function s(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!z.contextGrabbers.hasOwnProperty(n)||!z.contextGrabbers[n].hasOwnProperty(e))return;f(t)}}function m(t,e,n){return"openTag"==t?(n.tagStart=e.column(),g):"closeTag"==t?p:m}function g(t,e,n){return"word"==t?(n.tagName=e.current(),I="tag",b):(I="error",g)}function p(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&z.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||!1===z.matchClosing?(I="tag",h):(I="tag error",x)}return I="error",x}function h(t,e,n){return"endTag"!=t?(I="error",h):(f(n),m)}function x(t,e,n){return I="error",h(t,e,n)}function b(t,e,n){if("word"==t)return I="attribute",k;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||z.autoSelfClosers.hasOwnProperty(r)?s(n,r):(s(n,r),n.context=new c(n,r,o==n.indented)),m}return I="error",b}function k(t,e,n){return"equals"==t?v:(z.allowMissing||(I="error"),b(t,e,n))}function v(t,e,n){return"string"==t?w:"word"==t&&z.allowUnquoted?(I="string",b):(I="error",b(t,e,n))}function w(t,e,n){return"string"==t?w:b(t,e,n)}var y=r.indentUnit,z={},N=o.htmlMode?e:n;for(var T in N)z[T]=N[T];for(var T in o)z[T]=o[T];var C,I;return a.isInText=!0,{startState:function(t){var e={tokenize:a,state:m,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;C=null;var n=e.tokenize(t,e);return(n||C)&&"comment"!=n&&(I=null,e.state=e.state(C||n,t,e),I&&(n="error"==I?n+" error":I)),n},indent:function(e,n,r){var o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+y;if(o&&o.noIndent)return t.Pass;if(e.tokenize!=i&&e.tokenize!=a)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==z.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+y*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;o;){if(o.tagName==l[2]){o=o.prev;break}if(!z.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(l)for(;o;){var u=z.contextGrabbers[o.tagName];if(!u||!u.hasOwnProperty(l[2]))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+y:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(t){t.state==v&&(t.state=b)}}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})});
42
- },{"../../lib/codemirror":6}],19:[function(require,module,exports){
40
+ },{"../../lib/codemirror":5}],18:[function(require,module,exports){
43
41
  !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],i=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,t){var r=e.peek(),n=t.escaped;if(t.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(t.literal&&e.indentation()>t.keyCol)return e.skipToEnd(),"string";if(t.literal&&(t.literal=!1),e.sol()){if(t.keyCol=0,t.pair=!1,t.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?t.inlinePairs++:"}"==r?t.inlinePairs--:"["==r?t.inlineList++:t.inlineList--,"meta";if(t.inlineList>0&&!n&&","==r)return e.next(),"meta";if(t.inlinePairs>0&&!n&&","==r)return t.keyCol=0,t.pair=!1,t.pairStart=!1,e.next(),"meta";if(t.pairStart){if(e.match(/^\s*(\||\>)\s*/))return t.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(t.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(i))return"keyword"}return!t.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(t.pair=!0,t.keyCol=e.indentation(),"atom"):t.pair&&e.match(/^:\s*/)?(t.pairStart=!0,"meta"):(t.pairStart=!1,t.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml"),e.defineMIME("text/yaml","yaml")});
44
- },{"../../lib/codemirror":6}],20:[function(require,module,exports){
45
- function Emitter(t){if(t)return mixin(t)}function mixin(t){for(var e in Emitter.prototype)t[e]=Emitter.prototype[e];return t}"undefined"!=typeof module&&(module.exports=Emitter),Emitter.prototype.on=Emitter.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Emitter.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r,s=0;s<i.length;s++)if((r=i[s])===e||r.fn===e){i.splice(s,1);break}return this},Emitter.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),i=this._callbacks["$"+t];if(i){i=i.slice(0);for(var r=0,s=i.length;r<s;++r)i[r].apply(this,e)}return this},Emitter.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Emitter.prototype.hasListeners=function(t){return!!this.listeners(t).length};
46
- },{}],21:[function(require,module,exports){
42
+ },{"../../lib/codemirror":5}],19:[function(require,module,exports){
47
43
  var CodeMirror=require("codemirror");require("codemirror/addon/runmode/runmode.js");var Highlighter={aliases:{bash:"text/x-sh",c:"text/x-csrc",html:"text/html",js:"text/javascript",json:"application/json",java:"text/x-java",markup:"text/html",sass:"text/x-sass",scss:"text/x-scss",sh:"text/x-sh"},addAlias:function(a){for(var s in a)self.aliases[s]=a[s]},aliasLang:function(a){return self.aliases[a]||a},process:function(a,s,t){var e={json:!1};"json"==s&&(e.json=!0),CodeMirror.runMode(a,self.aliasLang(s),t,e)},highlightEl:function(a){var s=a.dataset.lang||a.dataset.language;if(!s){if(classMatch=a.className.match(/lang.*?-(\S+)/),!classMatch)return;s=classMatch[1]}a.classList.contains("language-"+s)&&a.classList.remove("language-"+s),a.classList.add("lang-"+s),a.classList.add("highlighted");var t=a.textContent.trim();self.process(t,s,a),a.innerHTML="<code class='highlighted-code static-code cm-s-default'>"+a.innerHTML+"</code>"},highlight:function(a){a=a||'[class*="language-"], [class*="lang-"], [data-lang], [data-language]';var s=document.querySelectorAll(a);Array.prototype.forEach.call(s,function(a){self.highlightEl(a)})}};module.exports=self=Highlighter;
48
- },{"codemirror":6,"codemirror/addon/runmode/runmode.js":5}],22:[function(require,module,exports){
44
+ },{"codemirror":5,"codemirror/addon/runmode/runmode.js":4}],20:[function(require,module,exports){
49
45
  function on(){setEvent("on",slice.call(arguments))}function off(){setEvent("off",slice.call(arguments))}function one(){setEvent("one",slice.call(arguments))}function fire(){args=slice.call(arguments);var e=(args[0],[]);args[1].split(" ").forEach(function(n){var n=animationEvent.transform(n);isEmpty(n)||e.push(n)}),isEmpty(e)||(args[1]=e.join(" "),bean.fire.apply(this,args))}function setEvent(e,n){transformArgs(n).forEach(function(n){bean[e].apply(null,n)})}function keyOne(e,n,r){"function"==typeof n&&(r=n,n="all"),key(e,n,function(t){key.unbind(e,n),r(t)})}function afterAnimation(e,n){!window.getComputedStyle(e).getPropertyValue("animation-duration")?n():one(e,"animationend",n)}function transformArgs(e){var n=[],r={},t=e.shift(),a=e.shift();if("function"!=typeof e[0])var i=e.shift();if("string"==typeof a){var o={};o[a]=e.shift(),a=o}for(event in a)if(a.hasOwnProperty(event)){var l=a[event];event.split(" ").forEach(function(e){e=animationEvent.transform(e),isEmpty(e)?l():e.match(/tap/)?r.touchstart=tap(l):r[e]=l})}for(event in r){var c=[];c.push(t,event),i&&c.push(i),c.push(r[event]),n.push(c.concat(e))}return n}function isEmpty(e){var n=Object.prototype.hasOwnProperty;if(null==e||0===e.length)return!0;if(0<e.length)return!1;for(var r in e)if(n.call(e,r))return!1;return!0}require("./lib/shims/custom-event");var bean=require("bean"),key=require("keymaster"),animationEvent=require("./lib/animation-events"),page=require("./lib/page"),tap=require("./lib/tap-events"),debounce=require("./lib/debounce"),throttle=require("./lib/throttle"),delay=require("./lib/delay"),repeat=require("./lib/repeat"),bubbleFormEvents=require("./lib/bubble-form-events"),scroll=require("./lib/scroll"),resize=require("./lib/resize"),callbackManager=require("./lib/callback-manager"),media=require("./lib/media"),slice=Array.prototype.slice,formBubbling=!1;module.exports={on:on,off:off,one:one,fire:fire,clone:bean.clone,ready:page.ready,change:page.change,afterAnimation:afterAnimation,media:media,key:key,keyOn:key,keyOff:key.unbind,keyOne:keyOne,debounce:debounce,throttle:throttle,delay:delay,repeat:repeat,scroll:scroll,resize:resize,callbackManager:callbackManager,callback:callbackManager.callback,bubbleFormEvents:bubbleFormEvents};
50
- },{"./lib/animation-events":23,"./lib/bubble-form-events":24,"./lib/callback-manager":25,"./lib/debounce":26,"./lib/delay":27,"./lib/media":28,"./lib/page":30,"./lib/repeat":31,"./lib/resize":32,"./lib/scroll":33,"./lib/shims/custom-event":34,"./lib/tap-events":35,"./lib/throttle":36,"bean":3,"keymaster":50}],23:[function(require,module,exports){
46
+ },{"./lib/animation-events":21,"./lib/bubble-form-events":22,"./lib/callback-manager":23,"./lib/debounce":24,"./lib/delay":25,"./lib/media":26,"./lib/page":28,"./lib/repeat":29,"./lib/resize":30,"./lib/scroll":31,"./lib/shims/custom-event":32,"./lib/tap-events":33,"./lib/throttle":34,"bean":2,"keymaster":41}],21:[function(require,module,exports){
51
47
  function camelCaseEventTypes(n){return n=n||"",{animationstart:n+"AnimationStart",animationend:n+"AnimationEnd",animationiteration:n+"AnimationIteration"}}function lowerCaseEventTypes(n){return n=n||"",{animationstart:n+"animationstart",animationend:n+"animationend",animationiteration:n+"animationiteration"}}function getAnimationEventTypes(){var n=["webkit","Moz","O",""],t=document.documentElement.style;if(void 0!==t.animationName)return lowerCaseEventTypes();for(var e,i=0,a=n.length;i<a;i++)if(e=n[i],void 0!==t[e+"AnimationName"]){if(0===i)return camelCaseEventTypes(e.toLowerCase());if(1===i)return lowerCaseEventTypes();if(2===i)return lowerCaseEventTypes(e.toLowerCase())}return{}}function transformAnimationEvents(n){return n.match(/animation/i)?cssAnimEventTypes[n]?cssAnimEventTypes[n]:("test"!=window.env&&console.error('"'+n+'" is not a supported animation event'),""):n}var cssAnimEventTypes=getAnimationEventTypes(),supported=void 0!==cssAnimEventTypes.animationstart;module.exports={transform:transformAnimationEvents};
52
- },{}],24:[function(require,module,exports){
48
+ },{}],22:[function(require,module,exports){
53
49
  var Event=require("bean"),page=require("./page"),formEls,formBubbling=!1,fireBubble=function(e){if(e.detail&&e.detail.triggered)return!1;var t=new CustomEvent(e.type,{bubbles:!0,cancelable:!0,detail:{triggered:!0}});e.stopPropagation(),e.target.dispatchEvent(t),t.defaultPrevented&&e.preventDefault()},eventType=function(e){return"FORM"==e.tagName?"submit":"focus blur"},bubbleOn=function(e){Event.on(e,eventType(e),fireBubble)},bubbleOff=function(e){Event.off(e,eventType(e),fireBubble)},bubbleFormEvents=function(){if(!e){page.change(function(){formEls&&Array.prototype.forEach.call(formEls,bubbleOff),formEls=document.querySelectorAll("form, input"),Array.prototype.forEach.call(formEls,bubbleOn)});var e=!0}};module.exports=bubbleFormEvents;
54
- },{"./page":30,"bean":3}],25:[function(require,module,exports){
50
+ },{"./page":28,"bean":2}],23:[function(require,module,exports){
55
51
  var Manager={new:function(){var n={callbacks:[],add:function(a){var c=Manager.callback.new(a);return n.callbacks.push(c),c},stop:function(){n.callbacks.forEach(function(n){n.stop()})},start:function(){n.callbacks.forEach(function(n){n.start()})},toggle:function(a){n.callbacks.forEach(function(n){n.toggle(a)})},remove:function(){n.callbacks=[]},fire:function(){var a=Array.prototype.slice.call(arguments);n.callbacks.forEach(function(n){n.apply(this,a)})}};return n},callback:{new:function(n){var a=function(){a.enabled&&n.apply(n,arguments)};return a.stop=function(){a.enabled=!1},a.start=function(){a.enabled=!0},a.toggle=function(n){a.enabled=0 in arguments?n:!a.enabled},a.enabled=!0,a}}};module.exports=Manager;
56
- },{}],26:[function(require,module,exports){
52
+ },{}],24:[function(require,module,exports){
57
53
  var now=function(){return Date.now()},pickFunction=function(){var n;return Array.prototype.forEach.call(arguments,function(i){"function"!=typeof i||n||(n=i)}),n},debounce=function(n,i,t){t="object"==typeof n?n:t||{},i=t.wait||i||0;var a,o=t.max||!1,e="leading"in t&&t.leading,c=!("trailing"in t)||t.trailing,r=pickFunction(t.leading,t.trailing,t.callback,n),u=pickFunction(t.trailing,t.leading,t.callback,n),l=!1,f={},g=0,p=0,d=!1,w=function(n){g=now(),p=now(),l=!1,d=!0,"leading"===n?r.apply(r,a):u.apply(u,a)},m=function(){l||(l=!0,f.value=requestAnimationFrame(k))},v=function(){"value"in f&&(cancelAnimationFrame(f.value),l=!1,g=0,p=0,d=!1)},y=function(){return o&&now()-p>=o},b=function(){return now()-g>=i},k=function(){l=!1,e&&!d?w("leading"):y()?w(e?"leading":"trailing"):b()?(c&&w("trailing"),e&&(d=!1)):m()},F=function(){g=now(),a=arguments,m()};return F.stop=v,F};module.exports=debounce;
58
- },{}],27:[function(require,module,exports){
54
+ },{}],25:[function(require,module,exports){
59
55
  var now=function(){return Date.now()},delay=function(e,a){var t=null!=a?2:1,n={};return n.args=Array.prototype.slice.call(arguments,t),n.wait=a||0,n.start=now(),n.stop=function(){"value"in n&&cancelAnimationFrame(n.value)},n.loop=function(){now()-n.start>=n.wait?(e.apply(e,n.args),n.repeat?(n.repeat=n.repeat-1,n.start=now(),queueDelay(n)):0===n.repeat&&n.complete&&n.complete()):queueDelay(n)},queueDelay(n)},queueDelay=function(e){return e.value=requestAnimationFrame(e.loop),e};module.exports=delay;
60
- },{}],28:[function(require,module,exports){
56
+ },{}],26:[function(require,module,exports){
61
57
  function parseQuery(i,n){var e={};return"string"==typeof i?i:(e.min=size(i.min,"min-"+n),e.max=size(i.max,"max-"+n),e.min&&e.max&&(e.query=e.min+" and "+e.max),e.query||e.min||e.max)}function size(i,n){return i?"("+n+": "+toPx(i)+")":null}function toPx(i){return"number"==typeof i?i+"px":i}var media={width:function(i,n){return media.listen(parseQuery(i,"width"),n)},minWidth:function(i,n){return media.width({min:i},n)},maxWidth:function(i,n){return media.width({max:i},n)},height:function(i,n){return media.listen(parseQuery(i,"height"),n)},minHeight:function(i,n){return media.height({min:i},n)},maxHeight:function(i,n){return media.height({max:i},n)},listen:function(i,n){var e=window.matchMedia(i);return n&&(n(e),e.addListener(n)),e}};module.exports=media;
62
- },{}],29:[function(require,module,exports){
58
+ },{}],27:[function(require,module,exports){
63
59
  var Event=require("bean"),callbackManager=require("./callback-manager"),throttle=require("./throttle"),debounce=require("./debounce"),optimizedEventManager={new:function(e){var n={run:callbackManager.new(),start:callbackManager.new(),stop:callbackManager.new()},t=throttle(n.run.fire),r=debounce({leading:n.start.fire,trailing:!1,wait:150}),a=debounce(n.stop.fire,150);Event.on(window,e,function(){t(),r(),a()});var i=function(e){return n.run.add(e)};return i.start=function(e){return n.start.add(e)},i.stop=function(e){return n.stop.add(e)},i(function(){Event.fire(window,"optimized"+e[0].toUpperCase()+e.substring(1))}),i.start(function(){Event.fire(window,e+"Start")}),i.stop(function(){Event.fire(window,e+"Stop")}),i}};module.exports=optimizedEventManager;
64
- },{"./callback-manager":25,"./debounce":26,"./throttle":36,"bean":3}],30:[function(require,module,exports){
60
+ },{"./callback-manager":23,"./debounce":24,"./throttle":34,"bean":2}],28:[function(require,module,exports){
65
61
  var Event=require("bean"),callbackManager=require("./callback-manager"),manager={ready:callbackManager.new(),change:callbackManager.new(),readyAlready:!1,changed:!1};manager.ready.add(function(){manager.readyAlready=!0}),manager.ready.add(function(){window.Turbolinks||manager.changed||(manager.changed=!0,manager.change.fire())});var ready=function(a){return manager.readyAlready&&a(),manager.ready.add(a)},change=function(a){return manager.changed&&a(),manager.change.add(a)};ready.fire=function(){manager.ready.fire(),manager.ready.stop()},change.fire=function(){manager.change.fire()},Event.on(document,"DOMContentLoaded",ready.fire),Event.on(document,"page:change",change.fire),module.exports={ready:ready,change:change};
66
- },{"./callback-manager":25,"bean":3}],31:[function(require,module,exports){
62
+ },{"./callback-manager":23,"bean":2}],29:[function(require,module,exports){
67
63
  var delay=require("./delay"),repeat=function(e,r,a){var l=1,t=delay(e,r);return null!=a?l=3:null!=r&&(l=2),t.repeat=a||-1,t.args=Array.prototype.slice.call(arguments,l),t.stop=t.cancel,t};module.exports=repeat;
68
- },{"./delay":27}],32:[function(require,module,exports){
64
+ },{"./delay":25}],30:[function(require,module,exports){
69
65
  var manager=require("./optimized-event-manager"),resize=manager.new("resize");resize.disableAnimation=function(){document.querySelector("style#fullstop")||document.head.insertAdjacentHTML("beforeend",'<style id="fullstop">.no-animation *, .no-animation *:after, .no-animation *:before { transition: none !important; animation: none !important }</style>'),resize.start(function(){document.body.classList.add("no-animation")}),resize.stop(function(){document.body.classList.remove("no-animation")})},module.exports=resize;
70
- },{"./optimized-event-manager":29}],33:[function(require,module,exports){
66
+ },{"./optimized-event-manager":27}],31:[function(require,module,exports){
71
67
  var manager=require("./optimized-event-manager"),scroll=manager.new("scroll");scroll.disablePointer=function(){scroll.start(function(){document.documentElement.style.pointerEvents="none"}),scroll.stop(function(){document.documentElement.style.pointerEvents=""})},module.exports=scroll;
72
- },{"./optimized-event-manager":29}],34:[function(require,module,exports){
68
+ },{"./optimized-event-manager":27}],32:[function(require,module,exports){
73
69
  !function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}if("function"==typeof window.CustomEvent)return!1;t.prototype=window.Event.prototype,window.CustomEvent=t}();
74
- },{}],35:[function(require,module,exports){
70
+ },{}],33:[function(require,module,exports){
75
71
  function Tap(e,t){function n(t){function n(n){if(t!==n&&(a(),!n.defaultPrevented)){var o=t.preventDefault,r=t.stopPropagation;t.stopPropagation=function(){r.call(t),r.call(n)},t.preventDefault=function(){o.call(t),o.call(n)},e.apply(u,i)}}function a(e){t!==e&&(clearTimeout(c),r.removeEventListener("touchmove",a),endEvents.forEach(function(e){r.removeEventListener(e,n)}))}if(t.touches&&!(t.touches.length>1)){var r=t.target,u=this,i=arguments,c=setTimeout(a,o);r.addEventListener("touchmove",a),endEvents.forEach(function(e){r.addEventListener(e,n)})}}t=t||{};var o=t.timeout||Tap.timeout;return n.handler=e,n}var endEvents=["touchend"];module.exports=Tap,Tap.timeout=200;
76
- },{}],36:[function(require,module,exports){
72
+ },{}],34:[function(require,module,exports){
77
73
  var debounce=require("./debounce"),throttle=function(e,t,a){return"object"==typeof e?(a=e,e=void 0):a=a||{},a.wait=a.wait||t||0,a.max=a.max||a.wait,a.callback=a.callback||e,a.leading=!0,a.trailing=!0,debounce(a)};module.exports=throttle;
78
- },{"./debounce":26}],37:[function(require,module,exports){
79
- var validation=require("./lib/validation"),progressive=require("./lib/progressive");module.exports={validate:validation.validate,invalidateField:validation.invalidateField,next:progressive.next};
80
- },{"./lib/progressive":38,"./lib/validation":39}],38:[function(require,module,exports){
81
- function reset(){formCallbacks={next:[]},registeredForms=[]}function newForm(e){function t(){return m[p]}function o(){return m[p+1]}function n(){return t()&&!t().disabled}function r(){a(p+1)}function a(e){e=Number(e);var o=m[e];if(o&&o!=t()){var r=p<e?"forward":"reverse";if(n())return s(function(){a(e)},r);p=e,c(r)}}function s(e,o){o=o||"forward",t().classList.remove("active","enter"),t().classList.add("exit"),t().dataset.direction=o,Event.afterAnimation(t(),function(){l(),"function"==typeof e&&e()})}function i(e,o){n()||(o=o||"reverse",t().classList.remove("exit","completed"),t().classList.add("active","enter"),t().dataset.direction=o,u(),Event.afterAnimation(t(),function(){"function"==typeof e&&e()}))}function c(e){u(),t().classList.remove("completed"),t().dataset.direction=e,t().classList.add("active","enter");var o=t().querySelector("input:not([hidden]), textarea, select");o&&o.focus(),f()}function l(){t().disabled=!0,t().classList.add("completed"),t().classList.remove("enter","exit")}function f(){toolbox.each(e.querySelectorAll("nav [data-step]"),function(e){e.dataset.step<p+1&&(e.classList.remove("here","next"),e.classList.add("previous","completed")),e.dataset.step==p+1&&(e.classList.remove("previous","next"),e.classList.add("here")),e.dataset.step>p+1&&(e.classList.remove("previous","here"),e.classList.add("next"))})}function d(e){toolbox.each(e.querySelectorAll("fieldset.form-step[disabled]"),function(e){e.disabled=!1})}function u(){m.forEach(function(e){e.disabled=e!=t()})}if(e){var m=toolbox.slice(e.querySelectorAll(".form-step")),p=0;if(0!=m.length){if(m.forEach(function(e,o){e.disabled=e!=t(),e.dataset.step=o}),e.dataset.nav){var v='<nav class="progressive-form-nav">';m.forEach(function(e,t){v+='<a href="#" class="progressive-form-nav-item" data-step="'+(t+1)+'">',v+=e.dataset.nav||"Step "+(t+1),v+="</a> "}),v+="</nav>",e.insertAdjacentHTML("afterbegin",v)}c(),registeredForms.push(function(n,c){var l=n.currentTarget;if("show-step"===c)n.preventDefault(),toolbox.matches(l,".previous, .completed, .completed + a")&&a(l.dataset.step-1);else if("next"===c){var f="FORM"==l.tagName?l:toolbox.getClosest(l,"form");if(e==f&&!t().querySelector(":invalid")){var m=getCallbacks(e);o()?u():d(e),m?(n.preventDefault(),m(n,{fieldset:t(),form:e,forward:r,dismiss:s,revisit:i,showStep:a,complete:!o(),formData:toolbox.formData(t())})):o()&&(n.preventDefault(),r())}}})}}}function fire(e,t){registeredForms.forEach(function(o){o(e,t)})}function getCallbacks(e,t){t=t||"next";var o,n=[];return formCallbacks[t].forEach(function(t){(o=t(e))&&n.push(o)}),!!n.length&&function(){var e=toolbox.slice(arguments);n.forEach(function(t){t.apply(t,e)})}}function next(e,t){on(e,"next",t)}function on(e,t,o){if("object"==typeof t)for(type in t)on(e,type,t[type]);else if(formCallbacks[t]){var n=function(t){if(t==e)return o};formCallbacks[t].push(n)}}var toolbox=require("compose-toolbox"),Event=toolbox.event,Callback=toolbox.event.callback,formSelector="form.progressive",watching=!1,formCallbacks,registeredForms;Event.ready(function(){reset(),Event.bubbleFormEvents();var e=formSelector+" [type=submit], "+formSelector+" .next-step",t=formSelector+" .back-step";Event.on(document,"click",e,fire,"next"),Event.on(document,"click",t,fire,"back"),Event.on(document,"click",".progressive-form-nav-item[data-step]",fire,"show-step"),document.head.insertAdjacentHTML("beforeend","<style>.form-step[disabled], .form-step.completed { position: absolute !important; top: -9999px !important; left: -9999px !important; left: 0 !important; right: 0 !important; }</style>"),Event.change(function(){reset(),toolbox.each(document.querySelectorAll(formSelector),function(e){newForm(e)})})}),module.exports={next:next,new:newForm};
82
- },{"compose-toolbox":44}],39:[function(require,module,exports){
83
- function supported(){return"function"==typeof document.createElement("input").checkValidity}function validateForm(e){var t,a=e.querySelectorAll("[required]");return toolbox.slice(a).some(function(e){if(!getClosest(e,"[disabled]")&&!checkInput(e))return t=e,!0}),!t||(focus(t),showMessage(t),!1)}function checkInput(e,t){var a=statusEl(e),n=isValid(e);return"keydown"!=t||n||e!=document.activeElement?(a.classList.toggle("invalid",!n),a.classList.toggle("valid",n)):a.classList.remove("invalid","valid"),n}function isValid(e){e.value.replace(/\s/g,"").length||(e.value="");var t=checkValue(e)||checkLength(e)||"";return e.setCustomValidity(t),e.checkValidity()}function checkValue(e){if(e.dataset.invalidValue){var t=escapedRegex(e.dataset.invalidValue,"i");if(e.value.match(t))return e.dataset.cachedMessage=e.dataset.message,e.dataset.message="",e.dataset.invalidValueMessage||"Value '"+e.value+"' is not permitted";e.dataset.cachedMessage&&(e.dataset.message=e.dataset.cachedMessage,e.dataset.cachedMessage="")}}function escapedRegex(e,t){var a=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp("^"+a+"$",t)}function checkLength(e){return checkCount(e,"min")||checkCount(e,"max")}function checkCount(e,t){var a=e.dataset[t+"Words"];if(a){var n=wordCount(e.value)<a;if(phrasing="min"==t?"at least ":"no more than ",valid="min"==t?!n:n,e.value&&!valid)return"Please write "+phrasing+a+" words."}}function statusEl(e){return getClosest(e,"label")||e}function focus(e){e="none"!==e.style.display?e:e.nextSibling,e.focus()}function submit(e){validateForm("FORM"==e.target.tagName?e.target:getClosest(e.target,"form"))||(checkValidation.stop(),Event.delay(checkValidation.start,500),e.preventDefault(),e.stopImmediatePropagation())}function invalidateField(e,t){e&&e.value&&(e.dataset.invalidValue=e.value,t&&(e.dataset.invalidValueMessage=t))}function hideMessage(e){var t=getClosest(e,"form"),a=t.querySelector(".validation-message");a&&a.parentNode.removeChild(a)}function showMessage(e){hideMessage(e);var t=getClosest(e,"label"),a=e.dataset.message||e.validationMessage;t&&t.insertAdjacentHTML("beforeend",'<aside class="validation-message"><p>'+a+"</p></aside>")}var toolbox=require("compose-toolbox"),Event=toolbox.event,getClosest=toolbox.getClosest,wordCount=toolbox.wordCount,textSelectors="[required]",invalidHandler=Event.callback.new(function(e){e.preventDefault(),e.stopPropagation()});Event.ready(function(){supported()&&(Event.bubbleFormEvents(),document.addEventListener("invalid",invalidHandler,!0),Event.on(document.body,"click","[type=submit]",submit),Event.on(document,"validate","form",function(e){validateForm(e.target)}),Event.on(document,"blur","[required]",checkValidation),Event.on(document,"keydown","[required]",Event.debounce(checkValidation,200)),Event.on(document,"input","select[required]",Event.debounce(checkValidation,200)))});var checkValidation=Event.callback.new(function(e){checkInput(e.target,e.type)&&hideMessage(e.target)});module.exports={validate:validateForm,invalidateField:invalidateField};
84
- },{"compose-toolbox":44}],40:[function(require,module,exports){
85
- var classify=function(e){return"."+e.replace(/\s/g,".")},merge=function(){var e=[{}].concat(Array.prototype.slice.call(arguments));return Object.assign.apply(this,e)},defaultSettings={parent:"body",className:"loader",loading:"Loading…",success:"Success!",failure:"An error occurred.",removeAfter:800},Loader={new:function(e){function t(){return i||(u.parent.insertAdjacentHTML("beforeend",'<div class="'+u.className+'"></div>'),i=u.parent.lastChild),i}function n(e){e=merge(u,e||{}),i=t(),i.textContent=e.message,i.className=u.className,i.classList.add(e.className),e.removeAfter&&setTimeout(function(){c(e.callback)},e.removeAfter)}function r(e){n(o(e,"loading"))}function a(e){n(o(e,"success"))}function s(e){n(o(e,"failure"))}function o(e,t){return"string"==typeof e&&(e={message:e}),e=merge({message:u[t],className:t},e||{}),void 0===e.removeAfter&&(e.removeAfter="loading"!=t&&u.removeAfter),e}function c(e){requestAnimationFrame(function(){u.parent.removeChild(t()),i=null,"function"==typeof e&&e()})}var i,u=merge(defaultSettings,e||{});return"string"==typeof u.parent&&(u.parent=document.querySelector(u.parent)),{options:u,loading:r,success:a,failure:s,show:n,element:t,remove:c}},defaults:function(e){return Object.assign(defaultSettings,e||{})}};module.exports=Loader;
86
- },{}],41:[function(require,module,exports){
87
- require("./lib/object.assign");var Event=require("compose-event"),sliders=[],listening,Slider={change:function(e){self.refresh(e.currentTarget)},refresh:function(e){self.setLabels(e),self.setInput(e),self.setFill(e)},focus:function(e){e.currentTarget.focus()},setup:function(){listening||(Event.on(document,"input toggler:show","[type=range]",self.change,{useCapture:!0}),Event.on(document,"click change input","[type=range]",self.focus,{useCapture:!0}),listening=!0);var e=document.querySelectorAll("[type=range]:not(.slider-input)");Array.prototype.forEach.call(e,function(e){var l=self.data(e);sliders.push(l),e.dataset.id=l.id,e=self.template(e),self.refresh(e)})},data:function(e){var l={id:sliders.length,min:e.getAttribute("min")||0,max:e.getAttribute("max")||100,labels:{},externalLabels:{}};Object.assign(l,self.extractData(e)),l=self.extractValues(l),l=self.getLabels(l),l.values&&(l.max=l.min+l.values.length-1),l.segments=Number(l.max)-Number(l.min)+1;for(var t in l)t.match(/-/)&&(l[this.camelCase(t)]=l[t],delete l[t]);return!l.input&&e.getAttribute("name")&&(l.input=e.getAttribute("name"),e.removeAttribute("name")),l.input&&(l.inputClass=l.input.replace(/\W/g,"-"),l.inputExists=self.inputExists(e,l)),l=self.getLineLabels(l),l.mark&&(l.mark=l.mark.split(",").map(Number)),l},getData:function(e){return"string"!=typeof e&&e.dataset&&(e=e.dataset.id),sliders[e]},extractValues:function(e){if(e.values)e.values=e.values.split(",").map(self.trim);else{e.values=[];for(var l=e.min;l<=e.max;l++)e.values.push(l)}return e},getLabels:function(e){e.label&&e.label.match(/false|none/)&&(e.label=!1);for(var l in e)if(e.hasOwnProperty(l)&&!1!==e[l]){var t=l.match(/^(external-)?label-(.+)|^label$/);if(t){var a=e[l].match(/;/)?";":",",s=e[l].split(a).map(self.trim),n=t[1],r=t[2];n?e.externalLabels[r]=s:"label"==l?(e.labels.default=s,delete e.label):e.labels[r]=s,delete e[l]}var i=self.objectSize(e.labels);0==i&&(e.labels.default=e.values),i>1&&delete e.labels.default}return e},getLineLabels:function(e){var l={};if(e.lineLabels){var t=e.lineLabels.match(/;/)?";":",";e.lineLabels.split(t).map(function(e,t){var a=e.split(":");label=a[1]?a[1]:a[0],t=a[1]?a[0]:t+1,l[t]=label}),e.lineLabels=l}return e},template:function(e){var l=self.getData(e);e.setAttribute("min",l.min),e.setAttribute("max",l.max),e.classList.add("slider-input"),e.classList.contains("left-label")&&e.classList.remove("left-label");var t=self.templateHTML(l),a=["slider-container"];t.match("slider-line-label")&&a.push("line-labels"),t.match("slider-label")?a.push("with-label"):a.push("without-label"),t='<div class="'+a.join(" ")+'" id="slider'+l.id+'">'+t+"</div>",e.insertAdjacentHTML("beforebegin",t);var s=e.previousSibling;return s.querySelector(".slider-input-container").insertAdjacentHTML("afterbegin",e.outerHTML),e.parentNode.removeChild(e),e=s.querySelector(".slider-input"),e.getAttribute("value")||(e.value=l.value||l.min),e},templateHTML:function(e){var l="",t="";if(e.mark||e.lineLabels)for(var a=1;a<=e.segments;a++)l+="<div class='slider-segment'><span class='slider-segment-content'>",e.mark&&-1!=e.mark.indexOf(a)&&(l+="<span class='slider-segment-mark' data-index='"+a+"'></span>"),e.lineLabels&&e.lineLabels[a]&&(l+="<span class='slider-line-label'>"+e.lineLabels[a]+"</span>"),l+="</span></div>";for(var a=1;a<e.segments;a++)t+="<span class='slider-fill' data-index='"+a+"'></span>";return l="<div class='slider-input-container'><div class='slider-track'>"+l+"</div><div class='slider-fills'>"+t+"</div></div>"+self.labelTemplate(e),!e.inputExists&&e.inputClass&&(l+="<input class='"+e.inputClass+"' type='hidden' name='"+e.input+"' value=''>"),l},labelTemplate:function(e){var l="";if(0==e.label)return l;for(var t in e.labels)l+='<span class="slider-label-'+t+' internal-label" data-slider-label="'+t+'">',l+=self.labelHTML(e,t,""),l+="</span></span> ";return l.length>0&&(l="<div class='slider-label align-"+(e.positionLabel||"right")+"'>"+l+"</div>"),l},labelHTML:function(e,l,t){return self.labelMeta(e,l,"before")+"<span class='label-content'>"+t+"</span>"+self.labelMeta(e,l,"after")},labelMeta:function(e,l,t){var a=self.camelCase("-label-"+l),s=e[t+a]||e[t+"Label"];return s?"<span class='"+t+"-label'>"+s+"</span>":""},inputExists:function(e,l){if(l.inputClass){var t=self.scope(e).querySelector('input[name="'+l.input+'"]');if(t)return t.classList.add(l.inputClass),!0}},extractData:function(e){for(var l={},t=0;t<e.attributes.length;t++){var a=e.attributes[t].nodeName;new RegExp("^data-").test(a)&&(a=a.replace("data-",""),l[a]=e.attributes[t].nodeValue)}return l},labelElements:function(e,l,t){var a="[data-slider-label="+l+"]",s="#slider"+e+" "+a,n=a+=":not(.internal-label)";return a=t?n:s+", "+n,document.querySelectorAll(a)},setFill:function(e){var l=self.getData(e),t=document.querySelectorAll("#slider"+l.id+" .slider-segment"),a=document.querySelectorAll("#slider"+l.id+" .slider-fill"),s=self.sliderIndex(e);Array.prototype.forEach.call(a,function(e,l){e.dataset.index<=s?(e.classList.add("filled"),t[l]&&t[l].classList.add("filled")):(e.classList.remove("filled"),t[l]&&t[l].classList.remove("filled"))})},setInput:function(e){var l=self.getData(e);if(null!==e.offsetParent&&l.input&&l.values){var t=l.values[self.sliderIndex(e)],a="."+l.input.replace(/\W/g,"-"),s=self.scope(e).querySelectorAll(a);Array.prototype.forEach.call(s,function(e){e.value=t})}},setLabels:function(e){var l=self.getData(e),t=self.sliderIndex(e);null!==e.offsetParent&&Array.prototype.forEach.call(["labels","externalLabels"],function(e){var a="externalLabels"==e;for(var s in l[e]){var n=self.labelElements(l.id,s,a),r=self.labelAtIndex(l[e],t);Array.prototype.forEach.call(n,function(e){var t=e.querySelector(".label-content");t?t.innerHTML=r[s]:e.innerHTML=self.labelHTML(l,s,r[s]),e.classList.toggle("empty-label",""==r[s])})}})},labelAtIndex:function(e,l){var t={};for(var a in e)t[a]=e[a][l];return t},sliderIndex:function(e){return Number(e.value)-Number(e.getAttribute("min"))},scope:function(e){for(var l=e;l&&"FORM"!=l.tagName;)l=l.parentNode;return l||document},trim:function(e){return e.trim()},objectSize:function(e){var l=0;for(var t in e)l++;return l},camelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,l){return l.toUpperCase()})}},self=Slider;Event.change(Slider.setup),module.exports=Slider;
88
- },{"./lib/object.assign":42,"compose-event":22}],42:[function(require,module,exports){
89
- "function"!=typeof Object.assign&&function(){Object.assign=function(n){"use strict";if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),o=1;o<arguments.length;o++){var r=arguments[o];if(void 0!==r&&null!==r)for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}}();
90
- },{}],43:[function(require,module,exports){
91
- var Event=require("compose-event"),Toggler={checkboxSelector:"[type=checkbox][data-toggle], [type=checkbox][data-show], [type=checkbox][data-hide]",radioSelector:"input[type=radio][data-show], input[type=radio][data-hide], input[type=radio][data-add-class], input[type=radio][data-remove-class]",selectSelector:"option[data-hide], option[data-show]",listen:function(){Event.on(document,"click change","[data-toggle], [data-show], [data-hide], [data-toggle-class], [data-add-class], [data-remove-class]",Toggler.trigger),Event.on(document,"change",".select-toggler",Toggler.trigger),Event.on(window,"hashchange",Toggler.hashChange)},hashChange:function(){if(window.location.hash){var e='[data-anchor="'+window.location.hash+'"]',t=document.querySelector("input"+e+", option"+e);if(t){if("radio"==t.type)t.checked=!0;else{var a=Toggler.getSelectFromOption(t);a.selectedIndex=t.index,t=a}ratchet.toggler.triggerToggling(t)}}},refresh:function(){Toggler.toggleCheckboxes(),Toggler.setupSelects(),Toggler.setupRadios()},trigger:function(e){"#"==e.currentTarget.getAttribute("href")&&(e.preventDefault(),e.stop()),Toggler.triggerToggling(e.currentTarget,e)},triggerToggling:function(e,t){var a,o=["hide","toggle","show","removeClass","toggleClass","addClass"];e.tagName.match(/select/i)&&(a=e,e=a.selectedOptions[0]),(a||"radio"==e.type)&&(o=o.filter(function(e){return!e.match(/toggle/)})),o.forEach(function(t){Toggler.dispatch(e,t)})},dispatch:function(e,t){var a=t,o=e.dataset[t];o&&void 0!==o&&""!=o&&("checkbox"==e.type&&(a=t.match(/hide|remove/i)?!e.checked:e.checked),o&&(t.match(/class/i)?Toggler.setClass(o,a,e):Toggler.setState(o,a)))},setClass:function(e,t,a){if(void 0!==e&&""!=e){if("boolean"==typeof t&&(t=t?"add":"remove"),e.match(/&/))return void e.split("&").forEach(function(e){Toggler.setClass(e.trim(),t,a)});var o=e.split(";"),r=o[0].trim(),l=[];e=o[1],e?l=document.querySelectorAll(e):a&&a.tagName.match(/option/i)?l=[Toggler.getSelectFromOption(a)]:a&&(l=[a]),Array.prototype.forEach.call(l,function(e){Array.prototype.forEach.call(r.split(" "),function(a){var o=t.replace(/Class/,"");e.classList[o](a)}),Toggler.triggerTogglerEventsOnChildren(e,"class")})}},setState:function(e,t){var a=document.querySelectorAll(e);Array.prototype.forEach.call(a,function(e){var a=Toggler.toggleAction(e,t);Toggler[a](e),Toggler.triggerTogglerEventsOnChildren(e,a)})},toggleAction:function(e,t){return"boolean"==typeof t&&(t=t?"show":"hide"),"toggle"==t&&(t=e.classList.contains("hidden")?"show":"hide"),t},show:function(e){e.classList.remove("hidden"),e.classList.add("visible"),void 0!==e.disabled&&(e.disabled=!1);var t=e.querySelector("[data-focus]");t&&t.focus();e.querySelectorAll("[type=range]")},hide:function(e){e.classList.remove("visible"),e.classList.add("hidden"),void 0!==e.disabled&&(e.disabled=!0)},getLeafNodes:function(e){return e.hasChildNodes()?Array.prototype.slice.call(e.getElementsByTagName("*"),0).filter(function(e){return e.children&&0===e.children.length}):[e]},triggerTogglerEventsOnChildren:function(e,t){var a=Toggler.getLeafNodes(e);Array.prototype.forEach.call(a,function(e){Event.fire(e,"toggler:"+t)})},toggleCheckboxes:function(e){e=e||document.querySelectorAll(Toggler.checkboxSelector),Array.prototype.forEach.call(e,Toggler.triggerToggling)},setupRadios:function(){Array.prototype.forEach.call(document.querySelectorAll(Toggler.radioSelector),function(e,t){if(!e.dataset.togglerActive){var a,o=e.getAttribute("name"),r=Toggler.parentForm(e).querySelectorAll('[type=radio][name="'+o+'"]'),l=Toggler.dataAttributes(r,"show"),n=Toggler.dataAttributes(r,"addClass");Array.prototype.forEach.call(r,function(e){e.dataset.anchor&&window.location.hash=="#"+e.dataset.anchor.replace("#","")&&(e.checked=!0),e.dataset.show=e.dataset.show||"",e.dataset.addClass=e.dataset.addClass||"",e.dataset.hide&&e.dataset.hide.length>0&&(l=l.concat(e.dataset.hide.split(","))),e.dataset.hide=l.filter(function(t){return e.dataset.show.indexOf(t)}).join(","),e.dataset.addClass=e.dataset.addClass||"",e.dataset.removeClass=n.filter(function(t){return e.dataset.addClass.indexOf(t)}).join("&"),e.dataset.togglerActive=!0,e.checked&&(a=e)}),a?Toggler.triggerToggling(a):(Toggler.setState(l.join(","),"hide"),Toggler.setClass(n.join(" & "),"removeClass"))}})},setupSelects:function(){Array.prototype.forEach.call(document.querySelectorAll(Toggler.selectSelector),function(e){if(!e.dataset.togglerActive){e.dataset.show=e.dataset.show||"";var t=Toggler.getSelectFromOption(e);t.classList.add("select-toggler");var a=t.querySelectorAll("option"),o=Toggler.dataAttributes(a,"show"),r=Toggler.dataAttributes(a,"addClass");Array.prototype.forEach.call(a,function(e,a){e.dataset.anchor&&window.location.hash=="#"+e.dataset.anchor.replace("#","")&&(t.selectedIndex=a),e.dataset.show=e.dataset.show||"",e.dataset.addClass=e.dataset.addClass||"",e.dataset.hide&&e.dataset.hide.length>0&&(o=o.concat(e.dataset.hide.split(","))),e.dataset.hide=o.filter(function(t){return e.dataset.show.indexOf(t)}).join(","),e.dataset.removeClass=r.filter(function(t){return e.dataset.addClass.indexOf(t)}).join(" & "),e.dataset.togglerActive=!0}),Toggler.triggerToggling(t)}})},getSelectFromOption:function(e){var t=e.parentElement;return"SELECT"==t.tagName?t:Toggler.getSelectFromOption(t)},parentForm:function(e){for(var t=e;t&&"FORM"!=t.tagName;)t=t.parentNode;return t||document},dataAttributes:function(e,t){return Array.prototype.map.call(e,function(e){return e.dataset[t]}).filter(function(e,t,a){return""!=e&&void 0!==e&&a.indexOf(e)===t})}};Event.ready(Toggler.listen),Event.change(Toggler.refresh),module.exports=Toggler;
92
- },{"compose-event":22}],44:[function(require,module,exports){
74
+ },{"./debounce":24}],35:[function(require,module,exports){
93
75
  require("./lib/shims/_classlist");var merge=require("./lib/shims/_object.assign"),event=require("compose-event"),scrollTo=require("./lib/scrollto"),fromTop=require("./lib/fromtop"),ease=require("./lib/ease"),toolbox={event:event,scrollTo:scrollTo,fromTop:fromTop,merge:merge,ease:ease,getClosest:function(e,r){for(;e&&e!==document;e=e.parentNode)if(toolbox.matches(e,r))return e;return!1},getNext:function(e,r){for(;e&&e!==document;e=e.parentNode)if(e.querySelector(r))return e.querySelector(r);return!1},matches:function(e,r){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,r)},wordCount:function(e){var r=e.match(/\S+/g);return r?r.length:0},slice:function(e,r){return Array.prototype.slice.call(e,r)},each:function(e,r){return Array.prototype.forEach.call(e,r)},formData:function(e){var r=new FormData,o=e.querySelectorAll("input[name]");return toolbox.each(o,function(e){r.append(e.name,e.value)}),r}};module.exports=toolbox;
94
- },{"./lib/ease":45,"./lib/fromtop":46,"./lib/scrollto":47,"./lib/shims/_classlist":48,"./lib/shims/_object.assign":49,"compose-event":22}],45:[function(require,module,exports){
76
+ },{"./lib/ease":36,"./lib/fromtop":37,"./lib/scrollto":38,"./lib/shims/_classlist":39,"./lib/shims/_object.assign":40,"compose-event":20}],36:[function(require,module,exports){
95
77
  var ease={inOutQuad:function(t,u,n,e){return(t/=e/2)<1?n/2*t*t+u:(t--,-n/2*(t*(t-2)-1)+u)},inOutCubic:function(t,u,n,e){return(t/=e/2)<1?n/2*t*t*t+u:(t-=2,n/2*(t*t*t+2)+u)},inOutQuint:function(t,u,n,e){var r=(t/=e)*t,i=r*t;return u+n*(6*i*r+-15*r*r+10*i)},inOutCirc:function(t,u,n,e){return(t/=e/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+u:(t-=2,n/2*(Math.sqrt(1-t*t)+1)+u)}};ease.default=ease.inOutQuad,module.exports=ease;
96
- },{}],46:[function(require,module,exports){
78
+ },{}],37:[function(require,module,exports){
97
79
  module.exports=function(t){return Math.round(t.getBoundingClientRect().top+window.pageYOffset)};
98
- },{}],47:[function(require,module,exports){
80
+ },{}],38:[function(require,module,exports){
99
81
  function move(o){document.documentElement.scrollTop=o,document.body.parentNode.scrollTop=o,document.body.scrollTop=o}function position(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function scrollTo(o,e,n){"object"==typeof o&&(o=fromTop(o)),"number"==typeof e&&(n=e,e=null),n=void 0===n?500:n;var t=position(),r=o-t,c=0,l=function(){c+=20,move(ease.default(c,t,r,n)),c<n?requestAnimationFrame(l):e&&"function"==typeof e&&e()};l()}var ease=require("./ease"),fromTop=require("./fromtop");module.exports=scrollTo;
100
- },{"./ease":45,"./fromtop":46}],48:[function(require,module,exports){
82
+ },{"./ease":36,"./fromtop":37}],39:[function(require,module,exports){
101
83
  "document"in self&&("classList"in document.createElement("_")?function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,i=arguments.length;for(n=0;n<i;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():function(t){"use strict";if("Element"in t){var e=t.Element.prototype,n=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array.prototype.indexOf||function(t){for(var e=0;e<this.length;e++)if(e in this&&this[e]===t)return e;return-1},r=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},o=function(t,e){if(""===e)throw new r("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new r("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},a=function(t){for(var e=i.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],s=0;s<n.length;s++)this.push(n[s]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=a.prototype=[],l=function(){return new a(this)};if(r.prototype=Error.prototype,c.item=function(t){return this[t]||null},c.contains=function(t){return t+="",-1!==o(this,t)},c.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do{t=e[n]+"",-1===o(this,t)&&(this.push(t),s=!0)}while(++n<i);s&&this._updateClassName()},c.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do{for(t=n[i]+"",e=o(this,t);-1!==e;)this.splice(e,1),r=!0,e=o(this,t)}while(++i<s);r&&this._updateClassName()},c.toggle=function(t,e){t+="";var n=this.contains(t),i=n?!0!==e&&"remove":!1!==e&&"add";return i&&this[i](t),!0===e||!1===e?e:!n},c.toString=function(){return this.join(" ")},n.defineProperty){var u={get:l,enumerable:!0,configurable:!0};try{n.defineProperty(e,"classList",u)}catch(t){-2146823252===t.number&&(u.enumerable=!1,n.defineProperty(e,"classList",u))}}else n.prototype.__defineGetter__&&e.__defineGetter__("classList",l)}}(self));
102
- },{}],49:[function(require,module,exports){
84
+ },{}],40:[function(require,module,exports){
103
85
  "function"!=typeof Object.assign&&function(){Object.assign=function(t){"use strict";if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),e=1;e<arguments.length;e++){var n=arguments[e];if(void 0!==n&&null!==n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r}}();var merge=function(){var t=[{}].concat(Array.prototype.slice.call(arguments));return Object.assign.apply(this,t)};module.exports=merge;
104
- },{}],50:[function(require,module,exports){
86
+ },{}],41:[function(require,module,exports){
105
87
  !function(e){function n(e,n){for(var t=e.length;t--;)if(e[t]===n)return t;return-1}function t(e,n){if(e.length!=n.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function o(e){for(m in b)b[m]=e[T[m]]}function r(e){var t,r,i,l,c,u;if(t=e.keyCode,-1==n(S,t)&&S.push(t),93!=t&&224!=t||(t=91),t in b){b[t]=!0;for(i in C)C[i]==t&&(f[i]=!0)}else if(o(e),f.filter.call(this,e)&&t in E)for(u=p(),l=0;l<E[t].length;l++)if(r=E[t][l],r.scope==u||"all"==r.scope){c=r.mods.length>0;for(i in b)(!b[i]&&n(r.mods,+i)>-1||b[i]&&-1==n(r.mods,+i))&&(c=!1);(0!=r.mods.length||b[16]||b[18]||b[17]||b[91])&&!c||!1===r.method(e,r)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function i(e){var t,o=e.keyCode,r=n(S,o);if(r>=0&&S.splice(r,1),93!=o&&224!=o||(o=91),o in b){b[o]=!1;for(t in C)C[t]==o&&(f[t]=!1)}}function l(){for(m in b)b[m]=!1;for(m in C)f[m]=!1}function f(e,n,t){var o,r;o=g(e),void 0===t&&(t=n,n="all");for(var i=0;i<o.length;i++)r=[],e=o[i].split("+"),e.length>1&&(r=v(e),e=[e[e.length-1]]),e=e[0],e=P(e),e in E||(E[e]=[]),E[e].push({shortcut:o[i],scope:n,method:t,key:o[i],mods:r})}function c(e,n){var o,r,i,l,f,c=[];for(o=g(e),l=0;l<o.length;l++){if(r=o[l].split("+"),r.length>1&&(c=v(r),e=r[r.length-1]),e=P(e),void 0===n&&(n=p()),!E[e])return;for(i=0;i<E[e].length;i++)f=E[e][i],f.scope===n&&t(f.mods,c)&&(E[e][i]={})}}function u(e){return"string"==typeof e&&(e=P(e)),-1!=n(S,e)}function a(){return S.slice(0)}function s(e){var n=(e.target||e.srcElement).tagName;return!("INPUT"==n||"SELECT"==n||"TEXTAREA"==n)}function d(e){w=e||"all"}function p(){return w||"all"}function h(e){var n,t,o;for(n in E)for(t=E[n],o=0;o<t.length;)t[o].scope===e?t.splice(o,1):o++}function g(e){var n;return e=e.replace(/\s/g,""),n=e.split(","),""==n[n.length-1]&&(n[n.length-2]+=","),n}function v(e){for(var n=e.slice(0,e.length-1),t=0;t<n.length;t++)n[t]=C[n[t]];return n}function y(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,function(){t(window.event)})}function k(){var n=e.key;return e.key=A,n}var m,E={},b={16:!1,18:!1,17:!1,91:!1},w="all",C={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},K={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},P=function(e){return K[e]||e.toUpperCase().charCodeAt(0)},S=[];for(m=1;m<20;m++)K["f"+m]=111+m;var T={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(m in C)f[m]=!1;y(document,"keydown",function(e){r(e)}),y(document,"keyup",i),y(window,"focus",l);var A=e.key;e.key=f,e.key.setScope=d,e.key.getScope=p,e.key.deleteScope=h,e.key.filter=s,e.key.isPressed=u,e.key.getPressedKeyCodes=a,e.key.noConflict=k,e.key.unbind=c,"undefined"!=typeof module&&(module.exports=f)}(this);
106
- },{}],51:[function(require,module,exports){
107
- function noop(){}function serialize(e){if(!isObject(e))return e;var t=[];for(var r in e)pushEncodedKeyValuePair(t,r,e[r]);return t.join("&")}function pushEncodedKeyValuePair(e,t,r){if(null!=r)if(Array.isArray(r))r.forEach(function(r){pushEncodedKeyValuePair(e,t,r)});else if(isObject(r))for(var s in r)pushEncodedKeyValuePair(e,t+"["+s+"]",r[s]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));else null===r&&e.push(encodeURIComponent(t))}function parseString(e){for(var t,r,s={},n=e.split("&"),o=0,i=n.length;o<i;++o)t=n[o],r=t.indexOf("="),-1==r?s[decodeURIComponent(t)]="":s[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return s}function parseHeader(e){var t,r,s,n,o=e.split(/\r?\n/),i={};o.pop();for(var u=0,a=o.length;u<a;++u)r=o[u],t=r.indexOf(":"),s=r.slice(0,t).toLowerCase(),n=trim(r.slice(t+1)),i[s]=n;return i}function isJSON(e){return/[\/+]json\b/.test(e)}function type(e){return e.split(/ *; */).shift()}function params(e){return e.split(/ *; */).reduce(function(e,t){var r=t.split(/ *= */),s=r.shift(),n=r.shift();return s&&n&&(e[s]=n),e},{})}function Response(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this._setStatusProperties(this.xhr.status),this.header=this.headers=parseHeader(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function Request(e,t){var r=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new Response(r)}catch(t){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=t,e.rawResponse=r.xhr&&r.xhr.responseText?r.xhr.responseText:null,e.statusCode=r.xhr&&r.xhr.status?r.xhr.status:null,r.callback(e)}r.emit("response",t);var s;try{(t.status<200||t.status>=300)&&(s=new Error(t.statusText||"Unsuccessful HTTP response"),s.original=e,s.response=t,s.status=t.status)}catch(e){s=e}s?r.callback(s,t):r.callback(null,t)})}function del(e,t){var r=request("DELETE",e);return t&&r.end(t),r}var root;"undefined"!=typeof window?root=window:"undefined"!=typeof self?root=self:(console.warn("Using browser-only version of superagent in non-browser environment"),root=this);var Emitter=require("emitter"),requestBase=require("./request-base"),isObject=require("./is-object"),request=module.exports=require("./request").bind(null,Request);request.getXHR=function(){if(!(!root.XMLHttpRequest||root.location&&"file:"==root.location.protocol&&root.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only verison of superagent could not find XHR")};var trim="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};request.serializeObject=serialize,request.parseString=parseString,request.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},request.serialize={"application/x-www-form-urlencoded":serialize,"application/json":JSON.stringify},request.parse={"application/x-www-form-urlencoded":parseString,"application/json":JSON.parse},Response.prototype.get=function(e){return this.header[e.toLowerCase()]},Response.prototype._setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=type(t);var r=params(t);for(var s in r)this[s]=r[s]},Response.prototype._parseBody=function(e){var t=request.parse[this.type];return!t&&isJSON(this.type)&&(t=request.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},Response.prototype._setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},Response.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,s="cannot "+t+" "+r+" ("+this.status+")",n=new Error(s);return n.status=this.status,n.method=t,n.url=r,n},request.Response=Response,Emitter(Request.prototype);for(var key in requestBase)Request.prototype[key]=requestBase[key];Request.prototype.type=function(e){return this.set("Content-Type",request.types[e]||e),this},Request.prototype.responseType=function(e){return this._responseType=e,this},Request.prototype.accept=function(e){return this.set("Accept",request.types[e]||e),this},Request.prototype.auth=function(e,t,r){switch(r||(r={type:"basic"}),r.type){case"basic":var s=btoa(e+":"+t);this.set("Authorization","Basic "+s);break;case"auto":this.username=e,this.password=t}return this},Request.prototype.query=function(e){return"string"!=typeof e&&(e=serialize(e)),e&&this._query.push(e),this},Request.prototype.attach=function(e,t,r){return this._getFormData().append(e,t,r||t.name),this},Request.prototype._getFormData=function(){return this._formData||(this._formData=new root.FormData),this._formData},Request.prototype.callback=function(e,t){var r=this._callback;this.clearTimeout(),r(e,t)},Request.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},Request.prototype._timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},Request.prototype._appendQueryString=function(){var e=this._query.join("&");e&&(this.url+=~this.url.indexOf("?")?"&"+e:"?"+e)},Request.prototype.end=function(e){var t=this,r=this.xhr=request.getXHR(),s=this._timeout,n=this._formData||this._data;this._callback=e||noop,r.onreadystatechange=function(){if(4==r.readyState){var e;try{e=r.status}catch(t){e=0}if(0==e){if(t.timedout)return t._timeoutError();if(t._aborted)return;return t.crossDomainError()}t.emit("end")}};var o=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{r.onprogress=o.bind(null,"download"),r.upload&&(r.upload.onprogress=o.bind(null,"upload"))}catch(e){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),this._appendQueryString(),this.username&&this.password?r.open(this.method,this.url,!0,this.username,this.password):r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],u=this._serializer||request.serialize[i?i.split(";")[0]:""];!u&&isJSON(i)&&(u=request.serialize["application/json"]),u&&(n=u(n))}for(var a in this.header)null!=this.header[a]&&r.setRequestHeader(a,this.header[a]);return this._responseType&&(r.responseType=this._responseType),this.emit("request",this),r.send(void 0!==n?n:null),this},request.Request=Request,request.get=function(e,t,r){var s=request("GET",e);return"function"==typeof t&&(r=t,t=null),t&&s.query(t),r&&s.end(r),s},request.head=function(e,t,r){var s=request("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&s.send(t),r&&s.end(r),s},request.options=function(e,t,r){var s=request("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&s.send(t),r&&s.end(r),s},request.del=del,request.delete=del,request.patch=function(e,t,r){var s=request("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&s.send(t),r&&s.end(r),s},request.post=function(e,t,r){var s=request("POST",e);return"function"==typeof t&&(r=t,t=null),t&&s.send(t),r&&s.end(r),s},request.put=function(e,t,r){var s=request("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&s.send(t),r&&s.end(r),s};
108
- },{"./is-object":52,"./request":54,"./request-base":53,"emitter":20}],52:[function(require,module,exports){
109
- function isObject(e){return null!==e&&"object"==typeof e}module.exports=isObject;
110
- },{}],53:[function(require,module,exports){
111
- var isObject=require("./is-object");exports.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},exports.parse=function(t){return this._parser=t,this},exports.serialize=function(t){return this._serializer=t,this},exports.timeout=function(t){return this._timeout=t,this},exports.then=function(t,e){if(!this._fullfilledPromise){var i=this;this._fullfilledPromise=new Promise(function(t,e){i.end(function(i,r){i?e(i):t(r)})})}return this._fullfilledPromise.then(t,e)},exports.catch=function(t){return this.then(void 0,t)},exports.use=function(t){return t(this),this},exports.get=function(t){return this._header[t.toLowerCase()]},exports.getHeader=exports.get,exports.set=function(t,e){if(isObject(t)){for(var i in t)this.set(i,t[i]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},exports.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},exports.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(isObject(t)){for(var i in t)this.field(i,t[i]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return this._getFormData().append(t,e),this},exports.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},exports.withCredentials=function(){return this._withCredentials=!0,this},exports.redirects=function(t){return this._maxRedirects=t,this},exports.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},exports._isHost=function(t){switch({}.toString.call(t)){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}},exports.send=function(t){var e=isObject(t),i=this._header["content-type"];if(e&&isObject(this._data))for(var r in t)this._data[r]=t[r];else"string"==typeof t?(i||this.type("form"),i=this._header["content-type"],this._data="application/x-www-form-urlencoded"==i?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(i||this.type("json"),this)};
112
- },{"./is-object":52}],54:[function(require,module,exports){
113
- function request(e,n,t){return"function"==typeof t?new e("GET",n).end(t):2==arguments.length?new e("GET",n):new e(n,t)}module.exports=request;
114
- },{}]},{},[2])(2)
88
+ },{}]},{},[1])(1)
115
89
  });
116
90
 
117
91
 
118
- //# sourceMappingURL=/assets/tungsten/tungsten-0.1.0.map.json
92
+ //# sourceMappingURL=/assets/tungsten/code-0.1.1.map.json