@werckmeister/components 1.1.6-152 → 1.1.6-153

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@werckmeister/components",
3
- "version": "1.1.6-152",
3
+ "version": "1.1.6-153",
4
4
  "description": "",
5
5
  "main": "werckmeister-components.js",
6
6
  "scripts": {
@@ -504,7 +504,7 @@ var A;parcelRequire=function(e,t,n,r){var i,o="function"==typeof parcelRequire&&
504
504
  },{"lodash":"B1iE","@werckmeister/midiplayer":"X3ym","../shared/midiEvent":"vkzS","../shared/player":"FYcy","../components/editor/EnvironmentInspector":"ksUX"}],"ooUX":[function(require,module,exports) {
505
505
  "use strict";var e=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))(function(o,i){function s(e){try{p(n.next(e))}catch(r){i(r)}}function a(e){try{p(n.throw(e))}catch(r){i(r)}}function p(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(s,a)}p((n=n.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.resetCompiler=exports.WM_Player=exports.WM_Compiler=void 0;var r=require("./compiler/Compiler"),t=require("./player/Player");function n(){return e(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:exports.WM_Compiler=new r.WerckmeisterCompiler;case 1:case"end":return e.stop()}},e)}))}exports.WM_Compiler=new r.WerckmeisterCompiler,exports.WM_Player=new t.Player,exports.resetCompiler=n;
