@limetech/lime-elements 36.0.0-next.8 → 36.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/cjs/{dateFormatter-05d80b12.js → dateFormatter-d7a8d40d.js} +1 -1
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-button.cjs.entry.js +1 -1
  4. package/dist/cjs/limel-chip-set.cjs.entry.js +19 -11
  5. package/dist/cjs/limel-code-editor.cjs.entry.js +1596 -2
  6. package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-date-picker.cjs.entry.js +3 -3
  8. package/dist/cjs/limel-dock-button.cjs.entry.js +32 -6
  9. package/dist/cjs/limel-dock.cjs.entry.js +6 -7
  10. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +2 -2
  11. package/dist/cjs/limel-form.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-input-field.cjs.entry.js +13 -6
  13. package/dist/cjs/limel-menu-list.cjs.entry.js +2 -3
  14. package/dist/cjs/limel-menu.cjs.entry.js +3 -14
  15. package/dist/cjs/limel-popover_4.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-select.cjs.entry.js +4 -5
  18. package/dist/cjs/limel-table.cjs.entry.js +17 -5
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/cjs/{moment-5cfac5cd.js → moment-d1e35cdc.js} +2 -2
  21. package/dist/collection/components/button/button.css +11 -7
  22. package/dist/collection/components/chip-set/chip-set.css +6 -2
  23. package/dist/collection/components/chip-set/chip-set.js +21 -13
  24. package/dist/collection/components/code-editor/code-editor.css +153 -1
  25. package/dist/collection/components/code-editor/code-editor.js +90 -2
  26. package/dist/collection/components/collapsible-section/collapsible-section.css +8 -7
  27. package/dist/collection/components/date-picker/date-picker.js +18 -1
  28. package/dist/collection/components/dock/dock-button/dock-button.css +15 -9
  29. package/dist/collection/components/dock/dock-button/dock-button.js +61 -24
  30. package/dist/collection/components/dock/dock.css +7 -3
  31. package/dist/collection/components/dock/dock.js +53 -7
  32. package/dist/collection/components/input-field/input-field.js +32 -7
  33. package/dist/collection/components/menu/menu.js +3 -14
  34. package/dist/collection/components/menu-list/menu-list.js +5 -25
  35. package/dist/collection/components/popover-surface/popover-surface.css +5 -4
  36. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +21 -8
  37. package/dist/collection/components/select/select.css +10 -11
  38. package/dist/collection/components/select/select.template.js +3 -4
  39. package/dist/collection/components/table/columns.js +1 -0
  40. package/dist/collection/components/table/layout.js +8 -0
  41. package/dist/collection/components/table/table.css +89 -61
  42. package/dist/collection/components/table/table.js +46 -15
  43. package/dist/collection/style/internal/codemirror-tooltip.scss +19 -0
  44. package/dist/collection/style/mixins.scss +11 -0
  45. package/dist/esm/{dateFormatter-2cad0292.js → dateFormatter-784c3334.js} +1 -1
  46. package/dist/esm/lime-elements.js +1 -1
  47. package/dist/esm/limel-button.entry.js +1 -1
  48. package/dist/esm/limel-chip-set.entry.js +19 -11
  49. package/dist/esm/limel-code-editor.entry.js +1596 -2
  50. package/dist/esm/limel-collapsible-section.entry.js +1 -1
  51. package/dist/esm/limel-date-picker.entry.js +3 -3
  52. package/dist/esm/limel-dock-button.entry.js +32 -6
  53. package/dist/esm/limel-dock.entry.js +6 -7
  54. package/dist/esm/limel-flatpickr-adapter.entry.js +2 -2
  55. package/dist/esm/limel-form.entry.js +1 -1
  56. package/dist/esm/limel-input-field.entry.js +13 -6
  57. package/dist/esm/limel-menu-list.entry.js +2 -3
  58. package/dist/esm/limel-menu.entry.js +3 -14
  59. package/dist/esm/limel-popover_4.entry.js +1 -1
  60. package/dist/esm/limel-progress-flow-item.entry.js +1 -1
  61. package/dist/esm/limel-select.entry.js +4 -5
  62. package/dist/esm/limel-table.entry.js +18 -6
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/{moment-367e51c5.js → moment-faa8a4a8.js} +2 -2
  65. package/dist/lime-elements/lime-elements.css +1 -1
  66. package/dist/lime-elements/lime-elements.esm.js +1 -1
  67. package/dist/lime-elements/{p-7e571ec6.entry.js → p-0ba0c38a.entry.js} +1 -1
  68. package/dist/lime-elements/p-104c89e8.entry.js +1 -0
  69. package/dist/lime-elements/p-1390fdcb.entry.js +126 -0
  70. package/dist/lime-elements/{p-1dfccbc5.entry.js → p-2fc4f4ff.entry.js} +1 -1
  71. package/dist/lime-elements/p-3cf4aae0.entry.js +1 -0
  72. package/dist/lime-elements/p-4dc07252.entry.js +82 -0
  73. package/dist/lime-elements/p-5ef52589.entry.js +1 -0
  74. package/dist/lime-elements/p-653faf47.entry.js +1 -0
  75. package/dist/lime-elements/{p-d76f896d.js → p-73df4d83.js} +1 -1
  76. package/dist/lime-elements/p-93f42a32.entry.js +1 -0
  77. package/dist/lime-elements/p-945afca2.js +3 -0
  78. package/dist/lime-elements/p-b0e54dc2.entry.js +1 -0
  79. package/dist/lime-elements/p-c15da26d.entry.js +1 -0
  80. package/dist/lime-elements/{p-af0ec482.entry.js → p-c544c05b.entry.js} +1 -1
  81. package/dist/lime-elements/p-c59cbd68.entry.js +1 -0
  82. package/dist/lime-elements/p-cb8db8c2.entry.js +37 -0
  83. package/dist/lime-elements/p-f41567a1.entry.js +1 -0
  84. package/dist/lime-elements/p-f5df4d4f.entry.js +1 -0
  85. package/dist/lime-elements/style/internal/codemirror-tooltip.scss +19 -0
  86. package/dist/lime-elements/style/mixins.scss +11 -0
  87. package/dist/types/components/chip-set/chip-set.d.ts +3 -2
  88. package/dist/types/components/code-editor/code-editor.d.ts +14 -0
  89. package/dist/types/components/date-picker/date-picker.d.ts +4 -0
  90. package/dist/types/components/dock/dock-button/dock-button.d.ts +21 -5
  91. package/dist/types/components/dock/dock.d.ts +15 -3
  92. package/dist/types/components/input-field/input-field.d.ts +6 -0
  93. package/dist/types/components/menu/menu.d.ts +1 -2
  94. package/dist/types/components/menu-list/menu-list.d.ts +2 -7
  95. package/dist/types/components/table/layout.d.ts +2 -0
  96. package/dist/types/components/table/table.d.ts +16 -1
  97. package/dist/types/components/table/table.types.d.ts +4 -0
  98. package/dist/types/components.d.ts +71 -15
  99. package/package.json +5 -4
  100. package/dist/lime-elements/p-1a2ffe75.entry.js +0 -82
  101. package/dist/lime-elements/p-1e59114e.entry.js +0 -1
  102. package/dist/lime-elements/p-3af5f9ad.js +0 -3
  103. package/dist/lime-elements/p-5ad60e14.entry.js +0 -126
  104. package/dist/lime-elements/p-64f068a8.entry.js +0 -1
  105. package/dist/lime-elements/p-6966b5df.entry.js +0 -1
  106. package/dist/lime-elements/p-722d32e0.entry.js +0 -1
  107. package/dist/lime-elements/p-75152d89.entry.js +0 -1
  108. package/dist/lime-elements/p-7ee4b825.entry.js +0 -1
  109. package/dist/lime-elements/p-97d6c4a6.entry.js +0 -1
  110. package/dist/lime-elements/p-b18cf477.entry.js +0 -1
  111. package/dist/lime-elements/p-b95e80c9.entry.js +0 -1
  112. package/dist/lime-elements/p-bd098a11.entry.js +0 -1
  113. package/dist/lime-elements/p-d1ee4501.entry.js +0 -37
@@ -11037,7 +11037,1556 @@ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11037
11037
  });
11038
11038
  });
11039
11039
 
