cloudstudio
Version:
Run VS Code on a remote server.
2 lines • 14.3 kB
JavaScript
(()=>{"use strict";var e={800:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.localize=t.format=t.setPseudo=t.isPseudo=t.isString=t.isNumber=t.isDefined=t.BundleFormat=t.MessageFormat=void 0;var o,r,s,i=n(926);function a(e){return void 0!==e}(s=t.MessageFormat||(t.MessageFormat={})).file="file",s.bundle="bundle",s.both="both",(r=t.BundleFormat||(t.BundleFormat={})).standalone="standalone",r.languagePack="languagePack",function(e){e.is=function(e){var t=e;return t&&a(t.key)&&a(t.comment)}}(o||(o={})),t.isDefined=a;var l=Object.prototype.toString;function c(e,n){return t.isPseudo&&(e="["+e.replace(/[aouei]/g,"$&$&")+"]"),0===n.length?e:e.replace(/\{(\d+)\}/g,(function(e,t){var o=t[0],r=n[o],s=e;return"string"==typeof r?s=r:"number"!=typeof r&&"boolean"!=typeof r&&null!=r||(s=String(r)),s}))}t.isNumber=function(e){return"[object Number]"===l.call(e)},t.isString=function(e){return"[object String]"===l.call(e)},t.isPseudo=!1,t.setPseudo=function(e){t.isPseudo=e},t.format=c,t.localize=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return c(t,n)},t.loadMessageBundle=function(e){return(0,i.default)().loadMessageBundle(e)},t.config=function(e){return(0,i.default)().config(e)}},926:(e,t)=>{var n;function o(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(o||(o={})),t.default=o},472:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.BundleFormat=t.MessageFormat=void 0;var o,r,s=n(622),i=n(747),a=n(926),l=n(800),c=n(800);function u(e){return JSON.parse(i.readFileSync(e,"utf8"))}function d(e){return function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return(0,l.isNumber)(t)?t>=e.length?void console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: ".concat(new Error("").stack)):(0,l.format)(e[t],o):(0,l.isString)(n)?(console.warn("Message ".concat(n," didn't get externalized correctly.")),(0,l.format)(n,o)):void console.error("Broken localize call found. Stacktrace is\n: ".concat(new Error("").stack))}}function g(e,t){return o[e]=t,t}function f(e){try{return function(e){var t=u(s.join(e,"nls.metadata.json")),n=Object.create(null);for(var o in t){var r=t[o];n[o]=r.messages}return n}(e)}catch(e){return void console.log("Generating default bundle from meta data failed.",e)}}function p(e,t){var n;if(!0===r.languagePackSupport&&void 0!==r.cacheRoot&&void 0!==r.languagePackId&&void 0!==r.translationsConfigFile&&void 0!==r.translationsConfig)try{n=function(e,t){var n,o,a,c=s.join(r.cacheRoot,"".concat(e.id,"-").concat(e.hash,".json")),d=!1,g=!1;try{return n=JSON.parse(i.readFileSync(c,{encoding:"utf8",flag:"r"})),o=c,a=new Date,i.utimes(o,a,a,(function(){})),n}catch(e){if("ENOENT"===e.code)g=!0;else{if(!(e instanceof SyntaxError))throw e;console.log("Syntax error parsing message bundle: ".concat(e.message,".")),i.unlink(c,(function(e){e&&console.error("Deleting corrupted bundle ".concat(c," failed."))})),d=!0}}if(!(n=function(e,t){var n=r.translationsConfig[e.id];if(n){var o=u(n).contents,i=u(s.join(t,"nls.metadata.json")),a=Object.create(null);for(var c in i){var d=i[c],g=o["".concat(e.outDir,"/").concat(c)];if(g){for(var f=[],p=0;p<d.keys.length;p++){var v=d.keys[p],h=g[(0,l.isString)(v)?v:v.key];void 0===h&&(h=d.messages[p]),f.push(h)}a[c]=f}else a[c]=d.messages}return a}}(e,t))||d)return n;if(g)try{i.writeFileSync(c,JSON.stringify(n),{encoding:"utf8",flag:"wx"})}catch(e){if("EEXIST"===e.code)return n;throw e}return n}(e,t)}catch(e){console.log("Load or create bundle failed ",e)}if(!n){if(r.languagePackSupport)return f(t);var o=function(e){for(var t=r.language;t;){var n=s.join(e,"nls.bundle.".concat(t,".json"));if(i.existsSync(n))return n;var o=t.lastIndexOf("-");t=o>0?t.substring(0,o):void 0}if(void 0===t&&(n=s.join(e,"nls.bundle.json"),i.existsSync(n)))return n}(t);if(o)try{return u(o)}catch(e){console.log("Loading in the box message bundle failed.",e)}n=f(t)}return n}function v(e){if(!e)return l.localize;var t=s.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),r.messageFormat===l.MessageFormat.both||r.messageFormat===l.MessageFormat.bundle){var n=function(e){for(var t,n=s.dirname(e);t=s.join(n,"nls.metadata.header.json"),!i.existsSync(t);){var o=s.dirname(n);if(o===n){t=void 0;break}n=o}return t}(e);if(n){var a=s.dirname(n),c=o[a];if(void 0===c)try{var f=JSON.parse(i.readFileSync(n,"utf8"));try{var v=p(f,a);c=g(a,v?{header:f,nlsBundle:v}:null)}catch(e){console.error("Failed to load nls bundle",e),c=g(a,null)}}catch(e){console.error("Failed to read header file",e),c=g(a,null)}if(c){var h=e.substr(a.length+1).replace(/\\/g,"/"),m=c.nlsBundle[h];return void 0===m?(console.error("Messages for file ".concat(e," not found. See console for details.")),function(){return"Messages not found."}):d(m)}}}if(r.messageFormat===l.MessageFormat.both||r.messageFormat===l.MessageFormat.file)try{var w=u(function(e){var t;if(r.cacheLanguageResolution&&t)t=t;else{if(l.isPseudo||!r.language)t=".nls.json";else for(var n=r.language;n;){var o=".nls."+n+".json";if(i.existsSync(e+o)){t=o;break}var s=n.lastIndexOf("-");s>0?n=n.substring(0,s):(t=".nls.json",n=null)}r.cacheLanguageResolution&&(t=t)}return e+t}(e));return Array.isArray(w)?d(w):(0,l.isDefined)(w.messages)&&(0,l.isDefined)(w.keys)?d(w.messages):(console.error("String bundle '".concat(e,"' uses an unsupported format.")),function(){return"File bundle has unsupported format. See console for details"})}catch(e){"ENOENT"!==e.code&&console.error("Failed to load single file bundle",e)}return console.error("Failed to load message bundle for file ".concat(e)),function(){return"Failed to load message bundle. See console for details."}}function h(e){return e&&((0,l.isString)(e.locale)&&(r.locale=e.locale.toLowerCase(),r.language=r.locale,o=Object.create(null)),void 0!==e.messageFormat&&(r.messageFormat=e.messageFormat),e.bundleFormat===l.BundleFormat.standalone&&!0===r.languagePackSupport&&(r.languagePackSupport=!1)),(0,l.setPseudo)("pseudo"===r.locale),v}Object.defineProperty(t,"MessageFormat",{enumerable:!0,get:function(){return c.MessageFormat}}),Object.defineProperty(t,"BundleFormat",{enumerable:!0,get:function(){return c.BundleFormat}}),function(){if(r={locale:void 0,language:void 0,languagePackSupport:!1,cacheLanguageResolution:!0,messageFormat:l.MessageFormat.bundle},(0,l.isString)(process.env.VSCODE_NLS_CONFIG))try{var e=JSON.parse(process.env.VSCODE_NLS_CONFIG),t=void 0;if(e.availableLanguages){var n=e.availableLanguages["*"];(0,l.isString)(n)&&(t=n)}if((0,l.isString)(e.locale)&&(r.locale=e.locale.toLowerCase()),void 0===t?r.language=r.locale:"en"!==t&&(r.language=t),function(e){return!0===e||!1===e}(e._languagePackSupport)&&(r.languagePackSupport=e._languagePackSupport),(0,l.isString)(e._cacheRoot)&&(r.cacheRoot=e._cacheRoot),(0,l.isString)(e._languagePackId)&&(r.languagePackId=e._languagePackId),(0,l.isString)(e._translationsConfigFile)){r.translationsConfigFile=e._translationsConfigFile;try{r.translationsConfig=u(r.translationsConfigFile)}catch(t){if(e._corruptedFile){var a=s.dirname(e._corruptedFile);i.exists(a,(function(t){t&&i.writeFile(e._corruptedFile,"corrupted","utf8",(function(e){console.error(e)}))}))}}}}catch(e){}(0,l.setPseudo)("pseudo"===r.locale),o=Object.create(null)}(),t.loadMessageBundle=v,t.config=h,a.default.install(Object.freeze({loadMessageBundle:v,config:h}))},363:(e,t)=>{function n(e){for(;e.length;)e.pop()?.dispose()}Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=t.disposeAll=void 0,t.disposeAll=n,t.Disposable=class{constructor(){this._isDisposed=!1,this._disposables=[]}dispose(){this._isDisposed||(this._isDisposed=!0,n(this._disposables))}_register(e){return this._isDisposed?e.dispose():this._disposables.push(e),e}get isDisposed(){return this._isDisposed}}},162:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleBrowserManager=void 0;const o=n(410);t.SimpleBrowserManager=class{constructor(e){this.extensionUri=e}dispose(){this._activeView?.dispose(),this._activeView=void 0}show(e,t){if(this._activeView)this._activeView.show(e,t);else{const n=o.SimpleBrowserView.create(this.extensionUri,e,t);this.registerWebviewListeners(n),this._activeView=n}}restore(e,t){const n=t?.url??"",r=o.SimpleBrowserView.restore(this.extensionUri,n,e);this.registerWebviewListeners(r)}registerWebviewListeners(e){e.onDispose((()=>{this._activeView===e&&(this._activeView=void 0)}))}}},410:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleBrowserView=void 0;const o=n(549),r=n(472),s=n(363),i=r.loadMessageBundle(n(622).join(__dirname,"simpleBrowserView.ts"));class a extends s.Disposable{constructor(e,t,n){super(),this.extensionUri=e,this._onDidDispose=this._register(new o.EventEmitter),this.onDispose=this._onDidDispose.event,this._webviewPanel=this._register(n),this._register(this._webviewPanel.webview.onDidReceiveMessage((e=>{switch(e.type){case"openExternal":try{const t=o.Uri.parse(e.url);o.env.openExternal(t)}catch{}}}))),this._register(this._webviewPanel.onDidDispose((()=>{this.dispose()}))),this._register(o.workspace.onDidChangeConfiguration((e=>{if(e.affectsConfiguration("simpleBrowser.focusLockIndicator.enabled")){const e=o.workspace.getConfiguration("simpleBrowser");this._webviewPanel.webview.postMessage({type:"didChangeFocusLockIndicatorEnabled",focusLockEnabled:e.get("focusLockIndicator.enabled",!0)})}}))),this.show(t)}static create(e,t,n){const r=o.window.createWebviewPanel(a.viewType,a.title,{viewColumn:n?.viewColumn??o.ViewColumn.Active,preserveFocus:n?.preserveFocus},{enableScripts:!0,enableForms:!0,retainContextWhenHidden:!0,localResourceRoots:[o.Uri.joinPath(e,"media")]});return new a(e,t,r)}static restore(e,t,n){return new a(e,t,n)}dispose(){this._onDidDispose.fire(),super.dispose()}show(e,t){this._webviewPanel.webview.html=this.getHtml(e),this._webviewPanel.reveal(t?.viewColumn,t?.preserveFocus)}getHtml(e){const t=o.workspace.getConfiguration("simpleBrowser"),n=function(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<64;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}(),r=this.extensionResourceUrl("media","index.js"),s=this.extensionResourceUrl("media","main.css"),a=this.extensionResourceUrl("media","codicon.css");return`<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta http-equiv="Content-type" content="text/html;charset=UTF-8">\n\t\t\t\t<meta http-equiv="Content-Security-Policy" content="\n\t\t\t\t\tdefault-src 'none';\n\t\t\t\t\tfont-src ${this._webviewPanel.webview.cspSource};\n\t\t\t\t\tstyle-src ${this._webviewPanel.webview.cspSource};\n\t\t\t\t\tscript-src 'nonce-${n}';\n\t\t\t\t\tframe-src *;\n\t\t\t\t\t">\n\t\t\t\t<meta id="simple-browser-settings" data-settings="${l=JSON.stringify({url:e,focusLockEnabled:t.get("focusLockIndicator.enabled",!0)}),l.toString().replace(/"/g,""")}">\n\t\t\t\t<link rel="stylesheet" type="text/css" href="${s}">\n\t\t\t\t<link rel="stylesheet" type="text/css" href="${a}">\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<header class="header">\n\t\t\t\t\t<nav class="controls">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${i(0,null)}"\n\t\t\t\t\t\t\tclass="back-button icon"><i class="codicon codicon-arrow-left"></i></button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${i(1,null)}"\n\t\t\t\t\t\t\tclass="forward-button icon"><i class="codicon codicon-arrow-right"></i></button>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${i(2,null)}"\n\t\t\t\t\t\t\tclass="reload-button icon"><i class="codicon codicon-refresh"></i></button>\n\t\t\t\t\t</nav>\n\t\t\t\t\t<input class="url-input" type="text">\n\t\t\t\t\t<nav class="controls">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttitle="${i(3,null)}"\n\t\t\t\t\t\t\tclass="open-external-button icon"><i class="codicon codicon-link-external"></i></button>\n\t\t\t\t\t</nav>\n\t\t\t\t</header>\n\t\t\t\t<div class="content">\n\t\t\t\t\t<div class="iframe-focused-alert">${i(4,null)}</div>\n\t\t\t\t\t<iframe sandbox="allow-scripts allow-forms allow-same-origin"></iframe>\n\t\t\t\t</div>\n\t\t\t\t<script src="${r}" nonce="${n}"><\/script>\n\t\t\t</body>\n\t\t\t</html>`;var l}extensionResourceUrl(...e){return this._webviewPanel.webview.asWebviewUri(o.Uri.joinPath(this.extensionUri,...e))}}t.SimpleBrowserView=a,a.viewType="simpleBrowser.view",a.title=i(5,null)},747:e=>{e.exports=require("fs")},622:e=>{e.exports=require("path")},549:e=>{e.exports=require("vscode")}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}var o={};(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.activate=void 0;const t=n(549),r=n(472),s=n(162),i=n(410),a=r.loadMessageBundle(n(622).join(__dirname,"extension.ts")),l=new Set(["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1","0.0.0.0","0:0:0:0:0:0:0:0","::"]);e.activate=function(e){const n=new s.SimpleBrowserManager(e.extensionUri);e.subscriptions.push(n),e.subscriptions.push(t.window.registerWebviewPanelSerializer(i.SimpleBrowserView.viewType,{deserializeWebviewPanel:async(e,t)=>{n.restore(e,t)}})),e.subscriptions.push(t.commands.registerCommand("simpleBrowser.show",(async e=>{e||(e=await t.window.showInputBox({placeHolder:a(0,null),prompt:a(1,null)})),e&&n.show(e)}))),e.subscriptions.push(t.commands.registerCommand("simpleBrowser.api.open",((e,t)=>{n.show(e.toString(),t)}))),e.subscriptions.push(t.window.registerExternalUriOpener("simpleBrowser.open",{canOpenExternalUri(e){const n=new URL(e.toString());return l.has(n.hostname)?"undefined"!=typeof navigator&&t.env.uiKind===t.UIKind.Web?t.ExternalUriOpenerPriority.Default:t.ExternalUriOpenerPriority.Option:t.ExternalUriOpenerPriority.None},openExternalUri:e=>n.show(e.toString(),{viewColumn:t.window.activeTextEditor?t.ViewColumn.Beside:t.ViewColumn.Active})},{schemes:["http","https"],label:a(2,null)}))}})();var r=exports;for(var s in o)r[s]=o[s];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/a711c3b7ecbf5dae1e178a62074ae55c6a2930fe/extensions/simple-browser/dist/extension.js.map