506
506
  },{"./compiler/Compiler":"RSuL","./player/Player":"WYYH"}],"bSo5":[function(require,module,exports) {
507
- "use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function e(n,e){var t;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(t=r(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){t=n[Symbol.iterator]()},n:function(){var n=t.next();return c=n.done,n},e:function(n){s=!0,a=n},f:function(){try{c||null==t.return||t.return()}finally{if(s)throw a}}}}function r(n,e){if(n){if("string"==typeof n)return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function o(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function i(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function a(n,e,r){return e&&i(n.prototype,e),r&&i(n,r),n}function c(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e)}function s(n){var e=m();return function(){var r,t=b(n);if(e){var o=b(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return l(this,r)}}function l(e,r){return!r||"object"!==n(r)&&"function"!=typeof r?d(e):r}function d(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function u(n){var e="function"==typeof Map?new Map:void 0;return(u=function(n){if(null===n||!f(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return p(n,arguments,b(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,n)})(n)}function p(n,e,r){return(p=m()?Reflect.construct:function(n,e,r){var t=[null];t.push.apply(t,e);var o=new(Function.bind.apply(n,t));return r&&h(o,r.prototype),o}).apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function f(n){return-1!==Function.toString.call(n).indexOf("[native code]")}function h(n,e){return(h=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(n,e)}function b(n){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}var g=this&&this.__awaiter||function(n,e,r,t){return new(r||(r=Promise))(function(o,i){function a(n){try{s(t.next(n))}catch(e){i(e)}}function c(n){try{s(t.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?o(n.value):(e=n.value,e instanceof r?e:new r(function(n){n(e)})).then(a,c)}s((t=t.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=void 0;var v=require("../../editor/Editor"),y=require("@werckmeister/language-features"),M=require("../../shared/http"),w=require("../../Global"),k=require("./EnvironmentInspector"),C=require("lodash"),x=new k.EnvironmentInspector,S=require("fs"),z='#editor {\n border: 2px solid grey;\n width: 100%;\n height: 100%;\n}\n\n\n.CodeMirror {\n width: 100%;\n height: 100%;\n}\n\n#wm-snippet {\n margin-bottom: 1.5em;\n}\n\n\n.wm-marked::before {\n content: " ";\n position: absolute;\n border-top: 4px solid #ff0;\n border-left: 4px solid #ff0;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-error::before {\n content: " ";\n position: absolute;\n border-top: 4px solid red;\n border-left: 4px solid red;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-warning::before {\n content: " ";\n position: absolute;\n border-bottom: 2px dotted orange;\n width: 16px;\n height: 1em;\n margin-top: 5px;\n margin-left: -3px;\n cursor: default;\n}\n\n.wm-warning.wm-marked::before {\n display: none;\n border-bottom: none;\n height: 8px;\n width: 8px;\n margin-top: -11px;\n margin-left: 8px;\n}\n\n\n#btnPlay, #btnStop {\n cursor: pointer;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n\n.wm-state-stopped #btnStop {\n display: none;\n}\n\n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n\n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n\n.icon {\n vertical-align: top;\n}\n\n.CodeMirror-hint.isFolder::before {\n content: \'[\';\n}\n.CodeMirror-hint.isFolder::after {\n content: \']\';\n}',I='<div id="editor">\n</div>\n',E="dracula",R="/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n";R+="/*\n\n Name: dracula\n Author: Michael Kaminsky (http://github.com/mkaminsky11)\n\n Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)\n\n*/\n\n\n.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {\n background-color: #282a36 !important;\n color: #f8f8f2 !important;\n border: none;\n}\n.cm-s-dracula .CodeMirror-gutters { color: #282a36; }\n.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }\n.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }\n.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula span.cm-comment { color: #6272a4; }\n.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }\n.cm-s-dracula span.cm-number { color: #bd93f9; }\n.cm-s-dracula span.cm-variable { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-2 { color: white; }\n.cm-s-dracula span.cm-def { color: #50fa7b; }\n.cm-s-dracula span.cm-operator { color: #ff79c6; }\n.cm-s-dracula span.cm-keyword { color: #ff79c6; }\n.cm-s-dracula span.cm-atom { color: #bd93f9; }\n.cm-s-dracula span.cm-meta { color: #f8f8f2; }\n.cm-s-dracula span.cm-tag { color: #ff79c6; }\n.cm-s-dracula span.cm-attribute { color: #50fa7b; }\n.cm-s-dracula span.cm-qualifier { color: #50fa7b; }\n.cm-s-dracula span.cm-property { color: #66d9ef; }\n.cm-s-dracula span.cm-builtin { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }\n\n.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }\n.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }\n",R+=".CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n\n margin: 0;\n padding: 2px;\n\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n border-radius: 3px;\n border: 1px solid silver;\n\n background: white;\n font-size: 90%;\n font-family: monospace;\n\n max-height: 20em;\n overflow-y: auto;\n}\n\n.CodeMirror-hint {\n margin: 0;\n padding: 0 4px;\n border-radius: 2px;\n white-space: pre;\n color: black;\n cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n background: #08f;\n color: white;\n}\n";var T="additional-style",A=document.createElement("template");A.innerHTML="\n<style>\n ".concat(R,"\n ").concat(z,"\n</style>\n").concat(I,"\n");var O=function(n){c(t,u(HTMLElement));var r=s(t);function t(){var n;return o(this,t),(n=r.call(this)).eventMarkers=[],n.initiated=new Promise(function(e){n.createElement(e)}),n}return a(t,[{key:"filename",get:function(){return this._filename}},{key:"setAdditionalCssText",value:function(n){var e=this.shadowRoot.querySelector("#".concat(T));e||((e=document.createElement("style")).id="additional-style",this.shadowRoot.appendChild(e)),e.innerText=n}},{key:"setFilename",value:function(n){this._filename=n}},{key:"editorElement",get:function(){return this.shadowRoot.getElementById("editor")}},{key:"clearAllMarkers",value:function(){this.editorImpl.clearAllMarkers()}},{key:"clearEventMarkers",value:function(){this.editorImpl.clearEventMarkers()}},{key:"createElement",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),r=A.content.cloneNode(!0),this.shadowRoot.appendChild(r),setTimeout(function(){t.init(),n()});case 4:case"end":return e.stop()}},e,this)}))}},{key:"setWerckmeisterMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,w.WM_Compiler.getFileSystemInspector();case 2:e=n.sent,r=new y.LanguageFeatures(e,x),this.editorImpl.setMode(v.Mode.sheet),this.editorImpl.activateAutoCompletion(r,this.filename);case 6:case"end":return n.stop()}},n,this)}))}},{key:"updateMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.filename){n.next=3;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 3:if((e=this.filename.match(/.*(\.[^.]*$)/))&&!(e.length<2)){n.next=7;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 7:r=e[1],n.t0=r,n.next=".sheet"===n.t0?11:".template"===n.t0?11:".config"===n.t0?14:".lua"===n.t0?17:".conductions"===n.t0?18:19;break;case 11:return n.next=13,this.setWerckmeisterMode();case 13:return n.abrupt("return",n.sent);case 14:return n.next=16,this.setWerckmeisterMode();case 16:return n.abrupt("return",n.sent);case 17:return n.abrupt("return",this.editorImpl.setMode(v.Mode.lua));case 18:return n.abrupt("return",this.editorImpl.setMode(v.Mode.conductions));case 19:return n.abrupt("return",this.editorImpl.setMode(v.Mode.text));case 20:case"end":return n.stop()}},n,this)}))}},{key:"initListener",value:function(){}},{key:"getScriptText",value:function(){return this.editorImpl.getValue().trim()}},{key:"setScriptText",value:function(n){this.editorImpl.setValue(n)}},{key:"setError",value:function(n){this.clearAllMarkers(),this.editorImpl.setErrorMarker(n.positionBegin,n.positionBegin+1)}},{key:"addWarning",value:function(n){this.editorImpl.setWarningMarker(n.message,n.positionBegin,n.positionBegin+1)}},{key:"getScriptContent",value:function(n){var e=this.attributes.getNamedItem("wm-data");if(e)return atob(e.value);var r=n.match(/\[CDATA\[([\s\S]*)\]\]/);return r?r[1]:n}},{key:"init",value:function(){var n=this.shadowRoot.getElementById("editor"),e=this.getScriptContent(this.innerHTML);this.editorImpl=new v.Editor(n,e,{theme:E,lineNumbers:!0}),this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.fetchText(n);case 2:r=e.sent,(t=document.createElement("style")).innerText=r,this.shadowRoot.appendChild(t);case 6:case"end":return e.stop()}},e,this)}))}},{key:"readAttributes",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r,t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(e=this.attributes.getNamedItem("wm-style"))&&this.editorElement.setAttribute("style",e.value),(r=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(r.value),(t=this.attributes.getNamedItem("wm-filename"))&&(this.setFilename(t.value),this.updateMode());case 6:case"end":return n.stop()}},n,this)}))}},{key:"addMarkers",value:function(n){var r,t=e(n);try{for(t.s();!(r=t.n()).done;){var o=r.value,i=this.editorImpl.setEventMarker(o.beginPosition,o.beginPosition+1);this.eventMarkers.push(i)}}catch(a){t.e(a)}finally{t.f()}}},{key:"update",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.editorImpl.update(),n.next=3,this.updateMode();case 3:case"end":return n.stop()}},n,this)}))}},{key:"isClean",value:function(){return this.editorImpl.isClean()}},{key:"markClean",value:function(){this.editorImpl.markClean()}},{key:"clearHistory",value:function(){this.editorImpl.clearHistory()}}]),t}();exports.Editor=O;
507
+ "use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function e(n,e){var t;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(t=r(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){t=n[Symbol.iterator]()},n:function(){var n=t.next();return c=n.done,n},e:function(n){s=!0,a=n},f:function(){try{c||null==t.return||t.return()}finally{if(s)throw a}}}}function r(n,e){if(n){if("string"==typeof n)return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function o(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function i(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function a(n,e,r){return e&&i(n.prototype,e),r&&i(n,r),n}function c(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e)}function s(n){var e=m();return function(){var r,t=b(n);if(e){var o=b(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return l(this,r)}}function l(e,r){return!r||"object"!==n(r)&&"function"!=typeof r?d(e):r}function d(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function u(n){var e="function"==typeof Map?new Map:void 0;return(u=function(n){if(null===n||!f(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return p(n,arguments,b(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,n)})(n)}function p(n,e,r){return(p=m()?Reflect.construct:function(n,e,r){var t=[null];t.push.apply(t,e);var o=new(Function.bind.apply(n,t));return r&&h(o,r.prototype),o}).apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function f(n){return-1!==Function.toString.call(n).indexOf("[native code]")}function h(n,e){return(h=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(n,e)}function b(n){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}var g=this&&this.__awaiter||function(n,e,r,t){return new(r||(r=Promise))(function(o,i){function a(n){try{s(t.next(n))}catch(e){i(e)}}function c(n){try{s(t.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?o(n.value):(e=n.value,e instanceof r?e:new r(function(n){n(e)})).then(a,c)}s((t=t.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=void 0;var v=require("../../editor/Editor"),y=require("@werckmeister/language-features"),M=require("../../shared/http"),w=require("../../Global"),k=require("./EnvironmentInspector"),C=require("lodash"),x=new k.EnvironmentInspector,S=require("fs"),z='#editor {\n border: 2px solid grey;\n width: 100%;\n height: 100%;\n}\n\n\n.CodeMirror {\n width: 100%;\n height: 100%;\n}\n\n#wm-snippet {\n margin-bottom: 1.5em;\n}\n\n\n.wm-marked::before {\n content: " ";\n position: absolute;\n border-top: 4px solid #ff0;\n border-left: 4px solid #ff0;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-error::before {\n content: " ";\n position: absolute;\n border-top: 4px solid red;\n border-left: 4px solid red;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-warning::before {\n content: " ";\n position: absolute;\n border-bottom: 2px dotted orange;\n width: 16px;\n height: 1em;\n margin-top: 5px;\n margin-left: -3px;\n cursor: default;\n}\n\n.wm-warning.wm-marked::before {\n display: none;\n border-bottom: none;\n height: 8px;\n width: 8px;\n margin-top: -11px;\n margin-left: 8px;\n}\n\n\n#btnPlay, #btnStop {\n cursor: pointer;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n\n.wm-state-stopped #btnStop {\n display: none;\n}\n\n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n\n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n\n.icon {\n vertical-align: top;\n}\n\n.CodeMirror-hint.isFolder::before {\n content: \'[\';\n}\n.CodeMirror-hint.isFolder::after {\n content: \']\';\n}',I='<div id="editor">\n</div>\n',E="dracula",R="/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n";R+="/*\n\n Name: dracula\n Author: Michael Kaminsky (http://github.com/mkaminsky11)\n\n Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)\n\n*/\n\n\n.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {\n background-color: #282a36 !important;\n color: #f8f8f2 !important;\n border: none;\n}\n.cm-s-dracula .CodeMirror-gutters { color: #282a36; }\n.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }\n.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }\n.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula span.cm-comment { color: #6272a4; }\n.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }\n.cm-s-dracula span.cm-number { color: #bd93f9; }\n.cm-s-dracula span.cm-variable { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-2 { color: white; }\n.cm-s-dracula span.cm-def { color: #50fa7b; }\n.cm-s-dracula span.cm-operator { color: #ff79c6; }\n.cm-s-dracula span.cm-keyword { color: #ff79c6; }\n.cm-s-dracula span.cm-atom { color: #bd93f9; }\n.cm-s-dracula span.cm-meta { color: #f8f8f2; }\n.cm-s-dracula span.cm-tag { color: #ff79c6; }\n.cm-s-dracula span.cm-attribute { color: #50fa7b; }\n.cm-s-dracula span.cm-qualifier { color: #50fa7b; }\n.cm-s-dracula span.cm-property { color: #66d9ef; }\n.cm-s-dracula span.cm-builtin { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }\n\n.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }\n.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }\n",R+=".CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n\n margin: 0;\n padding: 2px;\n\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n border-radius: 3px;\n border: 1px solid silver;\n\n background: white;\n font-size: 90%;\n font-family: monospace;\n\n max-height: 20em;\n overflow-y: auto;\n}\n\n.CodeMirror-hint {\n margin: 0;\n padding: 0 4px;\n border-radius: 2px;\n white-space: pre;\n color: black;\n cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n background: #08f;\n color: white;\n}\n";var T="additional-style",A=document.createElement("template");A.innerHTML="\n<style>\n ".concat(R,"\n ").concat(z,"\n</style>\n").concat(I,"\n");var O=function(n){c(t,u(HTMLElement));var r=s(t);function t(){var n;return o(this,t),(n=r.call(this)).eventMarkers=[],n.initiated=new Promise(function(e){n.createElement(e)}),n}return a(t,[{key:"filename",get:function(){return this._filename}},{key:"setAdditionalCssText",value:function(n){var e=this.shadowRoot.querySelector("#".concat(T));e||((e=document.createElement("style")).id="additional-style",this.shadowRoot.appendChild(e)),e.innerText=n}},{key:"setFilename",value:function(n){this._filename=n}},{key:"editorElement",get:function(){return this.shadowRoot.getElementById("editor")}},{key:"clearAllMarkers",value:function(){this.editorImpl.clearAllMarkers()}},{key:"clearEventMarkers",value:function(){this.editorImpl.clearEventMarkers()}},{key:"createElement",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),r=A.content.cloneNode(!0),this.shadowRoot.appendChild(r),setTimeout(function(){t.init(),n()});case 4:case"end":return e.stop()}},e,this)}))}},{key:"setWerckmeisterMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,w.WM_Compiler.getFileSystemInspector();case 2:e=n.sent,r=new y.LanguageFeatures(e,x),this.editorImpl.setMode(v.Mode.sheet),this.editorImpl.activateAutoCompletion(r,this.filename);case 6:case"end":return n.stop()}},n,this)}))}},{key:"updateMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.filename){n.next=3;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 3:if((e=this.filename.match(/.*(\.[^.]*$)/))&&!(e.length<2)){n.next=7;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 7:r=e[1],n.t0=r,n.next=".part"===n.t0?11:".sheet"===n.t0?11:".template"===n.t0?11:".config"===n.t0?14:".lua"===n.t0?17:".conductions"===n.t0?18:19;break;case 11:return n.next=13,this.setWerckmeisterMode();case 13:return n.abrupt("return",n.sent);case 14:return n.next=16,this.setWerckmeisterMode();case 16:return n.abrupt("return",n.sent);case 17:return n.abrupt("return",this.editorImpl.setMode(v.Mode.lua));case 18:return n.abrupt("return",this.editorImpl.setMode(v.Mode.conductions));case 19:return n.abrupt("return",this.editorImpl.setMode(v.Mode.text));case 20:case"end":return n.stop()}},n,this)}))}},{key:"initListener",value:function(){}},{key:"getScriptText",value:function(){return this.editorImpl.getValue().trim()}},{key:"setScriptText",value:function(n){this.editorImpl.setValue(n)}},{key:"setError",value:function(n){this.clearAllMarkers(),this.editorImpl.setErrorMarker(n.positionBegin,n.positionBegin+1)}},{key:"addWarning",value:function(n){this.editorImpl.setWarningMarker(n.message,n.positionBegin,n.positionBegin+1)}},{key:"getScriptContent",value:function(n){var e=this.attributes.getNamedItem("wm-data");if(e)return atob(e.value);var r=n.match(/\[CDATA\[([\s\S]*)\]\]/);return r?r[1]:n}},{key:"init",value:function(){var n=this.shadowRoot.getElementById("editor"),e=this.getScriptContent(this.innerHTML);this.editorImpl=new v.Editor(n,e,{theme:E,lineNumbers:!0}),this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.fetchText(n);case 2:r=e.sent,(t=document.createElement("style")).innerText=r,this.shadowRoot.appendChild(t);case 6:case"end":return e.stop()}},e,this)}))}},{key:"readAttributes",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r,t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(e=this.attributes.getNamedItem("wm-style"))&&this.editorElement.setAttribute("style",e.value),(r=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(r.value),(t=this.attributes.getNamedItem("wm-filename"))&&(this.setFilename(t.value),this.updateMode());case 6:case"end":return n.stop()}},n,this)}))}},{key:"addMarkers",value:function(n){var r,t=e(n);try{for(t.s();!(r=t.n()).done;){var o=r.value,i=this.editorImpl.setEventMarker(o.beginPosition,o.beginPosition+1);this.eventMarkers.push(i)}}catch(a){t.e(a)}finally{t.f()}}},{key:"update",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.editorImpl.update(),n.next=3,this.updateMode();case 3:case"end":return n.stop()}},n,this)}))}},{key:"isClean",value:function(){return this.editorImpl.isClean()}},{key:"markClean",value:function(){this.editorImpl.markClean()}},{key:"clearHistory",value:function(){this.editorImpl.clearHistory()}}]),t}();exports.Editor=O;
508
508
  },{"../../editor/Editor":"BzA4","@werckmeister/language-features":"LghJ","../../shared/http":"vSbS","../../Global":"ooUX","./EnvironmentInspector":"ksUX","lodash":"B1iE","fs":"rDCW"}],"F8Qk":[function(require,module,exports) {
509
509
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.snippetTemplate=exports.singleSnippetTemplate=void 0;var e="\ntempo: $tempo;\ndevice: MyDevice midi 1;\n$defLines\n[\ninstrument: ex1;\n{\n$code\n}\n]",n="\n$defLines\n$code";exports.singleSnippetTemplate=function(n,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i=i||"instrumentDef:ex1 MyDevice 0 0 0;";var r=e.replace("$tempo",t.toString()).replace("$defLines",i),p=r.indexOf("$code");return{script:r=r.replace("$code",n),charOffset:p}},exports.snippetTemplate=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i=i||"instrumentDef:ex1 MyDevice 0 0 0;";var r=n.replace("$tempo",t.toString()).replace("$defLines",i),p=r.indexOf("$code");return{script:r=r.replace("$code",e),charOffset:p}};
510
510
  },{}],"Ii2z":[function(require,module,exports) {