11040
- const codeEditorCss = ".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}:host{display:flex;font-size:1rem}.editor{width:100%}.editor.is-light-mode{--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}.editor.is-light-mode .cm-attribute,.editor.is-light-mode .cm-property,.editor.is-light-mode .cm-keyword{color:rgb(var(--color-violet-light))}.editor.is-light-mode .cm-operator{color:rgb(var(--color-sky-dark))}.editor.is-light-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-light-mode .cm-variable-2{color:rgb(var(--contrast-1100))}.editor.is-light-mode .cm-variable-3,.editor.is-light-mode .cm-type{color:rgb(var(--color-amber-darker))}.editor.is-light-mode .cm-builtin,.editor.is-light-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-light-mode .cm-atom{color:rgb(var(--color-coral-default))}.editor.is-light-mode .cm-tag,.editor.is-light-mode .cm-number{color:rgb(var(--color-magenta-default))}.editor.is-light-mode .cm-def{color:rgb(var(--color-sky-default))}.editor.is-light-mode .cm-string{color:rgb(var(--color-green-dark))}.editor.is-light-mode .cm-string-2{color:rgb(var(--color-pink-default))}.editor.is-light-mode .cm-qualifier{color:rgb(var(--color-grass-default))}.editor.is-light-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-light-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}.editor.is-dark-mode{--code-editor-neutral-text-color:var(--contrast-200);--code-editor-background-color:var(--contrast-1600);--code-editor-gutter-background-color:var(--contrast-1500);--code-editor-line-number-text-color:var(--contrast-1000);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-1700)}.editor.is-dark-mode .cm-attribute,.editor.is-dark-mode .cm-property,.editor.is-dark-mode .cm-keyword{color:rgb(var(--color-purple-lighter))}.editor.is-dark-mode .cm-operator{color:rgb(var(--color-sky-lighter))}.editor.is-dark-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-dark-mode .cm-variable-2{color:rgb(var(--contrast-300))}.editor.is-dark-mode .cm-variable-3,.editor.is-dark-mode .cm-type{color:rgb(var(--color-yellow-light))}.editor.is-dark-mode .cm-builtin,.editor.is-dark-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-dark-mode .cm-atom{color:rgb(var(--color-coral-light))}.editor.is-dark-mode .cm-tag,.editor.is-dark-mode .cm-number{color:rgb(var(--color-magenta-light))}.editor.is-dark-mode .cm-def{color:rgb(var(--color-sky-light))}.editor.is-dark-mode .cm-string{color:rgb(var(--color-lime-light))}.editor.is-dark-mode .cm-string-2{color:rgb(var(--color-pink-lighter))}.editor.is-dark-mode .cm-qualifier{color:rgb(var(--color-grass-light))}.editor.is-dark-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-dark-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}";
11040
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11041
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11042
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
11043
+
11044
+ (function(mod) {
11045
+ mod(codemirror);
11046
+ })(function(CodeMirror) {
11047
+ var GUTTER_ID = "CodeMirror-lint-markers";
11048
+ var LINT_LINE_ID = "CodeMirror-lint-line-";
11049
+
11050
+ function showTooltip(cm, e, content) {
11051
+ var tt = document.createElement("div");
11052
+ tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme;
11053
+ tt.appendChild(content.cloneNode(true));
11054
+ if (cm.state.lint.options.selfContain)
11055
+ cm.getWrapperElement().appendChild(tt);
11056
+ else
11057
+ document.body.appendChild(tt);
11058
+
11059
+ function position(e) {
11060
+ if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
11061
+ tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
11062
+ tt.style.left = (e.clientX + 5) + "px";
11063
+ }
11064
+ CodeMirror.on(document, "mousemove", position);
11065
+ position(e);
11066
+ if (tt.style.opacity != null) tt.style.opacity = 1;
11067
+ return tt;
11068
+ }
11069
+ function rm(elt) {
11070
+ if (elt.parentNode) elt.parentNode.removeChild(elt);
11071
+ }
11072
+ function hideTooltip(tt) {
11073
+ if (!tt.parentNode) return;
11074
+ if (tt.style.opacity == null) rm(tt);
11075
+ tt.style.opacity = 0;
11076
+ setTimeout(function() { rm(tt); }, 600);
11077
+ }
11078
+
11079
+ function showTooltipFor(cm, e, content, node) {
11080
+ var tooltip = showTooltip(cm, e, content);
11081
+ function hide() {
11082
+ CodeMirror.off(node, "mouseout", hide);
11083
+ if (tooltip) { hideTooltip(tooltip); tooltip = null; }
11084
+ }
11085
+ var poll = setInterval(function() {
11086
+ if (tooltip) for (var n = node;; n = n.parentNode) {
11087
+ if (n && n.nodeType == 11) n = n.host;
11088
+ if (n == document.body) return;
11089
+ if (!n) { hide(); break; }
11090
+ }
11091
+ if (!tooltip) return clearInterval(poll);
11092
+ }, 400);
11093
+ CodeMirror.on(node, "mouseout", hide);
11094
+ }
11095
+
11096
+ function LintState(cm, conf, hasGutter) {
11097
+ this.marked = [];
11098
+ if (conf instanceof Function) conf = {getAnnotations: conf};
11099
+ if (!conf || conf === true) conf = {};
11100
+ this.options = {};
11101
+ this.linterOptions = conf.options || {};
11102
+ for (var prop in defaults) this.options[prop] = defaults[prop];
11103
+ for (var prop in conf) {
11104
+ if (defaults.hasOwnProperty(prop)) {
11105
+ if (conf[prop] != null) this.options[prop] = conf[prop];
11106
+ } else if (!conf.options) {
11107
+ this.linterOptions[prop] = conf[prop];
11108
+ }
11109
+ }
11110
+ this.timeout = null;
11111
+ this.hasGutter = hasGutter;
11112
+ this.onMouseOver = function(e) { onMouseOver(cm, e); };
11113
+ this.waitingFor = 0;
11114
+ }
11115
+
11116
+ var defaults = {
11117
+ highlightLines: false,
11118
+ tooltips: true,
11119
+ delay: 500,
11120
+ lintOnChange: true,
11121
+ getAnnotations: null,
11122
+ async: false,
11123
+ selfContain: null,
11124
+ formatAnnotation: null,
11125
+ onUpdateLinting: null
11126
+ };
11127
+
11128
+ function clearMarks(cm) {
11129
+ var state = cm.state.lint;
11130
+ if (state.hasGutter) cm.clearGutter(GUTTER_ID);
11131
+ if (state.options.highlightLines) clearErrorLines(cm);
11132
+ for (var i = 0; i < state.marked.length; ++i)
11133
+ state.marked[i].clear();
11134
+ state.marked.length = 0;
11135
+ }
11136
+
11137
+ function clearErrorLines(cm) {
11138
+ cm.eachLine(function(line) {
11139
+ var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass);
11140
+ if (has) cm.removeLineClass(line, "wrap", has[0]);
11141
+ });
11142
+ }
11143
+
11144
+ function makeMarker(cm, labels, severity, multiple, tooltips) {
11145
+ var marker = document.createElement("div"), inner = marker;
11146
+ marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity;
11147
+ if (multiple) {
11148
+ inner = marker.appendChild(document.createElement("div"));
11149
+ inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple";
11150
+ }
11151
+
11152
+ if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
11153
+ showTooltipFor(cm, e, labels, inner);
11154
+ });
11155
+
11156
+ return marker;
11157
+ }
11158
+
11159
+ function getMaxSeverity(a, b) {
11160
+ if (a == "error") return a;
11161
+ else return b;
11162
+ }
11163
+
11164
+ function groupByLine(annotations) {
11165
+ var lines = [];
11166
+ for (var i = 0; i < annotations.length; ++i) {
11167
+ var ann = annotations[i], line = ann.from.line;
11168
+ (lines[line] || (lines[line] = [])).push(ann);
11169
+ }
11170
+ return lines;
11171
+ }
11172
+
11173
+ function annotationTooltip(ann) {
11174
+ var severity = ann.severity;
11175
+ if (!severity) severity = "error";
11176
+ var tip = document.createElement("div");
11177
+ tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity;
11178
+ if (typeof ann.messageHTML != 'undefined') {
11179
+ tip.innerHTML = ann.messageHTML;
11180
+ } else {
11181
+ tip.appendChild(document.createTextNode(ann.message));
11182
+ }
11183
+ return tip;
11184
+ }
11185
+
11186
+ function lintAsync(cm, getAnnotations) {
11187
+ var state = cm.state.lint;
11188
+ var id = ++state.waitingFor;
11189
+ function abort() {
11190
+ id = -1;
11191
+ cm.off("change", abort);
11192
+ }
11193
+ cm.on("change", abort);
11194
+ getAnnotations(cm.getValue(), function(annotations, arg2) {
11195
+ cm.off("change", abort);
11196
+ if (state.waitingFor != id) return
11197
+ if (arg2 && annotations instanceof CodeMirror) annotations = arg2;
11198
+ cm.operation(function() {updateLinting(cm, annotations);});
11199
+ }, state.linterOptions, cm);
11200
+ }
11201
+
11202
+ function startLinting(cm) {
11203
+ var state = cm.state.lint;
11204
+ if (!state) return;
11205
+ var options = state.options;
11206
+ /*
11207
+ * Passing rules in `options` property prevents JSHint (and other linters) from complaining
11208
+ * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.
11209
+ */
11210
+ var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
11211
+ if (!getAnnotations) return;
11212
+ if (options.async || getAnnotations.async) {
11213
+ lintAsync(cm, getAnnotations);
11214
+ } else {
11215
+ var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm);
11216
+ if (!annotations) return;
11217
+ if (annotations.then) annotations.then(function(issues) {
11218
+ cm.operation(function() {updateLinting(cm, issues);});
11219
+ });
11220
+ else cm.operation(function() {updateLinting(cm, annotations);});
11221
+ }
11222
+ }
11223
+
11224
+ function updateLinting(cm, annotationsNotSorted) {
11225
+ var state = cm.state.lint;
11226
+ if (!state) return;
11227
+ var options = state.options;
11228
+ clearMarks(cm);
11229
+
11230
+ var annotations = groupByLine(annotationsNotSorted);
11231
+
11232
+ for (var line = 0; line < annotations.length; ++line) {
11233
+ var anns = annotations[line];
11234
+ if (!anns) continue;
11235
+
11236
+ // filter out duplicate messages
11237
+ var message = [];
11238
+ anns = anns.filter(function(item) { return message.indexOf(item.message) > -1 ? false : message.push(item.message) });
11239
+
11240
+ var maxSeverity = null;
11241
+ var tipLabel = state.hasGutter && document.createDocumentFragment();
11242
+
11243
+ for (var i = 0; i < anns.length; ++i) {
11244
+ var ann = anns[i];
11245
+ var severity = ann.severity;
11246
+ if (!severity) severity = "error";
11247
+ maxSeverity = getMaxSeverity(maxSeverity, severity);
11248
+
11249
+ if (options.formatAnnotation) ann = options.formatAnnotation(ann);
11250
+ if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
11251
+
11252
+ if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
11253
+ className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity,
11254
+ __annotation: ann
11255
+ }));
11256
+ }
11257
+ // use original annotations[line] to show multiple messages
11258
+ if (state.hasGutter)
11259
+ cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1,
11260
+ options.tooltips));
11261
+
11262
+ if (options.highlightLines)
11263
+ cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity);
11264
+ }
11265
+ if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
11266
+ }
11267
+
11268
+ function onChange(cm) {
11269
+ var state = cm.state.lint;
11270
+ if (!state) return;
11271
+ clearTimeout(state.timeout);
11272
+ state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay);
11273
+ }
11274
+
11275
+ function popupTooltips(cm, annotations, e) {
11276
+ var target = e.target || e.srcElement;
11277
+ var tooltip = document.createDocumentFragment();
11278
+ for (var i = 0; i < annotations.length; i++) {
11279
+ var ann = annotations[i];
11280
+ tooltip.appendChild(annotationTooltip(ann));
11281
+ }
11282
+ showTooltipFor(cm, e, tooltip, target);
11283
+ }
11284
+
11285
+ function onMouseOver(cm, e) {
11286
+ var target = e.target || e.srcElement;
11287
+ if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
11288
+ var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
11289
+ var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
11290
+
11291
+ var annotations = [];
11292
+ for (var i = 0; i < spans.length; ++i) {
11293
+ var ann = spans[i].__annotation;
11294
+ if (ann) annotations.push(ann);
11295
+ }
11296
+ if (annotations.length) popupTooltips(cm, annotations, e);
11297
+ }
11298
+
11299
+ CodeMirror.defineOption("lint", false, function(cm, val, old) {
11300
+ if (old && old != CodeMirror.Init) {
11301
+ clearMarks(cm);
11302
+ if (cm.state.lint.options.lintOnChange !== false)
11303
+ cm.off("change", onChange);
11304
+ CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
11305
+ clearTimeout(cm.state.lint.timeout);
11306
+ delete cm.state.lint;
11307
+ }
11308
+
11309
+ if (val) {
11310
+ var gutters = cm.getOption("gutters"), hasLintGutter = false;
11311
+ for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
11312
+ var state = cm.state.lint = new LintState(cm, val, hasLintGutter);
11313
+ if (state.options.lintOnChange)
11314
+ cm.on("change", onChange);
11315
+ if (state.options.tooltips != false && state.options.tooltips != "gutter")
11316
+ CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
11317
+
11318
+ startLinting(cm);
11319
+ }
11320
+ });
11321
+
11322
+ CodeMirror.defineExtension("performLint", function() {
11323
+ startLinting(this);
11324
+ });
11325
+ });
11326
+ });
11327
+
11328
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11329
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11330
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
11331
+
11332
+ // Depends on jsonlint.js from https://github.com/zaach/jsonlint
11333
+
11334
+ // declare global: jsonlint
11335
+
11336
+ (function(mod) {
11337
+ mod(codemirror);
11338
+ })(function(CodeMirror) {
11339
+
11340
+ CodeMirror.registerHelper("lint", "json", function(text) {
11341
+ var found = [];
11342
+ if (!window.jsonlint) {
11343
+ if (window.console) {
11344
+ window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.");
11345
+ }
11346
+ return found;
11347
+ }
11348
+ // for jsonlint's web dist jsonlint is exported as an object with a single property parser, of which parseError
11349
+ // is a subproperty
11350
+ var jsonlint = window.jsonlint.parser || window.jsonlint;
11351
+ jsonlint.parseError = function(str, hash) {
11352
+ var loc = hash.loc;
11353
+ found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
11354
+ to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
11355
+ message: str});
11356
+ };
11357
+ try { jsonlint.parse(text); }
11358
+ catch(e) {}
11359
+ return found;
11360
+ });
11361
+
11362
+ });
11363
+ });
11364
+
11365
+ var foldcode = _commonjsHelpers.createCommonjsModule(function (module, exports) {
11366
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11367
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
11368
+
11369
+ (function(mod) {
11370
+ mod(codemirror);
11371
+ })(function(CodeMirror) {
11372
+
11373
+ function doFold(cm, pos, options, force) {
11374
+ if (options && options.call) {
11375
+ var finder = options;
11376
+ options = null;
11377
+ } else {
11378
+ var finder = getOption(cm, options, "rangeFinder");
11379
+ }
11380
+ if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
11381
+ var minSize = getOption(cm, options, "minFoldSize");
11382
+
11383
+ function getRange(allowFolded) {
11384
+ var range = finder(cm, pos);
11385
+ if (!range || range.to.line - range.from.line < minSize) return null;
11386
+ if (force === "fold") return range;
11387
+
11388
+ var marks = cm.findMarksAt(range.from);
11389
+ for (var i = 0; i < marks.length; ++i) {
11390
+ if (marks[i].__isFold) {
11391
+ if (!allowFolded) return null;
11392
+ range.cleared = true;
11393
+ marks[i].clear();
11394
+ }
11395
+ }
11396
+ return range;
11397
+ }
11398
+
11399
+ var range = getRange(true);
11400
+ if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
11401
+ pos = CodeMirror.Pos(pos.line - 1, 0);
11402
+ range = getRange(false);
11403
+ }
11404
+ if (!range || range.cleared || force === "unfold") return;
11405
+
11406
+ var myWidget = makeWidget(cm, options, range);
11407
+ CodeMirror.on(myWidget, "mousedown", function(e) {
11408
+ myRange.clear();
11409
+ CodeMirror.e_preventDefault(e);
11410
+ });
11411
+ var myRange = cm.markText(range.from, range.to, {
11412
+ replacedWith: myWidget,
11413
+ clearOnEnter: getOption(cm, options, "clearOnEnter"),
11414
+ __isFold: true
11415
+ });
11416
+ myRange.on("clear", function(from, to) {
11417
+ CodeMirror.signal(cm, "unfold", cm, from, to);
11418
+ });
11419
+ CodeMirror.signal(cm, "fold", cm, range.from, range.to);
11420
+ }
11421
+
11422
+ function makeWidget(cm, options, range) {
11423
+ var widget = getOption(cm, options, "widget");
11424
+
11425
+ if (typeof widget == "function") {
11426
+ widget = widget(range.from, range.to);
11427
+ }
11428
+
11429
+ if (typeof widget == "string") {
11430
+ var text = document.createTextNode(widget);
11431
+ widget = document.createElement("span");
11432
+ widget.appendChild(text);
11433
+ widget.className = "CodeMirror-foldmarker";
11434
+ } else if (widget) {
11435
+ widget = widget.cloneNode(true);
11436
+ }
11437
+ return widget;
11438
+ }
11439
+
11440
+ // Clumsy backwards-compatible interface
11441
+ CodeMirror.newFoldFunction = function(rangeFinder, widget) {
11442
+ return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
11443
+ };
11444
+
11445
+ // New-style interface
11446
+ CodeMirror.defineExtension("foldCode", function(pos, options, force) {
11447
+ doFold(this, pos, options, force);
11448
+ });
11449
+
11450
+ CodeMirror.defineExtension("isFolded", function(pos) {
11451
+ var marks = this.findMarksAt(pos);
11452
+ for (var i = 0; i < marks.length; ++i)
11453
+ if (marks[i].__isFold) return true;
11454
+ });
11455
+
11456
+ CodeMirror.commands.toggleFold = function(cm) {
11457
+ cm.foldCode(cm.getCursor());
11458
+ };
11459
+ CodeMirror.commands.fold = function(cm) {
11460
+ cm.foldCode(cm.getCursor(), null, "fold");
11461
+ };
11462
+ CodeMirror.commands.unfold = function(cm) {
11463
+ cm.foldCode(cm.getCursor(), { scanUp: false }, "unfold");
11464
+ };
11465
+ CodeMirror.commands.foldAll = function(cm) {
11466
+ cm.operation(function() {
11467
+ for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
11468
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "fold");
11469
+ });
11470
+ };
11471
+ CodeMirror.commands.unfoldAll = function(cm) {
11472
+ cm.operation(function() {
11473
+ for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
11474
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "unfold");
11475
+ });
11476
+ };
11477
+
11478
+ CodeMirror.registerHelper("fold", "combine", function() {
11479
+ var funcs = Array.prototype.slice.call(arguments, 0);
11480
+ return function(cm, start) {
11481
+ for (var i = 0; i < funcs.length; ++i) {
11482
+ var found = funcs[i](cm, start);
11483
+ if (found) return found;
11484
+ }
11485
+ };
11486
+ });
11487
+
11488
+ CodeMirror.registerHelper("fold", "auto", function(cm, start) {
11489
+ var helpers = cm.getHelpers(start, "fold");
11490
+ for (var i = 0; i < helpers.length; i++) {
11491
+ var cur = helpers[i](cm, start);
11492
+ if (cur) return cur;
11493
+ }
11494
+ });
11495
+
11496
+ var defaultOptions = {
11497
+ rangeFinder: CodeMirror.fold.auto,
11498
+ widget: "\u2194",
11499
+ minFoldSize: 0,
11500
+ scanUp: false,
11501
+ clearOnEnter: true
11502
+ };
11503
+
11504
+ CodeMirror.defineOption("foldOptions", null);
11505
+
11506
+ function getOption(cm, options, name) {
11507
+ if (options && options[name] !== undefined)
11508
+ return options[name];
11509
+ var editorOptions = cm.options.foldOptions;
11510
+ if (editorOptions && editorOptions[name] !== undefined)
11511
+ return editorOptions[name];
11512
+ return defaultOptions[name];
11513
+ }
11514
+
11515
+ CodeMirror.defineExtension("foldOption", function(options, name) {
11516
+ return getOption(this, options, name);
11517
+ });
11518
+ });
11519
+ });
11520
+
11521
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11522
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11523
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
11524
+
11525
+ (function(mod) {
11526
+ mod(codemirror, foldcode);
11527
+ })(function(CodeMirror) {
11528
+
11529
+ CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
11530
+ if (old && old != CodeMirror.Init) {
11531
+ cm.clearGutter(cm.state.foldGutter.options.gutter);
11532
+ cm.state.foldGutter = null;
11533
+ cm.off("gutterClick", onGutterClick);
11534
+ cm.off("changes", onChange);
11535
+ cm.off("viewportChange", onViewportChange);
11536
+ cm.off("fold", onFold);
11537
+ cm.off("unfold", onFold);
11538
+ cm.off("swapDoc", onChange);
11539
+ }
11540
+ if (val) {
11541
+ cm.state.foldGutter = new State(parseOptions(val));
11542
+ updateInViewport(cm);
11543
+ cm.on("gutterClick", onGutterClick);
11544
+ cm.on("changes", onChange);
11545
+ cm.on("viewportChange", onViewportChange);
11546
+ cm.on("fold", onFold);
11547
+ cm.on("unfold", onFold);
11548
+ cm.on("swapDoc", onChange);
11549
+ }
11550
+ });
11551
+
11552
+ var Pos = CodeMirror.Pos;
11553
+
11554
+ function State(options) {
11555
+ this.options = options;
11556
+ this.from = this.to = 0;
11557
+ }
11558
+
11559
+ function parseOptions(opts) {
11560
+ if (opts === true) opts = {};
11561
+ if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
11562
+ if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
11563
+ if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
11564
+ return opts;
11565
+ }
11566
+
11567
+ function isFolded(cm, line) {
11568
+ var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
11569
+ for (var i = 0; i < marks.length; ++i) {
11570
+ if (marks[i].__isFold) {
11571
+ var fromPos = marks[i].find(-1);
11572
+ if (fromPos && fromPos.line === line)
11573
+ return marks[i];
11574
+ }
11575
+ }
11576
+ }
11577
+
11578
+ function marker(spec) {
11579
+ if (typeof spec == "string") {
11580
+ var elt = document.createElement("div");
11581
+ elt.className = spec + " CodeMirror-guttermarker-subtle";
11582
+ return elt;
11583
+ } else {
11584
+ return spec.cloneNode(true);
11585
+ }
11586
+ }
11587
+
11588
+ function updateFoldInfo(cm, from, to) {
11589
+ var opts = cm.state.foldGutter.options, cur = from - 1;
11590
+ var minSize = cm.foldOption(opts, "minFoldSize");
11591
+ var func = cm.foldOption(opts, "rangeFinder");
11592
+ // we can reuse the built-in indicator element if its className matches the new state
11593
+ var clsFolded = typeof opts.indicatorFolded == "string" && classTest(opts.indicatorFolded);
11594
+ var clsOpen = typeof opts.indicatorOpen == "string" && classTest(opts.indicatorOpen);
11595
+ cm.eachLine(from, to, function(line) {
11596
+ ++cur;
11597
+ var mark = null;
11598
+ var old = line.gutterMarkers;
11599
+ if (old) old = old[opts.gutter];
11600
+ if (isFolded(cm, cur)) {
11601
+ if (clsFolded && old && clsFolded.test(old.className)) return;
11602
+ mark = marker(opts.indicatorFolded);
11603
+ } else {
11604
+ var pos = Pos(cur, 0);
11605
+ var range = func && func(cm, pos);
11606
+ if (range && range.to.line - range.from.line >= minSize) {
11607
+ if (clsOpen && old && clsOpen.test(old.className)) return;
11608
+ mark = marker(opts.indicatorOpen);
11609
+ }
11610
+ }
11611
+ if (!mark && !old) return;
11612
+ cm.setGutterMarker(line, opts.gutter, mark);
11613
+ });
11614
+ }
11615
+
11616
+ // copied from CodeMirror/src/util/dom.js
11617
+ function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
11618
+
11619
+ function updateInViewport(cm) {
11620
+ var vp = cm.getViewport(), state = cm.state.foldGutter;
11621
+ if (!state) return;
11622
+ cm.operation(function() {
11623
+ updateFoldInfo(cm, vp.from, vp.to);
11624
+ });
11625
+ state.from = vp.from; state.to = vp.to;
11626
+ }
11627
+
11628
+ function onGutterClick(cm, line, gutter) {
11629
+ var state = cm.state.foldGutter;
11630
+ if (!state) return;
11631
+ var opts = state.options;
11632
+ if (gutter != opts.gutter) return;
11633
+ var folded = isFolded(cm, line);
11634
+ if (folded) folded.clear();
11635
+ else cm.foldCode(Pos(line, 0), opts);
11636
+ }
11637
+
11638
+ function onChange(cm) {
11639
+ var state = cm.state.foldGutter;
11640
+ if (!state) return;
11641
+ var opts = state.options;
11642
+ state.from = state.to = 0;
11643
+ clearTimeout(state.changeUpdate);
11644
+ state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
11645
+ }
11646
+
11647
+ function onViewportChange(cm) {
11648
+ var state = cm.state.foldGutter;
11649
+ if (!state) return;
11650
+ var opts = state.options;
11651
+ clearTimeout(state.changeUpdate);
11652
+ state.changeUpdate = setTimeout(function() {
11653
+ var vp = cm.getViewport();
11654
+ if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
11655
+ updateInViewport(cm);
11656
+ } else {
11657
+ cm.operation(function() {
11658
+ if (vp.from < state.from) {
11659
+ updateFoldInfo(cm, vp.from, state.from);
11660
+ state.from = vp.from;
11661
+ }
11662
+ if (vp.to > state.to) {
11663
+ updateFoldInfo(cm, state.to, vp.to);
11664
+ state.to = vp.to;
11665
+ }
11666
+ });
11667
+ }
11668
+ }, opts.updateViewportTimeSpan || 400);
11669
+ }
11670
+
11671
+ function onFold(cm, from) {
11672
+ var state = cm.state.foldGutter;
11673
+ if (!state) return;
11674
+ var line = from.line;
11675
+ if (line >= state.from && line < state.to)
11676
+ updateFoldInfo(cm, line, line + 1);
11677
+ }
11678
+ });
11679
+ });
11680
+
11681
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11682
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11683
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
11684
+
11685
+ (function(mod) {
11686
+ mod(codemirror);
11687
+ })(function(CodeMirror) {
11688
+
11689
+ function bracketFolding(pairs) {
11690
+ return function(cm, start) {
11691
+ var line = start.line, lineText = cm.getLine(line);
11692
+
11693
+ function findOpening(pair) {
11694
+ var tokenType;
11695
+ for (var at = start.ch, pass = 0;;) {
11696
+ var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1);
11697
+ if (found == -1) {
11698
+ if (pass == 1) break;
11699
+ pass = 1;
11700
+ at = lineText.length;
11701
+ continue;
11702
+ }
11703
+ if (pass == 1 && found < start.ch) break;
11704
+ tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
11705
+ if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType, pair: pair};
11706
+ at = found - 1;
11707
+ }
11708
+ }
11709
+
11710
+ function findRange(found) {
11711
+ var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh;
11712
+ outer: for (var i = line; i <= lastLine; ++i) {
11713
+ var text = cm.getLine(i), pos = i == line ? startCh : 0;
11714
+ for (;;) {
11715
+ var nextOpen = text.indexOf(found.pair[0], pos), nextClose = text.indexOf(found.pair[1], pos);
11716
+ if (nextOpen < 0) nextOpen = text.length;
11717
+ if (nextClose < 0) nextClose = text.length;
11718
+ pos = Math.min(nextOpen, nextClose);
11719
+ if (pos == text.length) break;
11720
+ if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) {
11721
+ if (pos == nextOpen) ++count;
11722
+ else if (!--count) { end = i; endCh = pos; break outer; }
11723
+ }
11724
+ ++pos;
11725
+ }
11726
+ }
11727
+
11728
+ if (end == null || line == end) return null
11729
+ return {from: CodeMirror.Pos(line, startCh),
11730
+ to: CodeMirror.Pos(end, endCh)};
11731
+ }
11732
+
11733
+ var found = [];
11734
+ for (var i = 0; i < pairs.length; i++) {
11735
+ var open = findOpening(pairs[i]);
11736
+ if (open) found.push(open);
11737
+ }
11738
+ found.sort(function(a, b) { return a.ch - b.ch });
11739
+ for (var i = 0; i < found.length; i++) {
11740
+ var range = findRange(found[i]);
11741
+ if (range) return range
11742
+ }
11743
+ return null
11744
+ }
11745
+ }
11746
+
11747
+ CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]]));
11748
+
11749
+ CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]]));
11750
+
11751
+ CodeMirror.registerHelper("fold", "import", function(cm, start) {
11752
+ function hasImport(line) {
11753
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
11754
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
11755
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
11756
+ if (start.type != "keyword" || start.string != "import") return null;
11757
+ // Now find closing semicolon, return its position
11758
+ for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
11759
+ var text = cm.getLine(i), semi = text.indexOf(";");
11760
+ if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
11761
+ }
11762
+ }
11763
+
11764
+ var startLine = start.line, has = hasImport(startLine), prev;
11765
+ if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
11766
+ return null;
11767
+ for (var end = has.end;;) {
11768
+ var next = hasImport(end.line + 1);
11769
+ if (next == null) break;
11770
+ end = next.end;
11771
+ }
11772
+ return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
11773
+ });
11774
+
11775
+ CodeMirror.registerHelper("fold", "include", function(cm, start) {
11776
+ function hasInclude(line) {
11777
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
11778
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
11779
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
11780
+ if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
11781
+ }
11782
+
11783
+ var startLine = start.line, has = hasInclude(startLine);
11784
+ if (has == null || hasInclude(startLine - 1) != null) return null;
11785
+ for (var end = startLine;;) {
11786
+ var next = hasInclude(end + 1);
11787
+ if (next == null) break;
11788
+ ++end;
11789
+ }
11790
+ return {from: CodeMirror.Pos(startLine, has + 1),
11791
+ to: cm.clipPos(CodeMirror.Pos(end))};
11792
+ });
11793
+
11794
+ });
11795
+ });
11796
+
11797
+ var jsonlint_1 = _commonjsHelpers.createCommonjsModule(function (module) {
11798
+ var jsonlint = (function(){var require=true,module=false;var exports={};/*
11799
+ json_parse.js
11800
+ 2016-05-02
11801
+
11802
+ Public Domain.
11803
+
11804
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
11805
+
11806
+ This file creates a json_parse function.
11807
+
11808
+ json_parse(text, reviver)
11809
+ This method parses a JSON text to produce an object or array.
11810
+ It can throw a SyntaxError exception.
11811
+
11812
+ The optional reviver parameter is a function that can filter and
11813
+ transform the results. It receives each of the keys and values,
11814
+ and its return value is used instead of the original value.
11815
+ If it returns what it received, then the structure is not modified.
11816
+ If it returns undefined then the member is deleted.
11817
+
11818
+ Example:
11819
+
11820
+ // Parse the text. Values that look like ISO date strings will
11821
+ // be converted to Date objects.
11822
+
11823
+ myData = json_parse(text, function (key, value) {
11824
+ var a;
11825
+ if (typeof value === "string") {
11826
+ a =
11827
+ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
11828
+ if (a) {
11829
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
11830
+ +a[5], +a[6]));
11831
+ }
11832
+ }
11833
+ return value;
11834
+ });
11835
+
11836
+ This is a reference implementation. You are free to copy, modify, or
11837
+ redistribute.
11838
+
11839
+ This code should be minified before deployment.
11840
+ See http://javascript.crockford.com/jsmin.html
11841
+
11842
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
11843
+ NOT CONTROL.
11844
+ */
11845
+
11846
+ /*jslint for */
11847
+
11848
+ /*property
11849
+ at, b, call, charAt, f, fromCharCode, hasOwnProperty, message, n, name,
11850
+ prototype, push, r, t, text
11851
+ */
11852
+
11853
+ var ___dougJSONParse = (function () {
11854
+
11855
+ // This is a function that can parse a JSON text, producing a JavaScript
11856
+ // data structure. It is a simple, recursive descent parser. It does not use
11857
+ // eval or regular expressions, so it can be used as a model for implementing
11858
+ // a JSON parser in other languages.
11859
+
11860
+ // We are defining the function inside of another function to avoid creating
11861
+ // global variables.
11862
+
11863
+ var at; // The index of the current character
11864
+ var ch; // The current character
11865
+ var escapee = {
11866
+ "\"": "\"",
11867
+ "\\": "\\",
11868
+ "/": "/",
11869
+ b: "\b",
11870
+ f: "\f",
11871
+ n: "\n",
11872
+ r: "\r",
11873
+ t: "\t"
11874
+ };
11875
+ var text;
11876
+
11877
+ var error = function (m) {
11878
+
11879
+ // Call error when something is wrong.
11880
+
11881
+ throw {
11882
+ name: "SyntaxError",
11883
+ message: m,
11884
+ at: at,
11885
+ text: text
11886
+ };
11887
+ };
11888
+
11889
+ var next = function (c) {
11890
+
11891
+ // If a c parameter is provided, verify that it matches the current character.
11892
+
11893
+ if (c && c !== ch) {
11894
+ error("Expected '" + c + "' instead of '" + ch + "'");
11895
+ }
11896
+
11897
+ // Get the next character. When there are no more characters,
11898
+ // return the empty string.
11899
+
11900
+ ch = text.charAt(at);
11901
+ at += 1;
11902
+ return ch;
11903
+ };
11904
+
11905
+ var number = function () {
11906
+
11907
+ // Parse a number value.
11908
+
11909
+ var value;
11910
+ var string = "";
11911
+
11912
+ if (ch === "-") {
11913
+ string = "-";
11914
+ next("-");
11915
+ }
11916
+ while (ch >= "0" && ch <= "9") {
11917
+ string += ch;
11918
+ next();
11919
+ }
11920
+ if (ch === ".") {
11921
+ string += ".";
11922
+ while (next() && ch >= "0" && ch <= "9") {
11923
+ string += ch;
11924
+ }
11925
+ }
11926
+ if (ch === "e" || ch === "E") {
11927
+ string += ch;
11928
+ next();
11929
+ if (ch === "-" || ch === "+") {
11930
+ string += ch;
11931
+ next();
11932
+ }
11933
+ while (ch >= "0" && ch <= "9") {
11934
+ string += ch;
11935
+ next();
11936
+ }
11937
+ }
11938
+ value = +string;
11939
+ if (!isFinite(value)) {
11940
+ error("Bad number");
11941
+ } else {
11942
+ return value;
11943
+ }
11944
+ };
11945
+
11946
+ var string = function () {
11947
+
11948
+ // Parse a string value.
11949
+
11950
+ var hex;
11951
+ var i;
11952
+ var value = "";
11953
+ var uffff;
11954
+
11955
+ // When parsing for string values, we must look for " and \ characters.
11956
+
11957
+ if (ch === "\"") {
11958
+ while (next()) {
11959
+ if (ch === "\"") {
11960
+ next();
11961
+ return value;
11962
+ }
11963
+ if (ch === "\\") {
11964
+ next();
11965
+ if (ch === "u") {
11966
+ uffff = 0;
11967
+ for (i = 0; i < 4; i += 1) {
11968
+ hex = parseInt(next(), 16);
11969
+ if (!isFinite(hex)) {
11970
+ break;
11971
+ }
11972
+ uffff = uffff * 16 + hex;
11973
+ }
11974
+ value += String.fromCharCode(uffff);
11975
+ } else if (typeof escapee[ch] === "string") {
11976
+ value += escapee[ch];
11977
+ } else {
11978
+ break;
11979
+ }
11980
+ } else {
11981
+ value += ch;
11982
+ }
11983
+ }
11984
+ }
11985
+ error("Bad string");
11986
+ };
11987
+
11988
+ var white = function () {
11989
+
11990
+ // Skip whitespace.
11991
+
11992
+ while (ch && ch <= " ") {
11993
+ next();
11994
+ }
11995
+ };
11996
+
11997
+ var word = function () {
11998
+
11999
+ // true, false, or null.
12000
+
12001
+ switch (ch) {
12002
+ case "t":
12003
+ next("t");
12004
+ next("r");
12005
+ next("u");
12006
+ next("e");
12007
+ return true;
12008
+ case "f":
12009
+ next("f");
12010
+ next("a");
12011
+ next("l");
12012
+ next("s");
12013
+ next("e");
12014
+ return false;
12015
+ case "n":
12016
+ next("n");
12017
+ next("u");
12018
+ next("l");
12019
+ next("l");
12020
+ return null;
12021
+ }
12022
+ error("Unexpected '" + ch + "'");
12023
+ };
12024
+
12025
+ var value; // Place holder for the value function.
12026
+
12027
+ var array = function () {
12028
+
12029
+ // Parse an array value.
12030
+
12031
+ var arr = [];
12032
+
12033
+ if (ch === "[") {
12034
+ next("[");
12035
+ white();
12036
+ if (ch === "]") {
12037
+ next("]");
12038
+ return arr; // empty array
12039
+ }
12040
+ while (ch) {
12041
+ arr.push(value());
12042
+ white();
12043
+ if (ch === "]") {
12044
+ next("]");
12045
+ return arr;
12046
+ }
12047
+ next(",");
12048
+ white();
12049
+ }
12050
+ }
12051
+ error("Bad array");
12052
+ };
12053
+
12054
+ var object = function () {
12055
+
12056
+ // Parse an object value.
12057
+
12058
+ var key;
12059
+ var obj = {};
12060
+
12061
+ if (ch === "{") {
12062
+ next("{");
12063
+ white();
12064
+ if (ch === "}") {
12065
+ next("}");
12066
+ return obj; // empty object
12067
+ }
12068
+ while (ch) {
12069
+ key = string();
12070
+ white();
12071
+ next(":");
12072
+ if (Object.hasOwnProperty.call(obj, key)) {
12073
+ error("Duplicate key '" + key + "'");
12074
+ }
12075
+ obj[key] = value();
12076
+ white();
12077
+ if (ch === "}") {
12078
+ next("}");
12079
+ return obj;
12080
+ }
12081
+ next(",");
12082
+ white();
12083
+ }
12084
+ }
12085
+ error("Bad object");
12086
+ };
12087
+
12088
+ value = function () {
12089
+
12090
+ // Parse a JSON value. It could be an object, an array, a string, a number,
12091
+ // or a word.
12092
+
12093
+ white();
12094
+ switch (ch) {
12095
+ case "{":
12096
+ return object();
12097
+ case "[":
12098
+ return array();
12099
+ case "\"":
12100
+ return string();
12101
+ case "-":
12102
+ return number();
12103
+ default:
12104
+ return (ch >= "0" && ch <= "9")
12105
+ ? number()
12106
+ : word();
12107
+ }
12108
+ };
12109
+
12110
+ // Return the json_parse function. It will have access to all of the above
12111
+ // functions and variables.
12112
+
12113
+ return function (source, reviver) {
12114
+ var result;
12115
+
12116
+ text = source;
12117
+ at = 0;
12118
+ ch = " ";
12119
+ result = value();
12120
+ white();
12121
+ if (ch) {
12122
+ error("Syntax error");
12123
+ }
12124
+
12125
+ // If there is a reviver function, we recursively walk the new structure,
12126
+ // passing each name/value pair to the reviver function for possible
12127
+ // transformation, starting with a temporary root object that holds the result
12128
+ // in an empty key. If there is not a reviver function, we simply return the
12129
+ // result.
12130
+
12131
+ return (typeof reviver === "function")
12132
+ ? (function walk(holder, key) {
12133
+ var k;
12134
+ var v;
12135
+ var val = holder[key];
12136
+ if (val && typeof val === "object") {
12137
+ for (k in val) {
12138
+ if (Object.prototype.hasOwnProperty.call(val, k)) {
12139
+ v = walk(val, k);
12140
+ if (v !== undefined) {
12141
+ val[k] = v;
12142
+ } else {
12143
+ delete val[k];
12144
+ }
12145
+ }
12146
+ }
12147
+ }
12148
+ return reviver.call(holder, key, val);
12149
+ }({"": result}, ""))
12150
+ : result;
12151
+ };
12152
+ }());
12153
+ /* Jison generated parser */
12154
+ var jsonlint = (function(){
12155
+ var parser = {trace: function trace() { },
12156
+ yy: {},
12157
+ symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
12158
+ terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
12159
+ productions_: [0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],
12160
+ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
12161
+
12162
+ var $0 = $$.length - 1;
12163
+ switch (yystate) {
12164
+ case 1: // replace escaped characters with actual character
12165
+ this.$ = yytext.replace(/\\(\\|")/g, "$"+"1")
12166
+ .replace(/\\n/g,'\n')
12167
+ .replace(/\\r/g,'\r')
12168
+ .replace(/\\t/g,'\t')
12169
+ .replace(/\\v/g,'\v')
12170
+ .replace(/\\f/g,'\f')
12171
+ .replace(/\\b/g,'\b');
12172
+
12173
+ break;
12174
+ case 2:this.$ = Number(yytext);
12175
+ break;
12176
+ case 3:this.$ = null;
12177
+ break;
12178
+ case 4:this.$ = true;
12179
+ break;
12180
+ case 5:this.$ = false;
12181
+ break;
12182
+ case 6:return this.$ = $$[$0-1];
12183
+ case 13:this.$ = {};
12184
+ break;
12185
+ case 14:this.$ = $$[$0-1];
12186
+ break;
12187
+ case 15:this.$ = [$$[$0-2], $$[$0]];
12188
+ break;
12189
+ case 16:this.$ = {}; this.$[$$[$0][0]] = $$[$0][1];
12190
+ break;
12191
+ case 17:this.$ = $$[$0-2]; $$[$0-2][$$[$0][0]] = $$[$0][1];
12192
+ break;
12193
+ case 18:this.$ = [];
12194
+ break;
12195
+ case 19:this.$ = $$[$0-1];
12196
+ break;
12197
+ case 20:this.$ = [$$[$0]];
12198
+ break;
12199
+ case 21:this.$ = $$[$0-2]; $$[$0-2].push($$[$0]);
12200
+ break;
12201
+ }
12202
+ },
12203
+ table: [{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],
12204
+ defaultActions: {16:[2,6]},
12205
+ parseError: function parseError(str, hash) {
12206
+ throw new Error(str);
12207
+ },
12208
+ parse: function parse(input) {
12209
+ var self = this,
12210
+ stack = [0],
12211
+ vstack = [null], // semantic value stack
12212
+ lstack = [], // location stack
12213
+ table = this.table,
12214
+ yytext = '',
12215
+ yylineno = 0,
12216
+ yyleng = 0,
12217
+ recovering = 0,
12218
+ TERROR = 2,
12219
+ EOF = 1;
12220
+
12221
+ //this.reductionCount = this.shiftCount = 0;
12222
+
12223
+ this.lexer.setInput(input);
12224
+ this.lexer.yy = this.yy;
12225
+ this.yy.lexer = this.lexer;
12226
+ if (typeof this.lexer.yylloc == 'undefined')
12227
+ this.lexer.yylloc = {};
12228
+ var yyloc = this.lexer.yylloc;
12229
+ lstack.push(yyloc);
12230
+
12231
+ if (typeof this.yy.parseError === 'function')
12232
+ this.parseError = this.yy.parseError;
12233
+
12234
+ function popStack (n) {
12235
+ stack.length = stack.length - 2*n;
12236
+ vstack.length = vstack.length - n;
12237
+ lstack.length = lstack.length - n;
12238
+ }
12239
+
12240
+ function lex() {
12241
+ var token;
12242
+ token = self.lexer.lex() || 1; // $end = 1
12243
+ // if token isn't its numeric value, convert
12244
+ if (typeof token !== 'number') {
12245
+ token = self.symbols_[token] || token;
12246
+ }
12247
+ return token;
12248
+ }
12249
+
12250
+ var symbol, preErrorSymbol, state, action, r, yyval={},p,len,newState, expected;
12251
+ while (true) {
12252
+ // retreive state number from top of stack
12253
+ state = stack[stack.length-1];
12254
+
12255
+ // use default actions if available
12256
+ if (this.defaultActions[state]) {
12257
+ action = this.defaultActions[state];
12258
+ } else {
12259
+ if (symbol == null)
12260
+ symbol = lex();
12261
+ // read action for current state and first input
12262
+ action = table[state] && table[state][symbol];
12263
+ }
12264
+
12265
+ // handle parse error
12266
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
12267
+
12268
+ if (!recovering) {
12269
+ // Report error
12270
+ expected = [];
12271
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
12272
+ expected.push("'"+this.terminals_[p]+"'");
12273
+ }
12274
+ var errStr = '';
12275
+ if (this.lexer.showPosition) {
12276
+ errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
12277
+ } else {
12278
+ errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
12279
+ (symbol == 1 /*EOF*/ ? "end of input" :
12280
+ ("'"+(this.terminals_[symbol] || symbol)+"'"));
12281
+ }
12282
+ this.parseError(errStr,
12283
+ {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
12284
+ }
12285
+
12286
+ // just recovered from another error
12287
+ if (recovering == 3) {
12288
+ if (symbol == EOF) {
12289
+ throw new Error(errStr || 'Parsing halted.');
12290
+ }
12291
+
12292
+ // discard current lookahead and grab another
12293
+ yyleng = this.lexer.yyleng;
12294
+ yytext = this.lexer.yytext;
12295
+ yylineno = this.lexer.yylineno;
12296
+ yyloc = this.lexer.yylloc;
12297
+ symbol = lex();
12298
+ }
12299
+
12300
+ // try to recover from error
12301
+ while (1) {
12302
+ // check for error recovery rule in this state
12303
+ if ((TERROR.toString()) in table[state]) {
12304
+ break;
12305
+ }
12306
+ if (state == 0) {
12307
+ throw new Error(errStr || 'Parsing halted.');
12308
+ }
12309
+ popStack(1);
12310
+ state = stack[stack.length-1];
12311
+ }
12312
+
12313
+ preErrorSymbol = symbol; // save the lookahead token
12314
+ symbol = TERROR; // insert generic error symbol as new lookahead
12315
+ state = stack[stack.length-1];
12316
+ action = table[state] && table[state][TERROR];
12317
+ recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
12318
+ }
12319
+
12320
+ // this shouldn't happen, unless resolve defaults are off
12321
+ if (action[0] instanceof Array && action.length > 1) {
12322
+ throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
12323
+ }
12324
+
12325
+ switch (action[0]) {
12326
+
12327
+ case 1: // shift
12328
+ //this.shiftCount++;
12329
+
12330
+ stack.push(symbol);
12331
+ vstack.push(this.lexer.yytext);
12332
+ lstack.push(this.lexer.yylloc);
12333
+ stack.push(action[1]); // push state
12334
+ symbol = null;
12335
+ if (!preErrorSymbol) { // normal execution/no error
12336
+ yyleng = this.lexer.yyleng;
12337
+ yytext = this.lexer.yytext;
12338
+ yylineno = this.lexer.yylineno;
12339
+ yyloc = this.lexer.yylloc;
12340
+ if (recovering > 0)
12341
+ recovering--;
12342
+ } else { // error just occurred, resume old lookahead f/ before error
12343
+ symbol = preErrorSymbol;
12344
+ preErrorSymbol = null;
12345
+ }
12346
+ break;
12347
+
12348
+ case 2: // reduce
12349
+ //this.reductionCount++;
12350
+
12351
+ len = this.productions_[action[1]][1];
12352
+
12353
+ // perform semantic action
12354
+ yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
12355
+ // default location, uses first token for firsts, last for lasts
12356
+ yyval._$ = {
12357
+ first_line: lstack[lstack.length-(len||1)].first_line,
12358
+ last_line: lstack[lstack.length-1].last_line,
12359
+ first_column: lstack[lstack.length-(len||1)].first_column,
12360
+ last_column: lstack[lstack.length-1].last_column
12361
+ };
12362
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
12363
+
12364
+ if (typeof r !== 'undefined') {
12365
+ return r;
12366
+ }
12367
+
12368
+ // pop off stack
12369
+ if (len) {
12370
+ stack = stack.slice(0,-1*len*2);
12371
+ vstack = vstack.slice(0, -1*len);
12372
+ lstack = lstack.slice(0, -1*len);
12373
+ }
12374
+
12375
+ stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
12376
+ vstack.push(yyval.$);
12377
+ lstack.push(yyval._$);
12378
+ // goto new state = table[STATE][NONTERMINAL]
12379
+ newState = table[stack[stack.length-2]][stack[stack.length-1]];
12380
+ stack.push(newState);
12381
+ break;
12382
+
12383
+ case 3: // accept
12384
+ return true;
12385
+ }
12386
+
12387
+ }
12388
+
12389
+ return true;
12390
+ }};
12391
+ /* Jison generated lexer */
12392
+ var lexer = (function(){
12393
+ var lexer = ({EOF:1,
12394
+ parseError:function parseError(str, hash) {
12395
+ if (this.yy.parseError) {
12396
+ this.yy.parseError(str, hash);
12397
+ } else {
12398
+ throw new Error(str);
12399
+ }
12400
+ },
12401
+ setInput:function (input) {
12402
+ this._input = input;
12403
+ this._more = this._less = this.done = false;
12404
+ this.yylineno = this.yyleng = 0;
12405
+ this.yytext = this.matched = this.match = '';
12406
+ this.conditionStack = ['INITIAL'];
12407
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
12408
+ return this;
12409
+ },
12410
+ input:function () {
12411
+ var ch = this._input[0];
12412
+ this.yytext+=ch;
12413
+ this.yyleng++;
12414
+ this.match+=ch;
12415
+ this.matched+=ch;
12416
+ var lines = ch.match(/\n/);
12417
+ if (lines) this.yylineno++;
12418
+ this._input = this._input.slice(1);
12419
+ return ch;
12420
+ },
12421
+ unput:function (ch) {
12422
+ this._input = ch + this._input;
12423
+ return this;
12424
+ },
12425
+ more:function () {
12426
+ this._more = true;
12427
+ return this;
12428
+ },
12429
+ less:function (n) {
12430
+ this._input = this.match.slice(n) + this._input;
12431
+ },
12432
+ pastInput:function () {
12433
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
12434
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
12435
+ },
12436
+ upcomingInput:function () {
12437
+ var next = this.match;
12438
+ if (next.length < 20) {
12439
+ next += this._input.substr(0, 20-next.length);
12440
+ }
12441
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
12442
+ },
12443
+ showPosition:function () {
12444
+ var pre = this.pastInput();
12445
+ var c = new Array(pre.length + 1).join("-");
12446
+ return pre + this.upcomingInput() + "\n" + c+"^";
12447
+ },
12448
+ next:function () {
12449
+ if (this.done) {
12450
+ return this.EOF;
12451
+ }
12452
+ if (!this._input) this.done = true;
12453
+
12454
+ var token,
12455
+ match,
12456
+ tempMatch,
12457
+ index,
12458
+ lines;
12459
+ if (!this._more) {
12460
+ this.yytext = '';
12461
+ this.match = '';
12462
+ }
12463
+ var rules = this._currentRules();
12464
+ for (var i=0;i < rules.length; i++) {
12465
+ tempMatch = this._input.match(this.rules[rules[i]]);
12466
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
12467
+ match = tempMatch;
12468
+ index = i;
12469
+ if (!this.options.flex) break;
12470
+ }
12471
+ }
12472
+ if (match) {
12473
+ lines = match[0].match(/\n.*/g);
12474
+ if (lines) this.yylineno += lines.length;
12475
+ this.yylloc = {first_line: this.yylloc.last_line,
12476
+ last_line: this.yylineno+1,
12477
+ first_column: this.yylloc.last_column,
12478
+ last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};
12479
+ this.yytext += match[0];
12480
+ this.match += match[0];
12481
+ this.yyleng = this.yytext.length;
12482
+ this._more = false;
12483
+ this._input = this._input.slice(match[0].length);
12484
+ this.matched += match[0];
12485
+ token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
12486
+ if (this.done && this._input) this.done = false;
12487
+ if (token) return token;
12488
+ else return;
12489
+ }
12490
+ if (this._input === "") {
12491
+ return this.EOF;
12492
+ } else {
12493
+ this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
12494
+ {text: "", token: null, line: this.yylineno});
12495
+ }
12496
+ },
12497
+ lex:function lex() {
12498
+ var r = this.next();
12499
+ if (typeof r !== 'undefined') {
12500
+ return r;
12501
+ } else {
12502
+ return this.lex();
12503
+ }
12504
+ },
12505
+ begin:function begin(condition) {
12506
+ this.conditionStack.push(condition);
12507
+ },
12508
+ popState:function popState() {
12509
+ return this.conditionStack.pop();
12510
+ },
12511
+ _currentRules:function _currentRules() {
12512
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
12513
+ },
12514
+ topState:function () {
12515
+ return this.conditionStack[this.conditionStack.length-2];
12516
+ },
12517
+ pushState:function begin(condition) {
12518
+ this.begin(condition);
12519
+ }});
12520
+ lexer.options = {};
12521
+ lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
12522
+ switch($avoiding_name_collisions) {
12523
+ case 0:/* skip whitespace */
12524
+ break;
12525
+ case 1:return 6
12526
+ case 2:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 4
12527
+ case 3:return 17
12528
+ case 4:return 18
12529
+ case 5:return 23
12530
+ case 6:return 24
12531
+ case 7:return 22
12532
+ case 8:return 21
12533
+ case 9:return 10
12534
+ case 10:return 11
12535
+ case 11:return 8
12536
+ case 12:return 14
12537
+ case 13:return 'INVALID'
12538
+ }
12539
+ };
12540
+ lexer.rules = [/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/];
12541
+ lexer.conditions = {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"inclusive":true}};
12542
+ return lexer;})();
12543
+ parser.lexer = lexer;
12544
+ return parser;
12545
+ })();
12546
+
12547
+ var origParse = jsonlint.parse;
12548
+
12549
+ jsonlint.parse = function(input) {
12550
+ var result = origParse.call(jsonlint, input);
12551
+ var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
12552
+ try {
12553
+ dougJSONParse(input);
12554
+ } catch(e) {
12555
+ if(/Duplicate key|Bad string|Unexpected/.test(e.message)) {
12556
+ var linesUntilError = input.substring(0, e.at).split('\n');
12557
+ var line = linesUntilError.length;
12558
+ var col = linesUntilError[line - 1].length - 1;
12559
+
12560
+ this.parseError(e.message, {line: line, col: col, message: e.message.replace(/./, function(l) { return l.toLowerCase(); })});
12561
+ throw SyntaxError(e.message + ' on line ' + line);
12562
+ }
12563
+ }
12564
+
12565
+ return result;
12566
+ };
12567
+
12568
+ if (typeof exports !== 'undefined') {
12569
+ exports.parser = jsonlint;
12570
+ exports.parse = function () { return jsonlint.parse.apply(jsonlint, arguments); };
12571
+ exports.main = function commonjsMain(args) {
12572
+ if (!args[1])
12573
+ throw new Error('Usage: '+args[0]+' FILE');
12574
+ if (typeof process !== 'undefined') {
12575
+ var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
12576
+ } else {
12577
+ var cwd = require("file").path(require("file").cwd());
12578
+ var source = cwd.join(args[1]).read({charset: "utf-8"});
12579
+ }
12580
+ return exports.parser.parse(source);
12581
+ };
12582
+ if (require.main === module) {
12583
+ exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
12584
+ }
12585
+ }
12586
+ return exports;})();if(module.exports) module.exports = jsonlint;
12587
+ });
12588
+
12589
+ const codeEditorCss = ".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.875rem)}.editor{display:flex;align-items:stretch;width:100%}.editor.is-light-mode{--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}.editor.is-light-mode .cm-attribute,.editor.is-light-mode .cm-property,.editor.is-light-mode .cm-keyword{color:rgb(var(--color-violet-light))}.editor.is-light-mode .cm-operator{color:rgb(var(--color-sky-dark))}.editor.is-light-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-light-mode .cm-variable-2{color:rgb(var(--contrast-1100))}.editor.is-light-mode .cm-variable-3,.editor.is-light-mode .cm-type{color:rgb(var(--color-amber-darker))}.editor.is-light-mode .cm-builtin,.editor.is-light-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-light-mode .cm-atom{color:rgb(var(--color-coral-default))}.editor.is-light-mode .cm-tag,.editor.is-light-mode .cm-number{color:rgb(var(--color-magenta-default))}.editor.is-light-mode .cm-def{color:rgb(var(--color-sky-default))}.editor.is-light-mode .cm-string{color:rgb(var(--color-green-dark))}.editor.is-light-mode .cm-string-2{color:rgb(var(--color-pink-default))}.editor.is-light-mode .cm-qualifier{color:rgb(var(--color-grass-default))}.editor.is-light-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-light-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}.editor.is-dark-mode{--code-editor-neutral-text-color:var(--contrast-200);--code-editor-background-color:var(--contrast-1600);--code-editor-gutter-background-color:var(--contrast-1500);--code-editor-line-number-text-color:var(--contrast-1000);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-1700)}.editor.is-dark-mode .cm-attribute,.editor.is-dark-mode .cm-property,.editor.is-dark-mode .cm-keyword{color:rgb(var(--color-purple-lighter))}.editor.is-dark-mode .cm-operator{color:rgb(var(--color-sky-lighter))}.editor.is-dark-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-dark-mode .cm-variable-2{color:rgb(var(--contrast-300))}.editor.is-dark-mode .cm-variable-3,.editor.is-dark-mode .cm-type{color:rgb(var(--color-yellow-light))}.editor.is-dark-mode .cm-builtin,.editor.is-dark-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-dark-mode .cm-atom{color:rgb(var(--color-coral-light))}.editor.is-dark-mode .cm-tag,.editor.is-dark-mode .cm-number{color:rgb(var(--color-magenta-light))}.editor.is-dark-mode .cm-def{color:rgb(var(--color-sky-light))}.editor.is-dark-mode .cm-string{color:rgb(var(--color-lime-light))}.editor.is-dark-mode .cm-string-2{color:rgb(var(--color-pink-lighter))}.editor.is-dark-mode .cm-qualifier{color:rgb(var(--color-grass-light))}.editor.is-dark-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-dark-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;box-shadow:var(--button-shadow-normal);color:transparent;text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle cx='16' cy='16' r='2'/><circle cx='26' cy='16' r='2'/><circle cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover{box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.is-dark-mode .cm-s-lime .CodeMirror-foldmarker{background-color:rgb(var(--contrast-1200))}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";
11041
12590
 
