parse-dashboard 4.1.1 → 4.1.2-beta.1
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/Parse-Dashboard/index.js +23 -22
- package/Parse-Dashboard/public/bundles/143.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/169.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/191.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/208.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/220.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/253.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/280.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/287.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/36.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/370.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/41.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/453.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/468.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/500.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/556.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/620.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/633.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/67.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/677.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/736.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/798.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/83.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/930.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/952.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/963.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/dashboard.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/dashboard.bundle.js.LICENSE.txt +35 -0
- package/README.md +2 -2
- package/package.json +18 -19
package/Parse-Dashboard/index.js
CHANGED
|
@@ -33,8 +33,9 @@ program.option('--createUser', 'helper tool to allow you to generate secure user
|
|
|
33
33
|
program.option('--createMFA', 'helper tool to allow you to generate multi-factor authentication secrets.');
|
|
34
34
|
|
|
35
35
|
program.parse(process.argv);
|
|
36
|
+
const options = program.opts();
|
|
36
37
|
|
|
37
|
-
for (const key in
|
|
38
|
+
for (const key in options) {
|
|
38
39
|
const func = CLIHelper[key];
|
|
39
40
|
if (func && typeof func === 'function') {
|
|
40
41
|
func();
|
|
@@ -42,31 +43,31 @@ for (const key in program) {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const host =
|
|
46
|
-
const port =
|
|
47
|
-
const mountPath =
|
|
48
|
-
const allowInsecureHTTP =
|
|
49
|
-
const cookieSessionSecret =
|
|
50
|
-
const trustProxy =
|
|
51
|
-
const dev =
|
|
46
|
+
const host = options.host || process.env.HOST || '0.0.0.0';
|
|
47
|
+
const port = options.port || process.env.PORT || 4040;
|
|
48
|
+
const mountPath = options.mountPath || process.env.MOUNT_PATH || '/';
|
|
49
|
+
const allowInsecureHTTP = options.allowInsecureHTTP || process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP;
|
|
50
|
+
const cookieSessionSecret = options.cookieSessionSecret || process.env.PARSE_DASHBOARD_COOKIE_SESSION_SECRET;
|
|
51
|
+
const trustProxy = options.trustProxy || process.env.PARSE_DASHBOARD_TRUST_PROXY;
|
|
52
|
+
const dev = options.dev;
|
|
52
53
|
|
|
53
54
|
if (trustProxy && allowInsecureHTTP) {
|
|
54
55
|
console.log('Set only trustProxy *or* allowInsecureHTTP, not both. Only one is needed to handle being behind a proxy.');
|
|
55
56
|
process.exit(-1);
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
let explicitConfigFileProvided = !!
|
|
59
|
+
let explicitConfigFileProvided = !!options.config;
|
|
59
60
|
let configFile = null;
|
|
60
61
|
let configFromCLI = null;
|
|
61
|
-
let configServerURL =
|
|
62
|
-
let configGraphQLServerURL =
|
|
63
|
-
let configMasterKey =
|
|
64
|
-
let configAppId =
|
|
65
|
-
let configAppName =
|
|
66
|
-
let configUserId =
|
|
67
|
-
let configUserPassword =
|
|
68
|
-
let configSSLKey =
|
|
69
|
-
let configSSLCert =
|
|
62
|
+
let configServerURL = options.serverURL || process.env.PARSE_DASHBOARD_SERVER_URL;
|
|
63
|
+
let configGraphQLServerURL = options.graphQLServerURL || process.env.PARSE_DASHBOARD_GRAPHQL_SERVER_URL;
|
|
64
|
+
let configMasterKey = options.masterKey || process.env.PARSE_DASHBOARD_MASTER_KEY;
|
|
65
|
+
let configAppId = options.appId || process.env.PARSE_DASHBOARD_APP_ID;
|
|
66
|
+
let configAppName = options.appName || process.env.PARSE_DASHBOARD_APP_NAME;
|
|
67
|
+
let configUserId = options.userId || process.env.PARSE_DASHBOARD_USER_ID;
|
|
68
|
+
let configUserPassword = options.userPassword || process.env.PARSE_DASHBOARD_USER_PASSWORD;
|
|
69
|
+
let configSSLKey = options.sslKey || process.env.PARSE_DASHBOARD_SSL_KEY;
|
|
70
|
+
let configSSLCert = options.sslCert || process.env.PARSE_DASHBOARD_SSL_CERT;
|
|
70
71
|
|
|
71
72
|
function handleSIGs(server) {
|
|
72
73
|
const signals = {
|
|
@@ -86,7 +87,7 @@ function handleSIGs(server) {
|
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
if (!
|
|
90
|
+
if (!options.config && !process.env.PARSE_DASHBOARD_CONFIG) {
|
|
90
91
|
if (configServerURL && configMasterKey && configAppId) {
|
|
91
92
|
configFromCLI = {
|
|
92
93
|
data: {
|
|
@@ -114,13 +115,13 @@ if (!program.config && !process.env.PARSE_DASHBOARD_CONFIG) {
|
|
|
114
115
|
} else if (!configServerURL && !configMasterKey && !configAppName) {
|
|
115
116
|
configFile = path.join(__dirname, 'parse-dashboard-config.json');
|
|
116
117
|
}
|
|
117
|
-
} else if (!
|
|
118
|
+
} else if (!options.config && process.env.PARSE_DASHBOARD_CONFIG) {
|
|
118
119
|
configFromCLI = {
|
|
119
120
|
data: JSON.parse(process.env.PARSE_DASHBOARD_CONFIG)
|
|
120
121
|
};
|
|
121
122
|
} else {
|
|
122
|
-
configFile =
|
|
123
|
-
if (
|
|
123
|
+
configFile = options.config;
|
|
124
|
+
if (options.appId || options.serverURL || options.masterKey || options.appName || options.graphQLServerURL) {
|
|
124
125
|
console.log('You must provide either a config file or other CLI options (appName, appId, masterKey, serverURL, and graphQLServerURL); not both.');
|
|
125
126
|
process.exit(3);
|
|
126
127
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[143],{82143:function(e,t,u){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(u(11036)),a=u(11935);function l(e,t){var u,n,r=e.levels;return((r&&0!==r.length?r[r.length-1]-((null===(u=this.electricInput)||void 0===u?void 0:u.test(t))?1:0):e.indentLevel)||0)*((null===(n=this.config)||void 0===n?void 0:n.indentUnit)||0)}r.default.defineMode("graphql-variables",(function(e){var t=a.onlineParser({eatWhitespace:function(e){return e.eatSpace()},lexRules:i,parseRules:s,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:l,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));var i={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},s={Document:[a.p("{"),a.list("Variable",a.opt(a.p(","))),a.p("}")],Variable:[c("variable"),a.p(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[a.t("Number","number")],StringValue:[a.t("String","string")],BooleanValue:[a.t("Keyword","builtin")],NullValue:[a.t("Keyword","keyword")],ListValue:[a.p("["),a.list("Value",a.opt(a.p(","))),a.p("]")],ObjectValue:[a.p("{"),a.list("ObjectField",a.opt(a.p(","))),a.p("}")],ObjectField:[c("attribute"),a.p(":"),"Value"]};function c(e){return{style:e,match:function(e){return"String"===e.kind},update:function(e,t){e.name=t.value.slice(1,-1)}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[169,191,930],{85930:(e,n,t)=>{!function(e){function n(n,t,o){var r,i=n.getWrapperElement();return(r=i.appendChild(document.createElement("div"))).className=o?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),e.addClass(i,"dialog-opened"),r}function t(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}e.defineExtension("openDialog",(function(o,r,i){i||(i={}),t(this,null);var a=n(this,o,i.bottom),s=!1,l=this;function c(n){if("string"==typeof n)f.value=n;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),i.onClose&&i.onClose(a)}}var u,f=a.getElementsByTagName("input")[0];return f?(f.focus(),i.value&&(f.value=i.value,!1!==i.selectValueOnOpen&&f.select()),i.onInput&&e.on(f,"input",(function(e){i.onInput(e,f.value,c)})),i.onKeyUp&&e.on(f,"keyup",(function(e){i.onKeyUp(e,f.value,c)})),e.on(f,"keydown",(function(n){i&&i.onKeyDown&&i.onKeyDown(n,f.value,c)||((27==n.keyCode||!1!==i.closeOnEnter&&13==n.keyCode)&&(f.blur(),e.e_stop(n),c()),13==n.keyCode&&r(f.value,n))})),!1!==i.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(u=a.getElementsByTagName("button")[0])&&(e.on(u,"click",(function(){c(),l.focus()})),!1!==i.closeOnBlur&&e.on(u,"blur",c),u.focus()),c})),e.defineExtension("openConfirm",(function(o,r,i){t(this,null);var a=n(this,o,i&&i.bottom),s=a.getElementsByTagName("button"),l=!1,c=this,u=1;function f(){l||(l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus())}s[0].focus();for(var h=0;h<s.length;++h){var p=s[h];!function(n){e.on(p,"click",(function(t){e.e_preventDefault(t),f(),n&&n(c)}))}(r[h]),e.on(p,"blur",(function(){--u,setTimeout((function(){u<=0&&f()}),200)})),e.on(p,"focus",(function(){++u}))}})),e.defineExtension("openNotification",(function(o,r){t(this,c);var i,a=n(this,o,r&&r.bottom),s=!1,l=r&&void 0!==r.duration?r.duration:5e3;function c(){s||(s=!0,clearTimeout(i),e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return e.on(a,"click",(function(n){e.e_preventDefault(n),c()})),l&&(i=setTimeout(c,l)),c}))}(t(11036))},95169:(e,n,t)=>{!function(e){"use strict";function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function t(e){return e.state.search||(e.state.search=new n)}function o(e){return"string"==typeof e&&e==e.toLowerCase()}function r(e,n,t){return e.getSearchCursor(n,t,{caseFold:o(n),multiline:!0})}function i(e,n,t,o,r){e.openDialog?e.openDialog(n,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(t,o))}function a(e){return e.replace(/\\([nrt\\])/g,(function(e,n){return"n"==n?"\n":"r"==n?"\r":"t"==n?"\t":"\\"==n?"\\":e}))}function s(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],-1==n[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function l(e,n,t){n.queryText=t,n.query=s(t),e.removeOverlay(n.overlay,o(n.query)),n.overlay=function(e,n){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(n){e.lastIndex=n.pos;var t=e.exec(n.string);if(t&&t.index==n.pos)return n.pos+=t[0].length||1,"searching";t?n.pos=t.index:n.skipToEnd()}}}(n.query,o(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,o(n.query)))}function c(n,o,r,a){var s=t(n);if(s.query)return u(n,o);var c=n.getSelection()||s.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),r&&n.openDialog){var h=null,g=function(t,o){e.e_stop(o),t&&(t!=s.queryText&&(l(n,s,t),s.posFrom=s.posTo=n.getCursor()),h&&(h.style.opacity=1),u(n,o.shiftKey,(function(e,t){var o;t.line<3&&document.querySelector&&(o=n.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>n.cursorCoords(t,"window").top&&((h=o).style.opacity=.4)})))};(function(e,n,t,o,r){e.openDialog(n,o,{value:t,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){f(e)},onKeyDown:r,bottom:e.options.search.bottom})})(n,p(n),c,g,(function(o,r){var i=e.keyName(o),a=n.getOption("extraKeys"),s=a&&a[i]||e.keyMap[n.getOption("keyMap")][i];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(o),l(n,t(n),r),n.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(o),g(r,o))})),a&&c&&(l(n,s,c),u(n,o))}else i(n,p(n),"Search for:",c,(function(e){e&&!s.query&&n.operation((function(){l(n,s,e),s.posFrom=s.posTo=n.getCursor(),u(n,o)}))}))}function u(n,o,i){n.operation((function(){var a=t(n),s=r(n,a.query,o?a.posFrom:a.posTo);(s.find(o)||(s=r(n,a.query,o?e.Pos(n.lastLine()):e.Pos(n.firstLine(),0))).find(o))&&(n.setSelection(s.from(),s.to()),n.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function f(e){e.operation((function(){var n=t(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))}))}function h(e,n){var t=e?document.createElement(e):document.createDocumentFragment();for(var o in n)t[o]=n[o];for(var r=2;r<arguments.length;r++){var i=arguments[r];t.appendChild("string"==typeof i?document.createTextNode(i):i)}return t}function p(e){return h("",null,h("span",{className:"CodeMirror-search-label"},e.phrase("Search:"))," ",h("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",h("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function g(e,n,t){e.operation((function(){for(var o=r(e,n);o.findNext();)if("string"!=typeof n){var i=e.getRange(o.from(),o.to()).match(n);o.replace(t.replace(/\$(\d)/g,(function(e,n){return i[n]})))}else o.replace(t)}))}function d(e,n){if(!e.getOption("readOnly")){var o=e.getSelection()||t(e).lastQuery,l=n?e.phrase("Replace all:"):e.phrase("Replace:"),c=h("",null,h("span",{className:"CodeMirror-search-label"},l),function(e){return h("",null," ",h("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",h("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}(e));i(e,c,l,o,(function(t){t&&(t=s(t),i(e,function(e){return h("",null,h("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",h("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}(e),e.phrase("Replace with:"),"",(function(o){if(o=a(o),n)g(e,t,o);else{f(e);var i=r(e,t,e.getCursor("from")),s=function(){var n,a=i.from();!(n=i.findNext())&&(i=r(e,t),!(n=i.findNext())||a&&i.from().line==a.line&&i.from().ch==a.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),function(e,n,t,o){e.openConfirm?e.openConfirm(n,o):confirm(t)&&o[0]()}(e,function(e){return h("",null,h("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",h("button",{},e.phrase("Yes"))," ",h("button",{},e.phrase("No"))," ",h("button",{},e.phrase("All"))," ",h("button",{},e.phrase("Stop")))}(e),e.phrase("Replace?"),[function(){l(n)},s,function(){g(e,t,o)}]))},l=function(e){i.replace("string"==typeof t?o:o.replace(/\$(\d)/g,(function(n,t){return e[t]}))),s()};s()}})))}))}}e.defineOption("search",{bottom:!1}),e.commands.find=function(e){f(e),c(e)},e.commands.findPersistent=function(e){f(e),c(e,!1,!0)},e.commands.findPersistentNext=function(e){c(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){c(e,!0,!0,!0)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=f,e.commands.replace=d,e.commands.replaceAll=function(e){d(e,!0)}}(t(11036),t(60191),t(85930))},60191:(e,n,t)=>{!function(e){"use strict";var n,t,o=e.Pos;function r(e,n){for(var t=function(e){var n=e.flags;return null!=n?n:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),o=t,r=0;r<n.length;r++)-1==o.indexOf(n.charAt(r))&&(o+=n.charAt(r));return t==o?e:new RegExp(e.source,o)}function i(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function a(e,n,t){n=r(n,"g");for(var i=t.line,a=t.ch,s=e.lastLine();i<=s;i++,a=0){n.lastIndex=a;var l=e.getLine(i),c=n.exec(l);if(c)return{from:o(i,c.index),to:o(i,c.index+c[0].length),match:c}}}function s(e,n,t){if(!i(n))return a(e,n,t);n=r(n,"gm");for(var s,l=1,c=t.line,u=e.lastLine();c<=u;){for(var f=0;f<l&&!(c>u);f++){var h=e.getLine(c++);s=null==s?h:s+"\n"+h}l*=2,n.lastIndex=t.ch;var p=n.exec(s);if(p){var g=s.slice(0,p.index).split("\n"),d=p[0].split("\n"),m=t.line+g.length-1,v=g[g.length-1].length;return{from:o(m,v),to:o(m+d.length-1,1==d.length?v+d[0].length:d[d.length-1].length),match:p}}}}function l(e,n,t){for(var o,r=0;r<=e.length;){n.lastIndex=r;var i=n.exec(e);if(!i)break;var a=i.index+i[0].length;if(a>e.length-t)break;(!o||a>o.index+o[0].length)&&(o=i),r=i.index+1}return o}function c(e,n,t){n=r(n,"g");for(var i=t.line,a=t.ch,s=e.firstLine();i>=s;i--,a=-1){var c=e.getLine(i),u=l(c,n,a<0?0:c.length-a);if(u)return{from:o(i,u.index),to:o(i,u.index+u[0].length),match:u}}}function u(e,n,t){if(!i(n))return c(e,n,t);n=r(n,"gm");for(var a,s=1,u=e.getLine(t.line).length-t.ch,f=t.line,h=e.firstLine();f>=h;){for(var p=0;p<s&&f>=h;p++){var g=e.getLine(f--);a=null==a?g:g+"\n"+a}s*=2;var d=l(a,n,u);if(d){var m=a.slice(0,d.index).split("\n"),v=d[0].split("\n"),y=f+m.length,x=m[m.length-1].length;return{from:o(y,x),to:o(y+v.length-1,1==v.length?x+v[0].length:v[v.length-1].length),match:d}}}}function f(e,n,t,o){if(e.length==n.length)return t;for(var r=0,i=t+Math.max(0,e.length-n.length);;){if(r==i)return r;var a=r+i>>1,s=o(e.slice(0,a)).length;if(s==t)return a;s>t?i=a:r=a+1}}function h(e,r,i,a){if(!r.length)return null;var s=a?n:t,l=s(r).split(/\r|\n\r?/);e:for(var c=i.line,u=i.ch,h=e.lastLine()+1-l.length;c<=h;c++,u=0){var p=e.getLine(c).slice(u),g=s(p);if(1==l.length){var d=g.indexOf(l[0]);if(-1==d)continue e;return i=f(p,g,d,s)+u,{from:o(c,f(p,g,d,s)+u),to:o(c,f(p,g,d+l[0].length,s)+u)}}var m=g.length-l[0].length;if(g.slice(m)==l[0]){for(var v=1;v<l.length-1;v++)if(s(e.getLine(c+v))!=l[v])continue e;var y=e.getLine(c+l.length-1),x=s(y),C=l[l.length-1];if(x.slice(0,C.length)==C)return{from:o(c,f(p,g,m,s)+u),to:o(c+l.length-1,f(y,x,C.length,s))}}}}function p(e,r,i,a){if(!r.length)return null;var s=a?n:t,l=s(r).split(/\r|\n\r?/);e:for(var c=i.line,u=i.ch,h=e.firstLine()-1+l.length;c>=h;c--,u=-1){var p=e.getLine(c);u>-1&&(p=p.slice(0,u));var g=s(p);if(1==l.length){var d=g.lastIndexOf(l[0]);if(-1==d)continue e;return{from:o(c,f(p,g,d,s)),to:o(c,f(p,g,d+l[0].length,s))}}var m=l[l.length-1];if(g.slice(0,m.length)==m){var v=1;for(i=c-l.length+1;v<l.length-1;v++)if(s(e.getLine(i+v))!=l[v])continue e;var y=e.getLine(c+1-l.length),x=s(y);if(x.slice(x.length-l[0].length)==l[0])return{from:o(c+1-l.length,f(y,x,y.length-l[0].length,s)),to:o(c,f(p,g,m.length,s))}}}}function g(e,n,t,i){var l;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,t=t?e.clipPos(t):o(0,0),this.pos={from:t,to:t},"object"==typeof i?l=i.caseFold:(l=i,i=null),"string"==typeof n?(null==l&&(l=!1),this.matches=function(t,o){return(t?p:h)(e,n,o,l)}):(n=r(n,"gm"),i&&!1===i.multiline?this.matches=function(t,o){return(t?c:a)(e,n,o)}:this.matches=function(t,o){return(t?u:s)(e,n,o)})}String.prototype.normalize?(n=function(e){return e.normalize("NFD").toLowerCase()},t=function(e){return e.normalize("NFD")}):(n=function(e){return e.toLowerCase()},t=function(e){return e}),g.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(n){var t=this.doc.clipPos(n?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(t=o(t.line,t.ch),n?(t.ch--,t.ch<0&&(t.line--,t.ch=(this.doc.getLine(t.line)||"").length)):(t.ch++,t.ch>(this.doc.getLine(t.line)||"").length&&(t.ch=0,t.line++)),0!=e.cmpPos(t,this.doc.clipPos(t))))return this.atOccurrence=!1;var r=this.matches(n,t);if(this.afterEmptyMatch=r&&0==e.cmpPos(r.from,r.to),r)return this.pos=r,this.atOccurrence=!0,this.pos.match||!0;var i=o(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:i,to:i},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,t){if(this.atOccurrence){var r=e.splitLines(n);this.doc.replaceRange(r,this.pos.from,this.pos.to,t),this.pos.to=o(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,n,t){return new g(this.doc,e,n,t)})),e.defineDocExtension("getSearchCursor",(function(e,n,t){return new g(this,e,n,t)})),e.defineExtension("selectMatches",(function(n,t){for(var o=[],r=this.getSearchCursor(n,this.getCursor("from"),t);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)o.push({anchor:r.from(),head:r.to()});o.length&&this.setSelections(o,0)}))}(t(11036))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[191],{60191:(t,n,e)=>{!function(t){"use strict";var n,e,r=t.Pos;function i(t,n){for(var e=function(t){var n=t.flags;return null!=n?n:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}(t),r=e,i=0;i<n.length;i++)-1==r.indexOf(n.charAt(i))&&(r+=n.charAt(i));return e==r?t:new RegExp(t.source,r)}function h(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}function o(t,n,e){n=i(n,"g");for(var h=e.line,o=e.ch,l=t.lastLine();h<=l;h++,o=0){n.lastIndex=o;var c=t.getLine(h),s=n.exec(c);if(s)return{from:r(h,s.index),to:r(h,s.index+s[0].length),match:s}}}function l(t,n,e){if(!h(n))return o(t,n,e);n=i(n,"gm");for(var l,c=1,s=e.line,f=t.lastLine();s<=f;){for(var a=0;a<c&&!(s>f);a++){var u=t.getLine(s++);l=null==l?u:l+"\n"+u}c*=2,n.lastIndex=e.ch;var g=n.exec(l);if(g){var m=l.slice(0,g.index).split("\n"),v=g[0].split("\n"),p=e.line+m.length-1,d=m[m.length-1].length;return{from:r(p,d),to:r(p+v.length-1,1==v.length?d+v[0].length:v[v.length-1].length),match:g}}}}function c(t,n,e){for(var r,i=0;i<=t.length;){n.lastIndex=i;var h=n.exec(t);if(!h)break;var o=h.index+h[0].length;if(o>t.length-e)break;(!r||o>r.index+r[0].length)&&(r=h),i=h.index+1}return r}function s(t,n,e){n=i(n,"g");for(var h=e.line,o=e.ch,l=t.firstLine();h>=l;h--,o=-1){var s=t.getLine(h),f=c(s,n,o<0?0:s.length-o);if(f)return{from:r(h,f.index),to:r(h,f.index+f[0].length),match:f}}}function f(t,n,e){if(!h(n))return s(t,n,e);n=i(n,"gm");for(var o,l=1,f=t.getLine(e.line).length-e.ch,a=e.line,u=t.firstLine();a>=u;){for(var g=0;g<l&&a>=u;g++){var m=t.getLine(a--);o=null==o?m:m+"\n"+o}l*=2;var v=c(o,n,f);if(v){var p=o.slice(0,v.index).split("\n"),d=v[0].split("\n"),x=a+p.length,L=p[p.length-1].length;return{from:r(x,L),to:r(x+d.length-1,1==d.length?L+d[0].length:d[d.length-1].length),match:v}}}}function a(t,n,e,r){if(t.length==n.length)return e;for(var i=0,h=e+Math.max(0,t.length-n.length);;){if(i==h)return i;var o=i+h>>1,l=r(t.slice(0,o)).length;if(l==e)return o;l>e?h=o:i=o+1}}function u(t,i,h,o){if(!i.length)return null;var l=o?n:e,c=l(i).split(/\r|\n\r?/);t:for(var s=h.line,f=h.ch,u=t.lastLine()+1-c.length;s<=u;s++,f=0){var g=t.getLine(s).slice(f),m=l(g);if(1==c.length){var v=m.indexOf(c[0]);if(-1==v)continue t;return h=a(g,m,v,l)+f,{from:r(s,a(g,m,v,l)+f),to:r(s,a(g,m,v+c[0].length,l)+f)}}var p=m.length-c[0].length;if(m.slice(p)==c[0]){for(var d=1;d<c.length-1;d++)if(l(t.getLine(s+d))!=c[d])continue t;var x=t.getLine(s+c.length-1),L=l(x),O=c[c.length-1];if(L.slice(0,O.length)==O)return{from:r(s,a(g,m,p,l)+f),to:r(s+c.length-1,a(x,L,O.length,l))}}}}function g(t,i,h,o){if(!i.length)return null;var l=o?n:e,c=l(i).split(/\r|\n\r?/);t:for(var s=h.line,f=h.ch,u=t.firstLine()-1+c.length;s>=u;s--,f=-1){var g=t.getLine(s);f>-1&&(g=g.slice(0,f));var m=l(g);if(1==c.length){var v=m.lastIndexOf(c[0]);if(-1==v)continue t;return{from:r(s,a(g,m,v,l)),to:r(s,a(g,m,v+c[0].length,l))}}var p=c[c.length-1];if(m.slice(0,p.length)==p){var d=1;for(h=s-c.length+1;d<c.length-1;d++)if(l(t.getLine(h+d))!=c[d])continue t;var x=t.getLine(s+1-c.length),L=l(x);if(L.slice(L.length-c[0].length)==c[0])return{from:r(s+1-c.length,a(x,L,x.length-c[0].length,l)),to:r(s,a(g,m,p.length,l))}}}}function m(t,n,e,h){var c;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=t,e=e?t.clipPos(e):r(0,0),this.pos={from:e,to:e},"object"==typeof h?c=h.caseFold:(c=h,h=null),"string"==typeof n?(null==c&&(c=!1),this.matches=function(e,r){return(e?g:u)(t,n,r,c)}):(n=i(n,"gm"),h&&!1===h.multiline?this.matches=function(e,r){return(e?s:o)(t,n,r)}:this.matches=function(e,r){return(e?f:l)(t,n,r)})}String.prototype.normalize?(n=function(t){return t.normalize("NFD").toLowerCase()},e=function(t){return t.normalize("NFD")}):(n=function(t){return t.toLowerCase()},e=function(t){return t}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(n){var e=this.doc.clipPos(n?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(e=r(e.line,e.ch),n?(e.ch--,e.ch<0&&(e.line--,e.ch=(this.doc.getLine(e.line)||"").length)):(e.ch++,e.ch>(this.doc.getLine(e.line)||"").length&&(e.ch=0,e.line++)),0!=t.cmpPos(e,this.doc.clipPos(e))))return this.atOccurrence=!1;var i=this.matches(n,e);if(this.afterEmptyMatch=i&&0==t.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var h=r(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:h,to:h},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,e){if(this.atOccurrence){var i=t.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,e),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},t.defineExtension("getSearchCursor",(function(t,n,e){return new m(this.doc,t,n,e)})),t.defineDocExtension("getSearchCursor",(function(t,n,e){return new m(this,t,n,e)})),t.defineExtension("selectMatches",(function(n,e){for(var r=[],i=this.getSearchCursor(n,this.getCursor("from"),e);i.findNext()&&!(t.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(e(11036))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[208],{64208:(e,n,r)=>{!function(e){"use strict";function n(n){return function(r,t){var i=t.line,l=r.getLine(i);function o(n){for(var o,f=t.ch,s=0;;){var u=f<=0?-1:l.lastIndexOf(n[0],f-1);if(-1!=u){if(1==s&&u<t.ch)break;if(o=r.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(o))return{ch:u+1,tokenType:o,pair:n};f=u-1}else{if(1==s)break;s=1,f=l.length}}}function f(n){var t,l,o=1,f=r.lastLine(),s=n.ch;e:for(var u=i;u<=f;++u)for(var a=r.getLine(u),c=u==i?s:0;;){var g=a.indexOf(n.pair[0],c),p=a.indexOf(n.pair[1],c);if(g<0&&(g=a.length),p<0&&(p=a.length),(c=Math.min(g,p))==a.length)break;if(r.getTokenTypeAt(e.Pos(u,c+1))==n.tokenType)if(c==g)++o;else if(!--o){t=u,l=c;break e}++c}return null==t||i==t?null:{from:e.Pos(i,s),to:e.Pos(t,l)}}for(var s=[],u=0;u<n.length;u++){var a=o(n[u]);a&&s.push(a)}for(s.sort((function(e,n){return e.ch-n.ch})),u=0;u<s.length;u++){var c=f(s[u]);if(c)return c}return null}}e.registerHelper("fold","brace",n([["{","}"],["[","]"]])),e.registerHelper("fold","brace-paren",n([["{","}"],["[","]"],["(",")"]])),e.registerHelper("fold","import",(function(n,r){function t(r){if(r<n.firstLine()||r>n.lastLine())return null;var t=n.getTokenAt(e.Pos(r,1));if(/\S/.test(t.string)||(t=n.getTokenAt(e.Pos(r,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=r,l=Math.min(n.lastLine(),r+10);i<=l;++i){var o=n.getLine(i).indexOf(";");if(-1!=o)return{startCh:t.end,end:e.Pos(i,o)}}}var i,l=r.line,o=t(l);if(!o||t(l-1)||(i=t(l-2))&&i.end.line==l-1)return null;for(var f=o.end;;){var s=t(f.line+1);if(null==s)break;f=s.end}return{from:n.clipPos(e.Pos(l,o.startCh+1)),to:f}})),e.registerHelper("fold","include",(function(n,r){function t(r){if(r<n.firstLine()||r>n.lastLine())return null;var t=n.getTokenAt(e.Pos(r,1));return/\S/.test(t.string)||(t=n.getTokenAt(e.Pos(r,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var i=r.line,l=t(i);if(null==l||null!=t(i-1))return null;for(var o=i;null!=t(o+1);)++o;return{from:e.Pos(i,l+1),to:n.clipPos(e.Pos(o))}}))}(r(11036))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[220],{10921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=[],r=e;r&&r.kind;)n.push(r),r=r.prevState;for(var i=n.length-1;i>=0;i--)t(n[i])}},42914:(e,t)=>{function n(e,t){var n=e.filter(t);return 0===n.length?e:n}function r(e){return e.toLowerCase().replace(/\W/g,"")}function i(e,t){var n=function(e,t){var n,r,i=[],a=e.length,l=t.length;for(n=0;n<=a;n++)i[n]=[n];for(r=1;r<=l;r++)i[0][r]=r;for(n=1;n<=a;n++)for(r=1;r<=l;r++){var u=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+u),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+u))}return i[a][l]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a){var l=function(e,t){return t?n(n(e.map((function(e){return{proximity:i(r(e.text),t),entry:e}})),(function(e){return e.proximity<=2})),(function(e){return!e.entry.isDeprecated})).sort((function(e,t){return(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length})).map((function(e){return e.entry})):n(e,(function(e){return!e.isDeprecated}))}(a,r(t.string));if(l){var u=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:l,from:{line:e.line,ch:u},to:{line:e.line,ch:t.end}}}}},7220:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(11036)),a=n(24798),l=r(n(10921)),u=r(n(42914));i.default.registerHelper("hint","graphql-variables",(function(e,t){var n=e.getCursor(),r=e.getTokenAt(n),o=function(e,t,n){var r="Invalid"===t.state.kind?t.state.prevState:t.state,i=r.kind,o=r.step;if("Document"===i&&0===o)return u.default(e,t,[{text:"{"}]);var f=n.variableToType;if(f){var p=function(e,t){var n={type:null,fields:null};return l.default(t,(function(t){if("Variable"===t.kind)n.type=e[t.name];else if("ListValue"===t.kind){var r=n.type?a.getNullableType(n.type):void 0;n.type=r instanceof a.GraphQLList?r.ofType:null}else if("ObjectValue"===t.kind){var i=n.type?a.getNamedType(n.type):void 0;n.fields=i instanceof a.GraphQLInputObjectType?i.getFields():null}else if("ObjectField"===t.kind){var l=t.name&&n.fields?n.fields[t.name]:null;n.type=l&&l.type}})),n}(f,t.state);if("Document"===i||"Variable"===i&&0===o){var s=Object.keys(f);return u.default(e,t,s.map((function(e){return{text:'"'+e+'": ',type:f[e]}})))}if(("ObjectValue"===i||"ObjectField"===i&&0===o)&&p.fields){var c=Object.keys(p.fields).map((function(e){return p.fields[e]}));return u.default(e,t,c.map((function(e){return{text:'"'+e.name+'": ',type:e.type,description:e.description}})))}if("StringValue"===i||"NumberValue"===i||"BooleanValue"===i||"NullValue"===i||"ListValue"===i&&1===o||"ObjectField"===i&&2===o||"Variable"===i&&2===o){var d=p.type?a.getNamedType(p.type):void 0;if(d instanceof a.GraphQLInputObjectType)return u.default(e,t,[{text:"{"}]);if(d instanceof a.GraphQLEnumType){var y=d.getValues();return u.default(e,t,y.map((function(e){return{text:'"'+e.name+'"',type:d,description:e.description}})))}if(d===a.GraphQLBoolean)return u.default(e,t,[{text:"true",type:a.GraphQLBoolean,description:"Not false."},{text:"false",type:a.GraphQLBoolean,description:"Not true."}])}}}(n,r,t);return o&&o.list&&o.list.length>0&&(o.from=i.default.Pos(o.from.line,o.from.ch),o.to=i.default.Pos(o.to.line,o.to.ch),i.default.signal(e,"hasCompletion",e,o,r)),o}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[253],{32253:(e,n,t)=>{!function(e){var n={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},t=e.Pos;function r(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:n[t]}e.defineOption("autoCloseBrackets",!1,(function(n,t,s){s&&s!=e.Init&&(n.removeKeyMap(i),n.state.closeBrackets=null),t&&(a(r(t,"pairs")),n.state.closeBrackets=t,n.addKeyMap(i))}));var i={Backspace:function(n){var i=l(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=r(i,"pairs"),s=n.listSelections(),o=0;o<s.length;o++){if(!s[o].empty())return e.Pass;var c=h(n,s[o].head);if(!c||a.indexOf(c)%2!=0)return e.Pass}for(o=s.length-1;o>=0;o--){var f=s[o].head;n.replaceRange("",t(f.line,f.ch-1),t(f.line,f.ch+1),"+delete")}},Enter:function(n){var t=l(n),i=t&&r(t,"explode");if(!i||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return e.Pass;var c=h(n,a[s].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}n.operation((function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),o(n,-1),a=n.listSelections();for(var t=0;t<a.length;t++){var r=a[t].head.line;n.indentLine(r,null,!0),n.indentLine(r+1,null,!0)}}))}};function a(e){for(var n=0;n<e.length;n++){var t=e.charAt(n),r="'"+t+"'";i[r]||(i[r]=s(t))}}function s(n){return function(i){return function(n,i){var a=l(n);if(!a||n.getOption("disableInput"))return e.Pass;var s=r(a,"pairs"),h=s.indexOf(i);if(-1==h)return e.Pass;for(var u,p=r(a,"closeBefore"),d=r(a,"triples"),g=s.charAt(h+1)==i,v=n.listSelections(),k=h%2==0,b=0;b<v.length;b++){var P,S=v[b],y=S.head,O=n.getRange(y,t(y.line,y.ch+1));if(k&&!S.empty())P="surround";else if(!g&&k||O!=i)if(g&&y.ch>1&&d.indexOf(i)>=0&&n.getRange(t(y.line,y.ch-2),y)==i+i){if(y.ch>2&&/\bstring/.test(n.getTokenTypeAt(t(y.line,y.ch-2))))return e.Pass;P="addFour"}else if(g){var x=0==y.ch?" ":n.getRange(t(y.line,y.ch-1),y);if(e.isWordChar(O)||x==i||e.isWordChar(x))return e.Pass;P="both"}else{if(!k||!(0===O.length||/\s/.test(O)||p.indexOf(O)>-1))return e.Pass;P="both"}else P=g&&f(n,y)?"both":d.indexOf(i)>=0&&n.getRange(y,t(y.line,y.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=P)return e.Pass}else u=P}var A=h%2?s.charAt(h-1):i,B=h%2?i:s.charAt(h+1);n.operation((function(){if("skip"==u)o(n,1);else if("skipThree"==u)o(n,3);else if("surround"==u){for(var e=n.getSelections(),t=0;t<e.length;t++)e[t]=A+e[t]+B;for(n.replaceSelections(e,"around"),e=n.listSelections().slice(),t=0;t<e.length;t++)e[t]=c(e[t]);n.setSelections(e)}else"both"==u?(n.replaceSelection(A+B,null),n.triggerElectric(A+B),o(n,-1)):"addFour"==u&&(n.replaceSelection(A+A+A+A,"before"),o(n,1))}))}(i,n)}}function l(e){var n=e.state.closeBrackets;return!n||n.override?n:e.getModeAt(e.getCursor()).closeBrackets||n}function o(e,n){for(var t=[],r=e.listSelections(),i=0,a=0;a<r.length;a++){var s=r[a];s.head==e.getCursor()&&(i=a);var l=s.head.ch||n>0?{line:s.head.line,ch:s.head.ch+n}:{line:s.head.line-1};t.push({anchor:l,head:l})}e.setSelections(t,i)}function c(n){var r=e.cmpPos(n.anchor,n.head)>0;return{anchor:new t(n.anchor.line,n.anchor.ch+(r?-1:1)),head:new t(n.head.line,n.head.ch+(r?1:-1))}}function h(e,n){var r=e.getRange(t(n.line,n.ch-1),t(n.line,n.ch+1));return 2==r.length?r:null}function f(e,n){var r=e.getTokenAt(t(n.line,n.ch+1));return/\bstring/.test(r.type)&&r.start==n.ch&&(0==n.ch||!/\bstring/.test(e.getTokenTypeAt(n)))}a(n.pairs+"`")}(t(11036))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[280],{36280:(t,e,i)=>{!function(t){"use strict";function e(t,e){if(this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var i=this;t.on("cursorActivity",this.activityFunc=function(){i.cursorActivity()})}}t.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var o in i)n[o]=i[o];return t.showHint(n)},t.defineExtension("showHint",(function(i){i=function(t,e,i){var n=t.options.hintOptions,o={};for(var s in l)o[s]=l[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(i)for(var s in i)void 0!==i[s]&&(o[s]=i[s]);return o.hint.resolve&&(o.hint=o.hint.resolve(t,e)),o}(this,this.getCursor("start"),i);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!i.hint.supportsSelection)return;for(var o=0;o<n.length;o++)if(n[o].head.line!=n[o].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new e(this,i);s.options.hint&&(t.signal(this,"startCompletion",this),s.update(!0))}})),t.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var i=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function o(t){return"string"==typeof t?t:t.text}function s(t,e){for(;e&&e!=t;){if("LI"===e.nodeName.toUpperCase()&&e.parentNode==t)return e;e=e.parentNode}}function c(e,i){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=e,this.data=i,this.picked=!1;var n=this,c=e.cm,r=c.getInputField().ownerDocument,l=r.defaultView||r.parentWindow,h=this.hints=r.createElement("ul");h.setAttribute("role","listbox"),h.setAttribute("aria-expanded","true"),h.id=this.id;var a=e.cm.options.theme;h.className="CodeMirror-hints "+a,this.selectedHint=i.selectedHint||0;for(var u=i.list,d=0;d<u.length;++d){var f=h.appendChild(r.createElement("li")),p=u[d],m="CodeMirror-hint"+(d!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(m=p.className+" "+m),f.className=m,d==this.selectedHint&&f.setAttribute("aria-selected","true"),f.id=this.id+"-"+d,f.setAttribute("role","option"),p.render?p.render(f,i,p):f.appendChild(r.createTextNode(p.displayText||o(p))),f.hintId=d}var g=e.options.container||r.body,v=c.cursorCoords(e.options.alignWithWord?i.from:null),y=v.left,w=v.bottom,b=!0,A=0,H=0;if(g!==r.body){var C=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,k=C.getBoundingClientRect(),S=r.body.getBoundingClientRect();A=k.left-S.left-C.scrollLeft,H=k.top-S.top-C.scrollTop}h.style.left=y-A+"px",h.style.top=w-H+"px";var x=l.innerWidth||Math.max(r.body.offsetWidth,r.documentElement.offsetWidth),T=l.innerHeight||Math.max(r.body.offsetHeight,r.documentElement.offsetHeight);g.appendChild(h),c.getInputField().setAttribute("aria-autocomplete","list"),c.getInputField().setAttribute("aria-owns",this.id),c.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var F,M=e.options.moveOnOverlap?h.getBoundingClientRect():new DOMRect,O=!!e.options.paddingForScrollbar&&h.scrollHeight>h.clientHeight+1;if(setTimeout((function(){F=c.getScrollInfo()})),M.bottom-T>0){var N=M.bottom-M.top;if(v.top-(v.bottom-M.top)-N>0)h.style.top=(w=v.top-N-H)+"px",b=!1;else if(N>T){h.style.height=T-5+"px",h.style.top=(w=v.bottom-M.top-H)+"px";var I=c.getCursor();i.from.ch!=I.ch&&(v=c.cursorCoords(I),h.style.left=(y=v.left-A)+"px",M=h.getBoundingClientRect())}}var P,E=M.right-x;if(O&&(E+=c.display.nativeBarWidth),E>0&&(M.right-M.left>x&&(h.style.width=x-5+"px",E-=M.right-M.left-x),h.style.left=(y=v.left-E-A)+"px"),O)for(var W=h.firstChild;W;W=W.nextSibling)W.style.paddingRight=c.display.nativeBarWidth+"px";c.addKeyMap(this.keyMap=function(t,e){var i={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(1-e.menuSize(),!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close};/Mac/.test(navigator.platform)&&(i["Ctrl-P"]=function(){e.moveFocus(-1)},i["Ctrl-N"]=function(){e.moveFocus(1)});var n=t.options.customKeys,o=n?{}:i;function s(t,n){var s;s="string"!=typeof n?function(t){return n(t,e)}:i.hasOwnProperty(n)?i[n]:n,o[t]=s}if(n)for(var c in n)n.hasOwnProperty(c)&&s(c,n[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&s(c,r[c]);return o}(e,{moveFocus:function(t,e){n.changeActive(n.selectedHint+t,e)},setFocus:function(t){n.changeActive(t)},menuSize:function(){return n.screenAmount()},length:u.length,close:function(){e.close()},pick:function(){n.pick()},data:i})),e.options.closeOnUnfocus&&(c.on("blur",this.onBlur=function(){P=setTimeout((function(){e.close()}),100)}),c.on("focus",this.onFocus=function(){clearTimeout(P)})),c.on("scroll",this.onScroll=function(){var t=c.getScrollInfo(),i=c.getWrapperElement().getBoundingClientRect();F||(F=c.getScrollInfo());var n=w+F.top-t.top,o=n-(l.pageYOffset||(r.documentElement||r.body).scrollTop);if(b||(o+=h.offsetHeight),o<=i.top||o>=i.bottom)return e.close();h.style.top=n+"px",h.style.left=y+F.left-t.left+"px"}),t.on(h,"dblclick",(function(t){var e=s(h,t.target||t.srcElement);e&&null!=e.hintId&&(n.changeActive(e.hintId),n.pick())})),t.on(h,"click",(function(t){var i=s(h,t.target||t.srcElement);i&&null!=i.hintId&&(n.changeActive(i.hintId),e.options.completeOnSingleClick&&n.pick())})),t.on(h,"mousedown",(function(){setTimeout((function(){c.focus()}),20)}));var R=this.getSelectedHintRange();return 0===R.from&&0===R.to||this.scrollToActive(),t.signal(i,"select",u[this.selectedHint],h.childNodes[this.selectedHint]),!0}function r(t,e,i,n){if(t.async)t(e,n,i);else{var o=t(e,i);o&&o.then?o.then(n):n(o)}}e.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,i){var n=e.list[i],s=this;this.cm.operation((function(){n.hint?n.hint(s.cm,e,n):s.cm.replaceRange(o(n),n.from||e.from,n.to||e.to,"complete"),t.signal(e,"pick",n),s.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),o=this.cm.getLine(e.line);if(e.line!=this.startPos.line||o.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(o.charAt(e.ch-1)))this.close();else{var s=this;this.debounce=i((function(){s.update()})),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick){var e=this,i=++this.tick;r(this.options.hint,this.cm,this.options,(function(n){e.tick==i&&e.finishUpdate(n,t)}))}},finishUpdate:function(e,i){this.data&&t.signal(this.data,"update");var n=this.widget&&this.widget.picked||i&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(n&&1==e.list.length?this.pick(e,0):(this.widget=new c(this,e),t.signal(e,"shown")))}},c.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm.getInputField();t.removeAttribute("aria-activedescendant"),t.removeAttribute("aria-owns");var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(e,i){if(e>=this.data.list.length?e=i?this.data.list.length-1:0:e<0&&(e=i?0:this.data.list.length-1),this.selectedHint!=e){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active",""),n.removeAttribute("aria-selected")),(n=this.hints.childNodes[this.selectedHint=e]).className+=" CodeMirror-hint-active",n.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",n.id),this.scrollToActive(),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var t=this.getSelectedHintRange(),e=this.hints.childNodes[t.from],i=this.hints.childNodes[t.to],n=this.hints.firstChild;e.offsetTop<this.hints.scrollTop?this.hints.scrollTop=e.offsetTop-n.offsetTop:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var t=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-t),to:Math.min(this.data.list.length-1,this.selectedHint+t)}}},t.registerHelper("hint","auto",{resolve:function(e,i){var n,o=e.getHelpers(i,"hint");if(o.length){var s=function(t,e,i){var n=function(t,e){if(!t.somethingSelected())return e;for(var i=[],n=0;n<e.length;n++)e[n].supportsSelection&&i.push(e[n]);return i}(t,o);!function o(s){if(s==n.length)return e(null);r(n[s],t,i,(function(t){t&&t.list.length>0?e(t):o(s+1)}))}(0)};return s.async=!0,s.supportsSelection=!0,s}return(n=e.getHelper(e.getCursor(),"hintWords"))?function(e){return t.hint.fromList(e,{words:n})}:t.hint.anyword?function(e,i){return t.hint.anyword(e,i)}:function(){}}}),t.registerHelper("hint","fromList",(function(e,i){var n,o=e.getCursor(),s=e.getTokenAt(o),c=t.Pos(o.line,s.start),r=o;s.start<o.ch&&/\w/.test(s.string.charAt(o.ch-s.start-1))?n=s.string.substr(0,o.ch-s.start):(n="",c=o);for(var l=[],h=0;h<i.words.length;h++){var a=i.words[h];a.slice(0,n.length)==n&&l.push(a)}if(l.length)return{list:l,from:c,to:r}})),t.commands.autocomplete=t.showHint;var l={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};t.defineOption("hintOptions",null)}(i(11036))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[287],{62702:(o,t,n)=>{!function(o){"use strict";function t(t,n,r,i){if(r&&r.call){var f=r;r=null}else f=e(t,r,"rangeFinder");"number"==typeof n&&(n=o.Pos(n,0));var l=e(t,r,"minFoldSize");function a(o){var e=f(t,n);if(!e||e.to.line-e.from.line<l)return null;if("fold"===i)return e;for(var r=t.findMarksAt(e.from),a=0;a<r.length;++a)if(r[a].__isFold){if(!o)return null;e.cleared=!0,r[a].clear()}return e}var d=a(!0);if(e(t,r,"scanUp"))for(;!d&&n.line>t.firstLine();)n=o.Pos(n.line-1,0),d=a(!1);if(d&&!d.cleared&&"unfold"!==i){var u=function(o,t,n){var r=e(o,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var i=document.createTextNode(r);(r=document.createElement("span")).appendChild(i),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}(t,r,d);o.on(u,"mousedown",(function(t){c.clear(),o.e_preventDefault(t)}));var c=t.markText(d.from,d.to,{replacedWith:u,clearOnEnter:e(t,r,"clearOnEnter"),__isFold:!0});c.on("clear",(function(n,e){o.signal(t,"unfold",t,n,e)})),o.signal(t,"fold",t,d.from,d.to)}}o.newFoldFunction=function(o,n){return function(e,r){t(e,r,{rangeFinder:o,widget:n})}},o.defineExtension("foldCode",(function(o,n,e){t(this,o,n,e)})),o.defineExtension("isFolded",(function(o){for(var t=this.findMarksAt(o),n=0;n<t.length;++n)if(t[n].__isFold)return!0})),o.commands.toggleFold=function(o){o.foldCode(o.getCursor())},o.commands.fold=function(o){o.foldCode(o.getCursor(),null,"fold")},o.commands.unfold=function(o){o.foldCode(o.getCursor(),{scanUp:!1},"unfold")},o.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),e=t.lastLine();n<=e;n++)t.foldCode(o.Pos(n,0),{scanUp:!1},"fold")}))},o.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),e=t.lastLine();n<=e;n++)t.foldCode(o.Pos(n,0),{scanUp:!1},"unfold")}))},o.registerHelper("fold","combine",(function(){var o=Array.prototype.slice.call(arguments,0);return function(t,n){for(var e=0;e<o.length;++e){var r=o[e](t,n);if(r)return r}}})),o.registerHelper("fold","auto",(function(o,t){for(var n=o.getHelpers(t,"fold"),e=0;e<n.length;e++){var r=n[e](o,t);if(r)return r}}));var n={rangeFinder:o.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function e(o,t,e){if(t&&void 0!==t[e])return t[e];var r=o.options.foldOptions;return r&&void 0!==r[e]?r[e]:n[e]}o.defineOption("foldOptions",null),o.defineExtension("foldOption",(function(o,t){return e(this,o,t)}))}(n(11036))},16287:(o,t,n)=>{!function(o){"use strict";o.defineOption("foldGutter",!1,(function(t,e,r){var i;r&&r!=o.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",a),t.off("changes",d),t.off("viewportChange",u),t.off("fold",c),t.off("unfold",c),t.off("swapDoc",d)),e&&(t.state.foldGutter=new n((!0===(i=e)&&(i={}),null==i.gutter&&(i.gutter="CodeMirror-foldgutter"),null==i.indicatorOpen&&(i.indicatorOpen="CodeMirror-foldgutter-open"),null==i.indicatorFolded&&(i.indicatorFolded="CodeMirror-foldgutter-folded"),i)),l(t),t.on("gutterClick",a),t.on("changes",d),t.on("viewportChange",u),t.on("fold",c),t.on("unfold",c),t.on("swapDoc",d))}));var t=o.Pos;function n(o){this.options=o,this.from=this.to=0}function e(o,n){for(var e=o.findMarks(t(n,0),t(n+1,0)),r=0;r<e.length;++r)if(e[r].__isFold){var i=e[r].find(-1);if(i&&i.line===n)return e[r]}}function r(o){if("string"==typeof o){var t=document.createElement("div");return t.className=o+" CodeMirror-guttermarker-subtle",t}return o.cloneNode(!0)}function i(o,n,i){var l=o.state.foldGutter.options,a=n-1,d=o.foldOption(l,"minFoldSize"),u=o.foldOption(l,"rangeFinder"),c="string"==typeof l.indicatorFolded&&f(l.indicatorFolded),s="string"==typeof l.indicatorOpen&&f(l.indicatorOpen);o.eachLine(n,i,(function(n){++a;var i=null,f=n.gutterMarkers;if(f&&(f=f[l.gutter]),e(o,a)){if(c&&f&&c.test(f.className))return;i=r(l.indicatorFolded)}else{var p=t(a,0),m=u&&u(o,p);if(m&&m.to.line-m.from.line>=d){if(s&&f&&s.test(f.className))return;i=r(l.indicatorOpen)}}(i||f)&&o.setGutterMarker(n,l.gutter,i)}))}function f(o){return new RegExp("(^|\\s)"+o+"(?:$|\\s)\\s*")}function l(o){var t=o.getViewport(),n=o.state.foldGutter;n&&(o.operation((function(){i(o,t.from,t.to)})),n.from=t.from,n.to=t.to)}function a(o,n,r){var i=o.state.foldGutter;if(i){var f=i.options;if(r==f.gutter){var l=e(o,n);l?l.clear():o.foldCode(t(n,0),f)}}}function d(o){var t=o.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){l(o)}),n.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=o.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?l(o):o.operation((function(){n.from<t.from&&(i(o,n.from,t.from),t.from=n.from),n.to>t.to&&(i(o,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function c(o,t){var n=o.state.foldGutter;if(n){var e=t.line;e>=n.from&&e<n.to&&i(o,e,e+1)}}}(n(11036),n(62702))}}]);
|