11042
12591
  const CodeEditor = class {
11043
12592
  constructor(hostRef) {
@@ -11055,6 +12604,14 @@ const CodeEditor = class {
11055
12604
  * Displays line numbers in the editor
11056
12605
  */
11057
12606
  this.lineNumbers = false;
12607
+ /**
12608
+ * Allows the user to fold code
12609
+ */
12610
+ this.fold = false;
12611
+ /**
12612
+ * Enables linting of JSON content
12613
+ */
12614
+ this.lint = false;
11058
12615
  /**
11059
12616
  * Select color scheme for the editor
11060
12617
  */
@@ -11096,16 +12653,37 @@ const CodeEditor = class {
11096
12653
  }
11097
12654
  this.editor = this.createEditor();
11098
12655
  }
12656
+ watchValue(newValue) {
12657
+ if (!this.editor) {
12658
+ return;
12659
+ }
12660
+ const currentValue = this.editor.getValue();
12661
+ if (newValue === currentValue) {
12662
+ // Circuit breaker for when the change comes from the editor itself
12663
+ // The caret position will be reset without this
12664
+ return;
12665
+ }
12666
+ this.editor.getDoc().setValue(newValue || '');
12667
+ }
11099
12668
  createEditor() {
11100
12669
  const options = this.getOptions();
11101
12670
  const editor = codemirror(this.host.shadowRoot.querySelector('.editor'), options);
11102
12671
  editor.on('change', this.handleChange);
12672
+ // Replace tab with spaces and use the actual indent setting for
12673
+ // the space count
12674
+ editor.setOption('extraKeys', {
12675
+ Tab: (codeMirror) => {
12676
+ const spaces = Array(codeMirror.getOption('indentUnit') + 1).join(' ');
12677
+ codeMirror.replaceSelection(spaces);
12678
+ },
12679
+ });
11103
12680
  return editor;
11104
12681
  }
11105
12682
  getOptions() {
11106
12683
  let mode = this.language;
11107
12684
  const TAB_SIZE = 4;
11108
12685
  let theme = 'lime light';
12686
+ const gutters = [];
11109
12687
  if (this.isDarkMode()) {
11110
12688
  theme = 'lime dark';
11111
12689
  }
@@ -11114,6 +12692,13 @@ const CodeEditor = class {
11114
12692
  name: 'application/json',
11115
12693
  json: true,
11116
12694
  };
12695
+ if (this.lint) {
12696
+ gutters.push('CodeMirror-lint-markers');
12697
+ if (!('jsonlint' in window)) {
12698
+ // eslint-disable-next-line @typescript-eslint/dot-notation
12699
+ window['jsonlint'] = jsonlint_1;
12700
+ }
12701
+ }
11117
12702
  }
11118
12703
  else if (this.language === 'typescript') {
11119
12704
  mode = {
@@ -11121,9 +12706,12 @@ const CodeEditor = class {
11121
12706
  typescript: true,
11122
12707
  };
11123
12708
  }
12709
+ if (this.fold) {
12710
+ gutters.push('CodeMirror-foldgutter');
12711
+ }
11124
12712
  return {
11125
12713
  mode: mode,
11126
- value: this.value,
12714
+ value: this.value || '',
11127
12715
  theme: theme,
11128
12716
  readOnly: this.readonly,
11129
12717
  tabSize: TAB_SIZE,
@@ -11131,6 +12719,9 @@ const CodeEditor = class {
11131
12719
  lineNumbers: this.lineNumbers,
11132
12720
  styleActiveLine: true,
11133
12721
  matchBrackets: true,
12722
+ lint: this.lint,
12723
+ foldGutter: this.fold,
12724
+ gutters: gutters,
11134
12725
  };
11135
12726
  }
11136
12727
  isDarkMode() {
@@ -11155,6 +12746,9 @@ const CodeEditor = class {
11155
12746
  return matchMedia('(prefers-color-scheme: dark)');
11156
12747
  }
11157
12748
  get host() { return index.getElement(this); }
12749
+ static get watchers() { return {
12750
+ "value": ["watchValue"]
12751
+ }; }
11158
12752
  };
11159
12753
  CodeEditor.style = codeEditorCss;
11160
12754