sliccy 2.36.0 → 2.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/ui/assets/adobe-B5G0-uG7.js +1 -0
- package/dist/ui/assets/agent-bridge-DmnakcIu.js +1 -0
- package/dist/ui/assets/anthropic-BmQFpBdl.js +39 -0
- package/dist/ui/assets/azure-ai-foundry-DVqxYCDH.js +1 -0
- package/dist/ui/assets/azure-openai-YsU1Qwa0.js +1 -0
- package/dist/ui/assets/azure-openai-responses-MhMiFqpj.js +1 -0
- package/dist/ui/assets/bedrock-camp-Bfjhqqf1.js +4 -0
- package/dist/ui/assets/cdp-BrJRSYts.js +880 -0
- package/dist/ui/assets/cost-command-D71Njxd7.js +1 -0
- package/dist/ui/assets/{dist-DDaqk4vO.js → dist-9z8P-p4z.js} +1 -1
- package/dist/ui/assets/{dist-9WxiJAzp.js → dist-AKkMKegp.js} +1 -1
- package/dist/ui/assets/{dist-DJJ5BcAp.js → dist-ANJCbHMD.js} +1 -1
- package/dist/ui/assets/{dist-DJjqNd_E.js → dist-yvpVc8xu.js} +1 -1
- package/dist/ui/assets/fs-CNwG-SWt.js +4 -0
- package/dist/ui/assets/git-config-47_ySgKl.js +5 -0
- package/dist/ui/assets/github-g2DvU5Bq.js +2 -0
- package/dist/ui/assets/{google-DJ1kMeXe.js → google-BYqVCRpp.js} +1 -1
- package/dist/ui/assets/{google-vertex-DPJqyDyu.js → google-vertex-PR1FZzCw.js} +1 -1
- package/dist/ui/assets/index-BwXd759y.js +1443 -0
- package/dist/ui/assets/js-realm-worker-1pc5_MyD.js +1 -0
- package/dist/ui/assets/kernel-worker-T6WVB03A.js +7484 -0
- package/dist/ui/assets/local-llm-C_8P4JFB.js +2 -0
- package/dist/ui/assets/magick-wasm-Dikn8mQQ.js +1 -0
- package/dist/ui/assets/{mime-types-D4mOIoVQ.js → mime-types-DL940yDZ.js} +1 -1
- package/dist/ui/assets/{mistral-Clv1vY4u.js → mistral-CDi6doNp.js} +1 -1
- package/dist/ui/assets/mount-DqlYdKCz.js +2 -0
- package/dist/ui/assets/mount-picker-popup-BLHoVG3y.js +1 -0
- package/dist/ui/assets/offscreen-client-C-eO0M8j.js +1 -0
- package/dist/ui/assets/{onboarding-orchestrator-DjdxW5za.js → onboarding-orchestrator-D8HgmRs-.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-BwBpHk__.js → openai-codex-responses-DZCabvyg.js} +2 -2
- package/dist/ui/assets/openai-completions-CkHPsSUY.js +5 -0
- package/dist/ui/assets/openai-responses-BeScytpz.js +1 -0
- package/dist/ui/assets/page-storage-sync-2rMnxQPr.js +1 -0
- package/dist/ui/assets/provider-settings-DqBn0YRV.js +2 -0
- package/dist/ui/assets/py-realm-worker-C_uxhdB2.js +25 -0
- package/dist/ui/assets/remote-terminal-view-vwYWuPgI.js +5 -0
- package/dist/ui/assets/{slicc-editor-BWGDW6YU.js → slicc-editor-CET-quVI.js} +2 -2
- package/dist/ui/assets/spawn-gY8Dj4HL.js +1 -0
- package/dist/ui/assets/tray-follower-status-O2aOn13V.js +1 -0
- package/dist/ui/index.html +13 -24
- package/dist/ui/packages/webapp/index.html +13 -24
- package/package.json +2 -2
- package/dist/ui/assets/__vite-browser-external-B-U7N2L4.js +0 -1
- package/dist/ui/assets/anthropic-CEmE5n-q.js +0 -39
- package/dist/ui/assets/azure-openai-responses-DvNwPgO2.js +0 -1
- package/dist/ui/assets/browser-Bx8plGqi.js +0 -1
- package/dist/ui/assets/bsh-watchdog-D2IOkdFT.js +0 -42
- package/dist/ui/assets/db-UiVJ_81p.js +0 -1
- package/dist/ui/assets/dist-B7jV583z.js +0 -4
- package/dist/ui/assets/es-CbKtNBmS.js +0 -36
- package/dist/ui/assets/fs-DD0Q7cyC.js +0 -4
- package/dist/ui/assets/git-config-CrkeZAt9.js +0 -7
- package/dist/ui/assets/index-DSvcd4se.js +0 -7786
- package/dist/ui/assets/lick-manager-proxy-CogaR9kt.js +0 -1
- package/dist/ui/assets/magick-wasm-Bq3dEoCR.js +0 -1
- package/dist/ui/assets/mount-id-D-aIZ7cM.js +0 -1
- package/dist/ui/assets/mount-qnPXtspu.js +0 -1
- package/dist/ui/assets/mount-table-store-Nn99HagS.js +0 -1
- package/dist/ui/assets/offscreen-client-9u5_FSsc.js +0 -1
- package/dist/ui/assets/openai-completions-yMCfD-ZQ.js +0 -5
- package/dist/ui/assets/openai-responses-BTAnGLek.js +0 -1
- package/dist/ui/assets/pdfjs-BoIgQO-R.js +0 -54
- package/dist/ui/assets/provider-settings-CUaP23bT.js +0 -96
- package/dist/ui/assets/pyodide-O3MDgCSV.js +0 -4
- package/dist/ui/assets/remote-cache-B04zkF5q.js +0 -1
- package/dist/ui/assets/secret-masking-Bg1u5YcF.js +0 -1
- package/dist/ui/assets/skills-B0ehYakX.js +0 -3
- package/dist/ui/assets/sql-wasm-ClMy9maw.js +0 -2
- package/dist/ui/assets/tray-follower-status-Bmnx6GQ2.js +0 -1
- package/dist/ui/assets/types-U7svdiTt.js +0 -1
- /package/dist/ui/assets/{addon-fit-CnTv21Qe.js → addon-fit-PERB1HRF.js} +0 -0
- /package/dist/ui/assets/{chat-fixture-BUlIqjmp.js → chat-fixture-BPoXQA7f.js} +0 -0
- /package/dist/ui/assets/{dist-Vf0lpDBK.js → dist-7wqtSoT3.js} +0 -0
- /package/dist/ui/assets/{dist-CdiravWB.js → dist-BYoCEWmq.js} +0 -0
- /package/dist/ui/assets/{github-copilot-headers-CbnvGrdY.js → github-copilot-headers-DFUtSIuj.js} +0 -0
- /package/dist/ui/assets/{google-shared-Cw0K0tCh.js → google-shared-LUt7az8j.js} +0 -0
- /package/dist/ui/assets/{logger-GnnuzSDq.js → logger-B-No_qN_.js} +0 -0
- /package/dist/ui/assets/{oauth-service-CfTUWB9P.js → oauth-service-BKtXASqw.js} +0 -0
- /package/dist/ui/assets/{openai-BcJAGVMr.js → openai-CpTflTb1.js} +0 -0
- /package/dist/ui/assets/{path-utils-C99GOg2c.js → path-utils-Zd1dbko2.js} +0 -0
- /package/dist/ui/assets/{preload-helper-DzyYoeor.js → preload-helper-ca-nBW7U.js} +0 -0
- /package/dist/ui/assets/{rum-BEM52ixi.js → rum-C22a_afY.js} +0 -0
- /package/dist/ui/assets/{src-DGdmJN2h.js → src-CtySarJL.js} +0 -0
- /package/dist/ui/assets/{xterm-CAZt1iF4.js → xterm-BxvFlCwN.js} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=s(((e,t)=>{t.exports={}}));function ee(e,t){if(typeof t!=`string`||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(t))throw Error(`${e} must use an exact semver version in package.json`);return t}var te=class{nextId=1;pending=new Map;handler;disposed=!1;constructor(e){this.port=e,this.handler=e=>{if(e.data?.type!==`realm-rpc-res`)return;let t=e.data,n=this.pending.get(t.id);n&&(this.pending.delete(t.id),typeof t.error==`string`?n.reject(Error(t.error)):n.resolve(t.result))},e.addEventListener(`message`,this.handler),e.start?.()}call(e,t,n=[]){if(this.disposed)return Promise.reject(Error(`realm-rpc: client disposed`));let r=this.nextId++,i={type:`realm-rpc-req`,id:r,channel:e,op:t,args:n};return new Promise((e,t)=>{this.pending.set(r,{resolve:e,reject:t}),this.port.postMessage(i)})}dispose(){if(this.disposed)return;this.disposed=!0,this.port.removeEventListener(`message`,this.handler);let e=Error(`realm-rpc: client disposed`);for(let t of this.pending.values())t.reject(e);this.pending.clear()}},ne=c({loadPyodide:()=>M,version:()=>$});function re(e){return!isNaN(parseFloat(e))&&isFinite(e)}function f(e){return e.charAt(0).toUpperCase()+e.substring(1)}function p(e){return function(){return this[e]}}function m(e){if(e)for(var t=0;t<B.length;t++)e[B[t]]!==void 0&&this[`set`+f(B[t])](e[B[t]])}function h(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:P(function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw Error(`Cannot parse given Error object`)},`ErrorStackParser$$parse`),extractLocation:P(function(e){if(e.indexOf(`:`)===-1)return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,``));return[t[1],t[2]||void 0,t[3]||void 0]},`ErrorStackParser$$extractLocation`),parseV8OrIE:P(function(t){return t.stack.split(`
|
|
2
|
+
`).filter(function(t){return!!t.match(e)},this).map(function(e){e.indexOf(`(eval `)>-1&&(e=e.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));var t=e.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],``):t;var r=this.extractLocation(n?n[1]:t);return new W({functionName:n&&t||void 0,fileName:[`eval`,`<anonymous>`].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)},`ErrorStackParser$$parseV8OrIE`),parseFFOrSafari:P(function(e){return e.stack.split(`
|
|
3
|
+
`).filter(function(e){return!e.match(t)},this).map(function(e){if(e.indexOf(` > eval`)>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),e.indexOf(`@`)===-1&&e.indexOf(`:`)===-1)return new W({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,``));return new W({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},`ErrorStackParser$$parseFFOrSafari`)}}function ie(){return typeof API<`u`&&API!==globalThis.API?API.runtimeEnv:ae({IN_BUN:typeof Bun<`u`,IN_DENO:typeof Deno<`u`,IN_NODE:typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`&&!process.browser,IN_SAFARI:typeof navigator==`object`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Chrome`)===-1&&navigator.userAgent.indexOf(`Safari`)>-1,IN_SHELL:typeof read==`function`&&typeof load==`function`})}function ae(e){let t=e.IN_NODE&&typeof module<`u`&&module.exports&&typeof F==`function`&&typeof __dirname==`string`,n=e.IN_NODE&&!t,r=!e.IN_NODE&&!e.IN_DENO&&!e.IN_BUN,i=r&&typeof window<`u`&&typeof window.document<`u`&&typeof document.createElement==`function`&&`sessionStorage`in window&&typeof globalThis.importScripts!=`function`,a=r&&typeof globalThis.WorkerGlobalScope<`u`&&typeof globalThis.self<`u`&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...e,IN_BROWSER:r,IN_BROWSER_MAIN_THREAD:i,IN_BROWSER_WEB_WORKER:a,IN_NODE_COMMONJS:t,IN_NODE_ESM:n}}async function g(){if(!G.IN_NODE||(xe=(await Promise.resolve().then(()=>u(d(),1))).default,Ce=await Promise.resolve().then(()=>u(d(),1)),q=await Promise.resolve().then(()=>u(d(),1)),Se=(await Promise.resolve().then(()=>u(d(),1))).default,K=await Promise.resolve().then(()=>u(d(),1)),Y=K.sep,typeof F<`u`))return;let e={fs:Ce,crypto:await Promise.resolve().then(()=>u(d(),1)),ws:await Promise.resolve().then(()=>u(d(),1)),child_process:await Promise.resolve().then(()=>u(d(),1))};globalThis.require=function(t){return e[t]}}function oe(e,t){return K.resolve(t||`.`,e)}function se(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}function ce(e,t){return e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?{response:fetch(e)}:{binary:q.readFile(e).then(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}}function le(e,t){if(e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`))throw Error(`Shell cannot fetch urls`);return{binary:Promise.resolve(new Uint8Array(readbuffer(e)))}}function ue(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function de(e,t){let{response:n,binary:r}=X(e,t);if(r)return r;let i=await n;if(!i.ok)throw Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await i.arrayBuffer())}async function fe(e){e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?Se.runInThisContext(await(await fetch(e)).text()):await import(xe.pathToFileURL(e).href)}async function pe(e){if(G.IN_NODE){await g();let t=await q.readFile(e,{encoding:`utf8`});return JSON.parse(t)}else if(G.IN_SHELL){let t=read(e);return JSON.parse(t)}else return await(await fetch(e)).json()}async function me(){if(G.IN_NODE_COMMONJS)return __dirname;let e;try{throw Error()}catch(t){e=t}let t=be.parse(e)[0].fileName;if(G.IN_NODE&&!t.startsWith(`file://`)&&(t=`file://${t}`),G.IN_NODE_ESM){let e=await Promise.resolve().then(()=>u(d(),1));return(await Promise.resolve().then(()=>u(d(),1))).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(Y);if(n===-1)throw Error(`Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.`);return t.slice(0,n)}function he(e){return e.substring(0,e.lastIndexOf(`/`)+1)||globalThis.location?.toString()||`.`}function ge(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,i={DIR_MODE:16895,FILE_MODE:33279,mount:P(function(e){if(!e.opts.fileSystemHandle)throw Error(`opts.fileSystemHandle is required`);return n.mount.apply(null,arguments)},`mount`),syncfs:P(async(e,t,n)=>{try{let r=i.getLocalSet(e),a=await i.getRemoteSet(e),o=t?a:r,s=t?r:a;await i.reconcile(e,o,s),n(null)}catch(e){n(e)}},`syncfs`),getLocalSet:P(e=>{let n=Object.create(null);function i(e){return e!==`.`&&e!==`..`}P(i,`isRealDir`);function a(e){return t=>r.join2(e,t)}P(a,`toAbsolute`);let o=t.readdir(e.mountpoint).filter(i).map(a(e.mountpoint));for(;o.length;){let e=o.pop(),r=t.stat(e);t.isDir(r.mode)&&o.push.apply(o,t.readdir(e).filter(i).map(a(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:`local`,entries:n}},`getLocalSet`),getRemoteSet:P(async e=>{let t=Object.create(null),n=await we(e.opts.fileSystemHandle);for(let[a,o]of n)a!==`.`&&(t[r.join2(e.mountpoint,a)]={timestamp:o.kind===`file`?new Date((await o.getFile()).lastModified):new Date,mode:o.kind===`file`?i.FILE_MODE:i.DIR_MODE});return{type:`remote`,entries:t,handles:n}},`getRemoteSet`),loadLocalEntry:P(e=>{let r=t.lookupPath(e,{}).node,i=t.stat(e);if(t.isDir(i.mode))return{timestamp:i.mtime,mode:i.mode};if(t.isFile(i.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:i.mtime,mode:i.mode,contents:r.contents};throw Error(`node type not supported`)},`loadLocalEntry`),storeLocalEntry:P((e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else if(t.isFile(n.mode))t.writeFile(e,n.contents,{canOwn:!0});else throw Error(`node type not supported`);t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},`storeLocalEntry`),removeLocalEntry:P(e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},`removeLocalEntry`),loadRemoteEntry:P(async e=>{if(e.kind===`file`){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:i.FILE_MODE,timestamp:new Date(t.lastModified)}}else{if(e.kind===`directory`)return{mode:i.DIR_MODE,timestamp:new Date};throw Error(`unknown kind: `+e.kind)}},`loadRemoteEntry`),storeRemoteEntry:P(async(e,n,i)=>{let a=e.get(r.dirname(n)),o=t.isFile(i.mode)?await a.getFileHandle(r.basename(n),{create:!0}):await a.getDirectoryHandle(r.basename(n),{create:!0});if(o.kind===`file`){let e=await o.createWritable();await e.write(i.contents),await e.close()}e.set(n,o)},`storeRemoteEntry`),removeRemoteEntry:P(async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},`removeRemoteEntry`),reconcile:P(async(e,n,a)=>{let o=0,s=[];Object.keys(n.entries).forEach(function(e){let r=n.entries[e],i=a.entries[e];(!i||t.isFile(r.mode)&&r.timestamp.getTime()>i.timestamp.getTime())&&(s.push(e),o++)}),s.sort();let c=[];if(Object.keys(a.entries).forEach(function(e){n.entries[e]||(c.push(e),o++)}),c.sort().reverse(),!o)return;let l=n.type===`remote`?n.handles:a.handles;for(let t of s){let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);if(a.type===`local`){let e=l.get(n),r=await i.loadRemoteEntry(e);i.storeLocalEntry(t,r)}else{let e=i.loadLocalEntry(t);await i.storeRemoteEntry(l,n,e)}}for(let t of c)if(a.type===`local`)i.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);await i.removeRemoteEntry(l,n)}},`reconcile`)};e.FS.filesystems.NATIVEFS_ASYNC=i}async function _e(){let e=await Te;if(e)return e.exports;let t=Symbol(`error marker`);return{create_sentinel:P(()=>t,`create_sentinel`),is_sentinel:P(e=>e===t,`is_sentinel`)}}function ve(e){let t={config:e,runtimeEnv:G},n={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:x(e),print:e.stdout,printErr:e.stderr,onExit(e){n.exitCode=e},thisProgram:e._sysExecutable,arguments:e.args,API:t,locateFile:P(t=>e.indexURL+t,`locateFile`),instantiateWasm:S(e.indexURL)};return n}function ye(e){return function(t){try{t.FS.mkdirTree(e)}catch(t){console.error(`Error occurred while making a home directory '${e}':`),console.error(t),console.error(`Using '/' for a home directory instead`),e=`/`}t.FS.chdir(e)}}function _(e){return function(t){Object.assign(t.ENV,e)}}function v(e){return e?[async t=>{t.addRunDependency(`fsInitHook`);try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency(`fsInitHook`)}}]:[]}function y(e){let t=e.HEAPU32[e._Py_Version>>>2];return[t>>>24&255,t>>>16&255,t>>>8&255]}function b(e){let t=de(e);return async e=>{e.API.pyVersionTuple=y(e);let[n,r]=e.API.pyVersionTuple;e.FS.mkdirTree(`/lib`),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency(`install-stdlib`);try{let i=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,i)}catch(e){console.error(`Error occurred while installing the standard library:`),console.error(e)}finally{e.removeRunDependency(`install-stdlib`)}}}function x(e){let t;return t=e.stdLibURL==null?e.indexURL+`python_stdlib.zip`:e.stdLibURL,[b(t),ye(e.env.HOME),_(e.env),ge,...v(e.fsInit)]}function S(e){if(typeof WasmOffsetConverter<`u`)return;let{binary:t,response:n}=X(e+`pyodide.asm.wasm`),r=_e();return function(e,i){return async function(){e.sentinel=await r;try{let r;r=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:a,module:o}=r;i(a,o)}catch(e){console.warn(`wasm instantiation failed!`),console.warn(e)}}(),{}}}function C(e){return e===void 0||e.endsWith(`/`)?e:e+`/`}async function w(e={}){if(await g(),e.lockFileContents&&e.lockFileURL)throw Error(`Can't pass both lockFileContents and lockFileURL`);let t=e.indexURL||await me();if(t=C(J(t)),e.packageBaseUrl=C(e.packageBaseUrl),e.cdnUrl=C(e.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v0.29.3/full/`),!e.lockFileContents){let n=e.lockFileURL??t+`pyodide-lock.json`;e.lockFileContents=pe(n),e.packageBaseUrl??=he(n)}e.indexURL=t,e.packageCacheDir&&=C(J(e.packageCacheDir));let n={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:e.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:`b7b7b0f46eb68e65c029c0dc739270e8a5d35251e9aab6014ee1c2f630e5d1d0`},r=Object.assign(n,e);return r.env.HOME??=`/home/pyodide`,r.env.PYTHONINSPECT??=`1`,r}function T(e){let t=ve(e),n=t.API;return n.lockFilePromise=Promise.resolve(e.lockFileContents),t}async function E(e){if(typeof _createPyodideModule!=`function`){let t=`${e.indexURL}pyodide.asm.js`;await Z(t)}}async function D(e,t){if(!e._loadSnapshot)return;let n=await e._loadSnapshot,r=ArrayBuffer.isView(n)?n:new Uint8Array(n);return t.noInitialRun=!0,t.INITIAL_MEMORY=r.length,r}async function O(e){let t=await _createPyodideModule(e);if(e.exitCode!==void 0)throw new t.ExitStatus(e.exitCode);return t}function k(e,t){let n=e.API;if(t.pyproxyToStringRepr&&n.setPyProxyToStringMethod(!0),t.convertNullToNone&&n.setCompatNullToNone(!0),t.toJsLiteralMap&&n.setCompatToJsLiteralMap(!0),n.version!==`0.29.3`&&t.checkAPIVersion)throw Error(`Pyodide version does not match: '${$}' <==> '${n.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);e.locateFile=e=>{throw e.endsWith(`.so`)?Error(`Failed to find dynamic library "${e}"`):Error(`Unexpected call to locateFile("${e}")`)}}function A(e,t,n){let r=e.API,i;return t&&(i=r.restoreSnapshot(t)),r.finalizeBootstrap(i,n._snapshotDeserializer)}async function j(e,t){let n=e._api;return n.sys.path.insert(0,``),n._pyodide.set_excepthook(),await n.packageIndexReady,n.initializeStreams(t.stdin,t.stdout,t.stderr),e}async function M(e={}){let t=await w(e),n=T(t);await E(t);let r=await D(t,n),i=await O(n);return k(i,t),await j(A(i,r,t),t)}var N,P,F,I,L,R,z,B,V,H,U,W,be,G,xe,K,Se,Ce,q,J,Y,X,Z,we,Q,Te,Ee,$,De=o((()=>{for(N=Object.defineProperty,P=(e,t)=>N(e,`name`,{value:t,configurable:!0}),F=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),I=(()=>{for(var e=new Uint8Array(128),t=0;t<64;t++)e[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return t=>{for(var n=t.length,r=new Uint8Array((n-(t[n-1]==`=`)-(t[n-2]==`=`))*3/4|0),i=0,a=0;i<n;){var o=e[t.charCodeAt(i++)],s=e[t.charCodeAt(i++)],c=e[t.charCodeAt(i++)],l=e[t.charCodeAt(i++)];r[a++]=o<<2|s>>4,r[a++]=s<<4|c>>2,r[a++]=c<<6|l}return r}})(),P(re,`_isNumber`),P(f,`_capitalize`),P(p,`_getter`),L=[`isConstructor`,`isEval`,`isNative`,`isToplevel`],R=[`columnNumber`,`lineNumber`],z=[`fileName`,`functionName`,`source`],B=L.concat(R,z,[`args`],[`evalOrigin`]),P(m,`StackFrame`),m.prototype={getArgs:P(function(){return this.args},`getArgs`),setArgs:P(function(e){if(Object.prototype.toString.call(e)!==`[object Array]`)throw TypeError(`Args must be an Array`);this.args=e},`setArgs`),getEvalOrigin:P(function(){return this.evalOrigin},`getEvalOrigin`),setEvalOrigin:P(function(e){if(e instanceof m)this.evalOrigin=e;else if(e instanceof Object)this.evalOrigin=new m(e);else throw TypeError(`Eval Origin must be an Object or StackFrame`)},`setEvalOrigin`),toString:P(function(){var e=this.getFileName()||``,t=this.getLineNumber()||``,n=this.getColumnNumber()||``,r=this.getFunctionName()||``;return this.getIsEval()?e?`[eval] (`+e+`:`+t+`:`+n+`)`:`[eval]:`+t+`:`+n:r?r+` (`+e+`:`+t+`:`+n+`)`:e+`:`+t+`:`+n},`toString`)},m.fromString=P(function(e){var t=e.indexOf(`(`),n=e.lastIndexOf(`)`),r=e.substring(0,t),i=e.substring(t+1,n).split(`,`),a=e.substring(n+1);if(a.indexOf(`@`)===0)var o=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a,``),s=o[1],c=o[2],l=o[3];return new m({functionName:r,args:i||void 0,fileName:s,lineNumber:c||void 0,columnNumber:l||void 0})},`StackFrame$$fromString`),V=0;V<L.length;V++)m.prototype[`get`+f(L[V])]=p(L[V]),m.prototype[`set`+f(L[V])]=function(e){return function(t){this[e]=!!t}}(L[V]);for(H=0;H<R.length;H++)m.prototype[`get`+f(R[H])]=p(R[H]),m.prototype[`set`+f(R[H])]=function(e){return function(t){if(!re(t))throw TypeError(e+` must be a Number`);this[e]=Number(t)}}(R[H]);for(U=0;U<z.length;U++)m.prototype[`get`+f(z[U])]=p(z[U]),m.prototype[`set`+f(z[U])]=function(e){return function(t){this[e]=String(t)}}(z[U]);if(W=m,P(h,`ErrorStackParser`),be=new h,P(ie,`getGlobalRuntimeEnv`),G=ie(),P(ae,`calculateDerivedFlags`),P(g,`initNodeModules`),P(oe,`node_resolvePath`),P(se,`browser_resolvePath`),J=G.IN_NODE?oe:G.IN_SHELL?P(e=>e,`resolvePath`):se,G.IN_NODE||(Y=`/`),P(ce,`node_getBinaryResponse`),P(le,`shell_getBinaryResponse`),P(ue,`browser_getBinaryResponse`),X=G.IN_NODE?ce:G.IN_SHELL?le:ue,P(de,`loadBinaryFile`),G.IN_BROWSER_MAIN_THREAD)Z=P(async e=>await import(e),`loadScript`);else if(G.IN_BROWSER_WEB_WORKER)Z=P(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},`loadScript`);else if(G.IN_NODE)Z=fe;else if(G.IN_SHELL)Z=load;else throw Error(`Cannot determine runtime environment`);P(fe,`nodeLoadScript`),P(pe,`loadLockFile`),P(me,`calculateDirname`),P(he,`calculateInstallBaseUrl`),P(ge,`initializeNativeFS`),we=P(async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),r.kind===`directory`&&await n(r)}P(n,`collect`),await n(e);let r=new Map;r.set(`.`,e);for(let n of t){let t=(await e.resolve(n)).join(`/`);r.set(t,n)}return r},`getFsHandles`),Q=I(`AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs=`),Te=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&typeof navigator.maxTouchPoints<`u`&&navigator.maxTouchPoints>1)))try{let e=await WebAssembly.compile(Q);return await WebAssembly.instantiate(e)}catch(e){if(e instanceof WebAssembly.CompileError)return;throw e}}(),P(_e,`getSentinelImport`),P(ve,`createSettings`),P(ye,`createHomeDirectory`),P(_,`setEnvironment`),P(v,`callFsInitHook`),P(y,`computeVersionTuple`),P(b,`installStdlib`),P(x,`getFileSystemInitializationFuncs`),P(S,`getInstantiateWasmFunc`),Ee=`0.29.3`,P(C,`withTrailingSlash`),$=Ee,P(w,`initializeConfiguration`),P(T,`createEmscriptenSettings`),P(E,`loadWasmScript`),P(D,`prepareSnapshot`),P(O,`createPyodideModule`),P(k,`configureAPI`),P(A,`bootstrapPyodide`),P(j,`finalizeSetup`),P(M,`loadPyodide`)}));`${ee(`pyodide`,`0.29.3`)}`;async function Oe(e,t,n=()=>Promise.resolve().then(()=>(De(),ne))){let r=[],i=[],a=new te(t),o;try{o=await(await n()).loadPyodide({indexURL:e.pyodideIndexURL,fullStdLib:!1})}catch(e){a.dispose();let n={type:`realm-error`,message:`loadPyodide: ${e instanceof Error?e.message:String(e)}`};t.postMessage(n);return}let s=e.pyodideSyncDirs??[e.cwd,`/tmp`];try{await ke(a,o,s)}catch(e){let t=e instanceof Error?e.message:String(e);i.push(`Warning: VFS→Pyodide sync failed: ${t}\n`)}try{o.FS.chdir(e.cwd)}catch{}o.setStdout({batched:e=>r.push(e+`
|
|
4
|
+
`)}),o.setStderr({batched:e=>i.push(e+`
|
|
5
|
+
`)});let c=!1;o.setStdin({stdin:()=>c||!e.stdin?null:(c=!0,e.stdin)}),o.globals.set(`__slicc_code`,e.code),o.globals.set(`__slicc_filename`,e.filename),o.globals.set(`__slicc_argv`,e.argv);let l;try{await o.runPythonAsync(`
|
|
6
|
+
import sys
|
|
7
|
+
import traceback
|
|
8
|
+
|
|
9
|
+
__slicc_exit_code = 0
|
|
10
|
+
try:
|
|
11
|
+
sys.argv = __slicc_argv
|
|
12
|
+
exec(compile(__slicc_code, __slicc_filename, "exec"), {"__name__": "__main__", "__file__": __slicc_filename})
|
|
13
|
+
except SystemExit as exc:
|
|
14
|
+
code = exc.code
|
|
15
|
+
if code is None:
|
|
16
|
+
__slicc_exit_code = 0
|
|
17
|
+
elif isinstance(code, int):
|
|
18
|
+
__slicc_exit_code = code
|
|
19
|
+
else:
|
|
20
|
+
print(code, file=sys.stderr)
|
|
21
|
+
__slicc_exit_code = 1
|
|
22
|
+
except BaseException:
|
|
23
|
+
traceback.print_exc()
|
|
24
|
+
__slicc_exit_code = 1
|
|
25
|
+
`);let e=o.globals.get(`__slicc_exit_code`);l=typeof e==`number`?e:Number(e??1)}catch(e){let t=e instanceof Error?e.message:String(e);i.push(`${t}\n`),l=1}try{o.runPython(`del __slicc_code, __slicc_filename, __slicc_argv, __slicc_exit_code`)}catch{}try{await Ae(a,o,s)}catch(e){let t=e instanceof Error?e.message:String(e);i.push(`Warning: Pyodide→VFS sync failed: ${t}\n`)}a.dispose();let u={type:`realm-done`,stdout:r.join(``),stderr:i.join(``),exitCode:l};t.postMessage(u)}async function ke(e,t,n){let r=t.FS;function i(e){try{r.stat(e)}catch{r.mkdirTree(e)}}async function a(t){i(t);let n;try{n=await e.call(`vfs`,`readDir`,[t])}catch{return}for(let o of n){let n=t===`/`?`/${o}`:`${t}/${o}`;try{if((await e.call(`vfs`,`stat`,[n])).isDirectory)await a(n);else{let a=await e.call(`vfs`,`readFile`,[n]);i(t),r.writeFile(n,a)}}catch{}}}for(let e of n)await a(e)}async function Ae(e,t,n){let r=t.FS;async function i(t){let n;try{n=r.readdir(t).filter(e=>e!==`.`&&e!==`..`)}catch{return}for(let a of n){let n=t===`/`?`/${a}`:`${t}/${a}`;try{let a=r.stat(n);if(r.isDir(a.mode))await e.call(`vfs`,`mkdir`,[n]),await i(n);else{let i=new TextDecoder().decode(r.readFile(n));await e.call(`vfs`,`mkdir`,[t]),await e.call(`vfs`,`writeFile`,[n,i])}}catch{}}}for(let e of n)await i(e)}let je={postMessage:(e,t)=>t?self.postMessage(e,t):self.postMessage(e),addEventListener:(e,t)=>self.addEventListener(e,t),removeEventListener:(e,t)=>self.removeEventListener(e,t)};self.addEventListener(`message`,e=>{if(e.data?.type!==`realm-init`)return;let t=e.data;t.kind===`py`&&Oe(t,je).catch(e=>{let t={type:`realm-error`,message:e instanceof Error?e.message:String(e)};self.postMessage(t)})})})();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-BmfB5bmM.css","assets/mount-picker-popup-BLHoVG3y.js","assets/chunk-jRWAZmH_.js","assets/logger-B-No_qN_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-ca-nBW7U.js";var t=class{client;sid;onEvent;nextExecId=1;pending=new Map;buffers=new Map;opened=!1;openWaiters=[];unsubscribe=null;constructor(e){this.client=e.client,this.sid=e.sid,this.onEvent=e.onEvent??null,this.unsubscribe=this.subscribeToEvents()}open(e={}){return this.opened?Promise.resolve():new Promise((t,n)=>{this.openWaiters.push(e=>e?n(e):t()),this.send({type:`terminal-open`,sid:this.sid,cwd:e.cwd,env:e.env})})}exec(e){let t=`e${this.nextExecId++}`;return new Promise(n=>{this.pending.set(t,n),this.buffers.set(t,{stdout:``,stderr:``}),this.send({type:`terminal-exec`,sid:this.sid,execId:t,command:e})})}signal(e){this.send({type:`terminal-signal`,sid:this.sid,signal:e})}resize(e,t){this.send({type:`terminal-resize`,sid:this.sid,cols:e,rows:t})}close(){if(this.opened){this.send({type:`terminal-close`,sid:this.sid}),this.opened=!1;for(let e of this.openWaiters)e(Error(`terminal session closed`));this.openWaiters=[];for(let[e,t]of this.pending){let n=this.buffers.get(e)??{stdout:``,stderr:``};t({stdout:n.stdout,stderr:n.stderr,exitCode:130})}this.pending.clear(),this.buffers.clear()}}dispose(){this.unsubscribe?.(),this.unsubscribe=null}send(e){this.client.sendRaw(e)}subscribeToEvents(){return this.client.onTerminalEvent(e=>{e.sid===this.sid&&this.handleEvent(e)})}handleEvent(e){switch(this.onEvent?.(e),e.type){case`terminal-status`:{let t=e;if(t.state===`opened`){this.opened=!0;for(let e of this.openWaiters)e();this.openWaiters=[]}else if(t.state===`error`){this.opened=!1;let e=Error(t.error??`terminal session error`);for(let t of this.openWaiters)t(e);this.openWaiters=[]}return}case`terminal-output`:{let t=e;if(t.execId!==void 0){let e=this.buffers.get(t.execId);if(!e)return;t.stream===`stdout`?e.stdout+=t.data:e.stderr+=t.data}else for(let e of this.buffers.values())t.stream===`stdout`?e.stdout+=t.data:e.stderr+=t.data;return}case`terminal-exit`:{let t=e,n=this.pending.get(t.execId),r=this.buffers.get(t.execId);this.pending.delete(t.execId),this.buffers.delete(t.execId),n&&n({stdout:r?.stdout??``,stderr:r?.stderr??``,exitCode:t.exitCode});return}case`terminal-cleared`:case`terminal-media-preview`:return}}},n={background:`#141414`,foreground:`#cfcfcf`,cursor:`#3562ff`,cursorAccent:`#141414`,selectionBackground:`#3562ff40`,selectionForeground:`#ffffff`,black:`#1a1a1a`,red:`#e34850`,green:`#2d9d78`,yellow:`#e68619`,blue:`#3562ff`,magenta:`#a962e8`,cyan:`#2db9be`,white:`#cfcfcf`,brightBlack:`#5a5a5a`,brightRed:`#e34850`,brightGreen:`#2d9d78`,brightYellow:`#e68619`,brightBlue:`#4a75ff`,brightMagenta:`#a962e8`,brightCyan:`#2db9be`,brightWhite:`#ffffff`},r={background:`#f0f0f0`,foreground:`#1a1a1a`,cursor:`#2b54db`,cursorAccent:`#f0f0f0`,selectionBackground:`#2b54db30`,selectionForeground:`#000000`,black:`#1a1a1a`,red:`#d73220`,green:`#268e6c`,yellow:`#d17a00`,blue:`#2b54db`,magenta:`#8839ef`,cyan:`#1a9088`,white:`#e8e8e8`,brightBlack:`#6e6e6e`,brightRed:`#d73220`,brightGreen:`#268e6c`,brightYellow:`#d17a00`,brightBlue:`#1e44c4`,brightMagenta:`#8839ef`,brightCyan:`#1a9088`,brightWhite:`#ffffff`},i=`\x1B[34m/\x1B[0m \x1B[90m$\x1B[0m `,a=4,o=class{client;terminal=null;fitAddon=null;terminalHost=null;resizeObserver=null;themeObserver=null;currentLine=``;cursorPos=0;history=[];historyIndex=-1;isExecuting=!1;execInFlight=null;constructor(e){this.options=e;let n=e.sid??`panel-terminal-${Date.now()}`;this.client=new t({client:e.client,sid:n,onEvent:e=>this.handleEvent(e)})}async mount(t){let{Terminal:i}=await e(async()=>{let{Terminal:e}=await import(`./xterm-BxvFlCwN.js`);return{Terminal:e}},[]),{FitAddon:a}=await e(async()=>{let{FitAddon:e}=await import(`./addon-fit-PERB1HRF.js`);return{FitAddon:e}},[]);await e(()=>Promise.resolve({}),__vite__mapDeps([0]));let o=!document.documentElement.classList.contains(`theme-light`);this.terminal=new i({cursorBlink:!0,fontSize:11,fontFamily:`'Source Code Pro', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace`,theme:o?n:r,convertEol:!0}),this.themeObserver=new MutationObserver(()=>{if(!this.terminal)return;let e=document.documentElement.classList.contains(`theme-light`);this.terminal.options.theme=e?r:n}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),this.fitAddon=new a,this.terminal.loadAddon(this.fitAddon),t.replaceChildren(),this.terminalHost=document.createElement(`div`),this.terminalHost.className=`terminal-panel__terminal-host`,t.appendChild(this.terminalHost),this.terminal.open(this.terminalHost),this.fitAddon.fit(),this.resizeObserver=new ResizeObserver(()=>this.refit()),this.resizeObserver.observe(this.terminalHost),this.terminal.writeln(`\x1B[1mslicc\x1B[0m \x1B[90mshell (kernel)\x1B[0m`),this.terminal.writeln(`\x1B[90mType "help" for available commands.\x1B[0m
|
|
3
|
+
`),await this.client.open({cwd:this.options.cwd,env:this.options.env}),this.showPrompt(),this.setupInputHandler()}refit(){this.fitAddon?.fit()}clearTerminal(){this.terminal?.clear()}async executeCommandInTerminal(e){let t=e.trim();return t?this.terminal?this.isExecuting||this.currentLine.length>0?{stdout:``,stderr:`terminal is busy; finish current input first
|
|
4
|
+
`,exitCode:1}:(this.history[this.history.length-1]!==t&&this.history.push(t),this.historyIndex=-1,this.terminal.write(t),this.terminal.writeln(``),this.runRemote(t)):this.client.exec(t):{stdout:``,stderr:``,exitCode:0}}dispose(){this.themeObserver?.disconnect(),this.themeObserver=null,this.resizeObserver?.disconnect(),this.resizeObserver=null,this.terminal?.dispose(),this.terminal=null,this.fitAddon=null,this.terminalHost=null,this.client.close(),this.client.dispose()}showPrompt(){this.terminal?.write(i)}setupInputHandler(){this.terminal&&this.terminal.onData(e=>{if(this.isExecuting){(e===``||e.length===1&&e.charCodeAt(0)===3)&&(this.client.signal(`SIGINT`),this.terminal?.writeln(`^C`));return}if(e.startsWith(`\x1B[`)||e.startsWith(`\x1BO`)){switch(e){case`\x1B[A`:this.handleHistoryUp();return;case`\x1B[B`:this.handleHistoryDown();return;case`\x1B[C`:this.handleArrowRight();return;case`\x1B[D`:this.handleArrowLeft();return;case`\x1B[H`:case`\x1BOH`:case`\x1B[1~`:this.handleHome();return;case`\x1B[F`:case`\x1BOF`:case`\x1B[4~`:this.handleEnd();return;case`\x1B[3~`:this.handleDelete();return}return}for(let t of e)switch(t){case`\r`:this.handleEnter();break;case``:this.handleBackspace();break;case``:this.terminal?.writeln(`^C`),this.currentLine=``,this.cursorPos=0,this.showPrompt();break;default:t>=` `&&this.insertChar(t)}})}insertChar(e){if(!this.terminal)return;let t=this.currentLine.slice(this.cursorPos);this.currentLine=this.currentLine.slice(0,this.cursorPos)+e+t,this.cursorPos++,this.terminal.write(e),t.length>0&&(this.terminal.write(t),this.terminal.write(`\x1b[${t.length}D`))}handleBackspace(){if(!this.terminal||this.cursorPos<=0)return;let e=this.currentLine.slice(this.cursorPos);this.currentLine=this.currentLine.slice(0,this.cursorPos-1)+e,this.cursorPos--,this.terminal.write(`\b\x1B[K`),e.length>0&&(this.terminal.write(e),this.terminal.write(`\x1b[${e.length}D`))}handleDelete(){if(!this.terminal||this.cursorPos>=this.currentLine.length)return;let e=this.currentLine.slice(this.cursorPos+1);this.currentLine=this.currentLine.slice(0,this.cursorPos)+e,this.terminal.write(`\x1B[K`),e.length>0&&(this.terminal.write(e),this.terminal.write(`\x1b[${e.length}D`))}handleArrowLeft(){this.cursorPos<=0||(this.cursorPos--,this.terminal?.write(`\x1B[D`))}handleArrowRight(){this.cursorPos>=this.currentLine.length||(this.cursorPos++,this.terminal?.write(`\x1B[C`))}handleHome(){this.cursorPos!==0&&(this.terminal?.write(`\x1b[${this.cursorPos}D`),this.cursorPos=0)}handleEnd(){let e=this.currentLine.length-this.cursorPos;e<=0||(this.terminal?.write(`\x1b[${e}C`),this.cursorPos=this.currentLine.length)}handleHistoryUp(){if(this.history.length===0)return;let e=this.historyIndex===-1?this.history.length-1:Math.max(0,this.historyIndex-1);this.historyIndex=e,this.replaceLine(this.history[e])}handleHistoryDown(){if(this.historyIndex===-1)return;let e=this.historyIndex+1;e>=this.history.length?(this.historyIndex=-1,this.replaceLine(``)):(this.historyIndex=e,this.replaceLine(this.history[e]))}replaceLine(e){if(!this.terminal)return;let t=this.currentLine.length-this.cursorPos;t>0&&this.terminal.write(`\x1b[${t}C`),this.terminal.write(`\r`),this.terminal.write(`\x1b[${a+this.currentLine.length}D`),this.terminal.write(`\x1B[K`),this.showPrompt(),this.terminal.write(e),this.currentLine=e,this.cursorPos=e.length}handleEnter(){if(!this.terminal)return;let e=this.currentLine.trim();if(this.terminal.writeln(``),this.currentLine=``,this.cursorPos=0,this.historyIndex=-1,!e){this.showPrompt();return}this.history[this.history.length-1]!==e&&this.history.push(e);let t=s(e);if(t){this.runRemoteWithLocalPicker(e,t);return}this.runRemote(e)}async runRemoteWithLocalPicker(t,n){this.isExecuting=!0;try{let r=window;if(typeof r.showDirectoryPicker!=`function`){this.terminal?.writeln(`mount: File System Access API not available
|
|
5
|
+
`);return}let i;try{i=await r.showDirectoryPicker({mode:`readwrite`})}catch(e){if(e instanceof Error&&e.name===`AbortError`){this.terminal?.writeln(`mount: cancelled`);return}let t=e instanceof Error?e.message:String(e);this.terminal?.writeln(`mount: ${t}`);return}try{let{storePendingHandle:t}=await e(async()=>{let{storePendingHandle:e}=await import(`./mount-picker-popup-BLHoVG3y.js`).then(e=>e.n);return{storePendingHandle:e}},__vite__mapDeps([1,2,3]));await t(c(n),i)}catch(e){let t=e instanceof Error?e.message:String(e);this.terminal?.writeln(`mount: failed to stash handle: ${t}`);return}await this.runRemoteImpl(t)}finally{this.isExecuting=!1,this.showPrompt()}}async runRemote(e){this.isExecuting=!0;try{return await this.runRemoteImpl(e)}finally{this.isExecuting=!1,this.execInFlight=null,this.showPrompt()}}async runRemoteImpl(e){let t=this.client.exec(e);this.execInFlight=t;try{return await t}finally{this.execInFlight=null}}handleEvent(e){if(this.terminal)switch(e.type){case`terminal-output`:e.stream===`stderr`?this.terminal.write(`\x1b[31m${e.data}\x1b[0m`):this.terminal.write(e.data);return;case`terminal-exit`:return;case`terminal-cleared`:this.terminal.clear();return;case`terminal-status`:e.state===`error`&&this.terminal.writeln(`\x1b[31mterminal session error: ${e.error??`unknown`}\x1b[0m`);return;case`terminal-media-preview`:return}}};function s(e){let t=e.trim();if(!t.startsWith(`mount`))return null;let n=t.split(/\s+/);if(n[0]!==`mount`||n.includes(`--source`)||n.includes(`--help`)||n.includes(`-h`))return null;let r=n.slice(1).find(e=>!e.startsWith(`-`));return!r||[`list`,`unmount`,`refresh`,`recover`].includes(r)||!r.startsWith(`/`)?null:r}function c(e){return`pendingMount:term:${e}`}export{o as RemoteTerminalView};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-
|
|
2
|
-
import{t as e}from"./preload-helper-DzyYoeor.js";import{$ as t,A as n,B as r,D as i,E as a,F as o,H as s,I as c,J as l,L as u,N as d,P as f,Q as p,R as m,S as ee,U as te,V as h,X as g,Y as ne,Z as re,at as _,c as ie,d as ae,j as oe,k as se,n as ce,nt as v,q as y,t as le,v as b,w as x,x as S,y as C,z as ue}from"./dist-Vf0lpDBK.js";var de=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=T(e.state,n.from);return r.line?fe(e):r.block?me(e):!1};function w(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var fe=w(ve,0),pe=w(_e,0),me=w((e,t)=>_e(e,t,ge(t)),0);function T(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var E=50;function he(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-E,r),o=e.sliceDoc(i,i+E),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*E?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+E),d=e.sliceDoc(i-E,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function ge(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function _e(e,t,n=t.selection.ranges){let r=n.map(e=>T(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>he(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function ve(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=T(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var D=u.define(),ye=u.define(),be=te.define(),xe=te.define({combine(e){return re(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Se=l.define({create(){return P.empty},update(e,t){let n=t.state.facet(xe),r=t.annotation(D);if(r){let i=A.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?j(o,o.length,n.minDepth,i):je(o,t.startState.selection),new P(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ye);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(g.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=A.fromTransaction(t),o=t.annotation(g.time),s=t.annotation(g.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new P(e.done.map(A.fromJSON),e.undone.map(A.fromJSON))}});function Ce(e={}){return[Se,xe.of(e),n.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?we:e.inputType==`historyRedo`?k:null;return n?(e.preventDefault(),n(t)):!1}})]}function O(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Se,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var we=O(0,!1),k=O(1,!1),Te=O(0,!0),Ee=O(1,!0),A=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ue.fromJSON(t.changes),[],t.mapped&&m.fromJSON(t.mapped),t.startSelection&&h.fromJSON(t.startSelection),t.selectionsAfter.map(h.fromJSON))}static fromTransaction(t,n){let r=M;for(let e of t.startState.facet(be)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,M)}static selection(t){return new e(void 0,M,void 0,void 0,t)}};function j(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function De(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Oe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function ke(e,t){return e.length?t.length?e.concat(t):e:t}var M=[],Ae=200;function je(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Ae));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),j(e,e.length-1,1e9,n.setSelAfter(r)))}else return[A.selection([t])]}function Me(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function N(e,t){if(!e.length)return e;let n=e.length,r=M;for(;n;){let i=Ne(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[A.selection(r)]:M}function Ne(e,t,n){let r=ke(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):M,n);if(!e.changes)return A.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new A(i,y.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Pe=/^(input\.type|delete)($|\.)/,P=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Pe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,De(s.changes,t.changes))||r==`input.type.compose`)?j(o,o.length-1,i.minDepth,new A(t.changes.compose(s.changes),ke(y.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,M)):j(o,o.length,i.minDepth,t),new e(o,M,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:M;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Oe(a[a.length-1],t)?this:new e(je(this.done,t),this.undone,n,r)}addMapping(t){return new e(N(this.done,t),N(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:D.of({side:e,rest:Me(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?M:r.slice(0,r.length-1);return i.mapped&&(n=N(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:D.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};P.empty=new P(M,M);var Fe=[{key:`Mod-z`,run:we,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:k,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:k,preventDefault:!0},{key:`Mod-u`,run:Te,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Ee,preventDefault:!0}];function F(e,t){return h.create(e.ranges.map(t),e.mainIndex)}function I(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function L({state:e,dispatch:t},n){let r=F(e.selection,n);return r.eq(e.selection,!0)?!1:(t(I(e,r)),!0)}function R(e,t){return h.cursor(t?e.to:e.from)}function Ie(e,t){return L(e,n=>n.empty?e.moveByChar(n,t):R(n,t))}function z(e){return e.textDirectionAt(e.state.selection.main.head)==se.LTR}var B=e=>Ie(e,!z(e)),V=e=>Ie(e,z(e));function H(e,t){return L(e,n=>n.empty?e.moveByGroup(n,t):R(n,t))}var Le=e=>H(e,!z(e)),Re=e=>H(e,z(e));typeof Intl<`u`&&Intl.Segmenter;function ze(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function U(e,t,n){let r=i(e).resolveInner(t.head),a=n?_.closedBy:_.openedBy;for(let i=t.head;;){let t=n?r.childAfter(i):r.childBefore(i);if(!t)break;ze(e,t,a)?r=t:i=n?t.to:t.from}let o=r.type.prop(a),s,c;return c=o&&(s=n?x(e,r.from,1):x(e,r.to,-1))&&s.matched?n?s.end.to:s.end.from:n?r.to:r.from,h.cursor(c,n?-1:1)}var Be=e=>L(e,t=>U(e.state,t,!z(e))),Ve=e=>L(e,t=>U(e.state,t,z(e)));function W(e,t){return L(e,n=>{if(!n.empty)return R(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var He=e=>W(e,!1),Ue=e=>W(e,!0);function We(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,i=0,a;if(t){for(let t of e.state.facet(n.scrollMargins)){let n=t(e);n?.top&&(r=Math.max(n?.top,r)),n?.bottom&&(i=Math.max(n?.bottom,i))}a=e.scrollDOM.clientHeight-r-i}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function Ge(e,t){let r=We(e),{state:i}=e,a=F(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):R(n,t));if(a.eq(i.selection))return!1;let o;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),c=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>c&&t.bottom<l&&(o=n.scrollIntoView(a.main.head,{y:`start`,yMargin:t.top-c}))}return e.dispatch(I(i,a),{effects:o}),!0}var Ke=e=>Ge(e,!1),G=e=>Ge(e,!0);function K(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=h.cursor(r.from+n))}return i}var qe=e=>L(e,t=>K(e,t,!0)),Je=e=>L(e,t=>K(e,t,!1)),Ye=e=>L(e,t=>K(e,t,!z(e))),Xe=e=>L(e,t=>K(e,t,z(e))),Ze=e=>L(e,t=>h.cursor(e.lineBlockAt(t.head).from,1)),Qe=e=>L(e,t=>h.cursor(e.lineBlockAt(t.head).to,-1));function $e(e,t,n){let r=!1,i=F(e.selection,t=>{let i=x(e,t.head,-1)||x(e,t.head,1)||t.head>0&&x(e,t.head-1,1)||t.head<e.doc.length&&x(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?h.range(t.anchor,a):h.cursor(a)});return r?(t(I(e,i)),!0):!1}var et=({state:e,dispatch:t})=>$e(e,t,!1);function q(e,t){let n=F(e.state.selection,e=>{let n=t(e);return h.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(I(e.state,n)),!0)}function tt(e,t){return q(e,n=>e.moveByChar(n,t))}var nt=e=>tt(e,!z(e)),rt=e=>tt(e,z(e));function it(e,t){return q(e,n=>e.moveByGroup(n,t))}var at=e=>it(e,!z(e)),ot=e=>it(e,z(e)),st=e=>q(e,t=>U(e.state,t,!z(e))),ct=e=>q(e,t=>U(e.state,t,z(e)));function lt(e,t){return q(e,n=>e.moveVertically(n,t))}var ut=e=>lt(e,!1),dt=e=>lt(e,!0);function ft(e,t){return q(e,n=>e.moveVertically(n,t,We(e).height))}var pt=e=>ft(e,!1),mt=e=>ft(e,!0),ht=e=>q(e,t=>K(e,t,!0)),gt=e=>q(e,t=>K(e,t,!1)),_t=e=>q(e,t=>K(e,t,!z(e))),vt=e=>q(e,t=>K(e,t,z(e))),yt=e=>q(e,t=>h.cursor(e.lineBlockAt(t.head).from)),bt=e=>q(e,t=>h.cursor(e.lineBlockAt(t.head).to)),xt=({state:e,dispatch:t})=>(t(I(e,{anchor:0})),!0),St=({state:e,dispatch:t})=>(t(I(e,{anchor:e.doc.length})),!0),Ct=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:0})),!0),wt=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Tt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Et=({state:e,dispatch:t})=>{let n=Q(e).map(({from:t,to:n})=>h.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:h.create(n),userEvent:`select`})),!0},Dt=({state:e,dispatch:t})=>{let n=F(e.selection,t=>{let n=i(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return h.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(I(e,n)),!0)};function Ot(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(I(n,h.create(i,i.length-1))),!0)}var kt=e=>Ot(e,!1),At=e=>Ot(e,!0),jt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=h.create([n.main]):n.main.empty||(r=h.create([h.cursor(n.main.head)])),r?(t(I(e,r)),!0):!1};function J(e,t){if(e.state.readOnly)return!1;let r=`delete.selection`,{state:i}=e,a=i.changeByRange(n=>{let{from:i,to:a}=n;if(i==a){let o=t(n);o<i?(r=`delete.backward`,o=Y(e,o,!1)):o>i&&(r=`delete.forward`,o=Y(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Y(e,i,!1),a=Y(e,a,!0);return i==a?{range:n}:{changes:{from:i,to:a},range:h.cursor(i,i<n.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(i.update(a,{scrollIntoView:!0,userEvent:r,effects:r==`delete.selection`?n.announce.of(i.phrase(`Selection deleted`)):void 0})),!0)}function Y(e,t,r){if(e instanceof n)for(let i of e.state.facet(n.atomicRanges).map(t=>t(e)))i.between(t,t,(e,n)=>{e<t&&n>t&&(t=r?n:e)});return t}var Mt=(e,n,r)=>J(e,i=>{let a=i.from,{state:o}=e,s=o.doc.lineAt(a),c,l;if(r&&!n&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,a-s.from))){if(c[c.length-1]==` `)return a-1;let e=p(c,o.tabSize)%b(o)||b(o);for(let t=0;t<e&&c[c.length-1-t]==` `;t++)a--;l=a}else l=t(s.text,a-s.from,n,n)+s.from,l==a&&s.number!=(n?o.doc.lines:1)?l+=n?1:-1:!n&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,a-s.from))&&(l=t(s.text,l-s.from,!1,!1)+s.from);return l}),X=e=>Mt(e,!1,!0),Nt=e=>Mt(e,!0,!1),Pt=(e,n)=>J(e,r=>{let i=r.head,{state:a}=e,o=a.doc.lineAt(i),s=a.charCategorizer(i);for(let e=null;;){if(i==(n?o.to:o.from)){i==r.head&&o.number!=(n?a.doc.lines:1)&&(i+=n?1:-1);break}let c=t(o.text,i-o.from,n)+o.from,l=o.text.slice(Math.min(i,c)-o.from,Math.max(i,c)-o.from),u=s(l);if(e!=null&&u!=e)break;(l!=` `||i!=r.head)&&(e=u),i=c}return i}),Z=e=>Pt(e,!1),Ft=e=>Pt(e,!0),It=e=>J(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Lt=e=>J(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Rt=e=>J(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),zt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:ne.of([``,``])},range:h.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Bt=({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let r=n.from,i=e.doc.lineAt(r),a=r==i.from?r-1:t(i.text,r-i.from,!1)+i.from,o=r==i.to?r+1:t(i.text,r-i.from,!0)+i.from;return{changes:{from:a,to:o,insert:e.doc.slice(r,o).append(e.doc.slice(a,r))},range:h.cursor(o)}});return r.changes.empty?!1:(n(e.update(r,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function Q(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Vt(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Q(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(h.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(h.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:h.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Ht=({state:e,dispatch:t})=>Vt(e,t,!1),Ut=({state:e,dispatch:t})=>Vt(e,t,!0);function Wt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Q(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Gt=({state:e,dispatch:t})=>Wt(e,t,!1),Kt=({state:e,dispatch:t})=>Wt(e,t,!0),qt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Q(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=F(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Jt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=i(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),o;return r&&a&&r.to<=t&&a.from>=t&&(o=r.type.prop(_.closedBy))&&o.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}var Yt=Zt(!1),Xt=Zt(!0);function Zt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Jt(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new ce(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=C(s,r);for(c??=p(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,S(t,c)];return o&&l.push(S(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:ne.of(l)},range:h.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function $(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:h.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Qt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new ce(e,{overrideIndentation:e=>n[e]??-1}),i=$(e,(t,i,a)=>{let o=C(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=S(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},$t=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ee)})}),{userEvent:`input.indent`})),!0),en=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=p(r,e.tabSize),a=0,o=S(e,Math.max(0,i-b(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),tn=e=>(e.setTabFocusMode(),!0),nn=[{key:`Ctrl-b`,run:B,shift:nt,preventDefault:!0},{key:`Ctrl-f`,run:V,shift:rt},{key:`Ctrl-p`,run:He,shift:ut},{key:`Ctrl-n`,run:Ue,shift:dt},{key:`Ctrl-a`,run:Ze,shift:yt},{key:`Ctrl-e`,run:Qe,shift:bt},{key:`Ctrl-d`,run:Nt},{key:`Ctrl-h`,run:X},{key:`Ctrl-k`,run:It},{key:`Ctrl-Alt-h`,run:Z},{key:`Ctrl-o`,run:zt},{key:`Ctrl-t`,run:Bt},{key:`Ctrl-v`,run:G}],rn=[{key:`ArrowLeft`,run:B,shift:nt,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Le,shift:at,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Ye,shift:_t,preventDefault:!0},{key:`ArrowRight`,run:V,shift:rt,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Re,shift:ot,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Xe,shift:vt,preventDefault:!0},{key:`ArrowUp`,run:He,shift:ut,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:xt,shift:Ct},{mac:`Ctrl-ArrowUp`,run:Ke,shift:pt},{key:`ArrowDown`,run:Ue,shift:dt,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:St,shift:wt},{mac:`Ctrl-ArrowDown`,run:G,shift:mt},{key:`PageUp`,run:Ke,shift:pt},{key:`PageDown`,run:G,shift:mt},{key:`Home`,run:Je,shift:gt,preventDefault:!0},{key:`Mod-Home`,run:xt,shift:Ct},{key:`End`,run:qe,shift:ht,preventDefault:!0},{key:`Mod-End`,run:St,shift:wt},{key:`Enter`,run:Yt,shift:Yt},{key:`Mod-a`,run:Tt},{key:`Backspace`,run:X,shift:X,preventDefault:!0},{key:`Delete`,run:Nt,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Z,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Ft,preventDefault:!0},{mac:`Mod-Backspace`,run:Lt,preventDefault:!0},{mac:`Mod-Delete`,run:Rt,preventDefault:!0}].concat(nn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),an=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Be,shift:st},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Ve,shift:ct},{key:`Alt-ArrowUp`,run:Ht},{key:`Shift-Alt-ArrowUp`,run:Gt},{key:`Alt-ArrowDown`,run:Ut},{key:`Shift-Alt-ArrowDown`,run:Kt},{key:`Mod-Alt-ArrowUp`,run:kt},{key:`Mod-Alt-ArrowDown`,run:At},{key:`Escape`,run:jt},{key:`Mod-Enter`,run:Xt},{key:`Alt-l`,mac:`Ctrl-l`,run:Et},{key:`Mod-i`,run:Dt,preventDefault:!0},{key:`Mod-[`,run:en},{key:`Mod-]`,run:$t},{key:`Mod-Alt-\\`,run:Qt},{key:`Shift-Mod-k`,run:qt},{key:`Shift-Mod-\\`,run:et},{key:`Mod-/`,run:de},{key:`Alt-A`,run:pe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:tn}].concat(rn),on={json:async()=>{let{json:t}=await e(async()=>{let{json:e}=await import(`./dist-DDaqk4vO.js`);return{json:e}},__vite__mapDeps([0,1,2]));return t()},markdown:async()=>{let{markdown:t}=await e(async()=>{let{markdown:e}=await import(`./dist-9WxiJAzp.js`);return{markdown:e}},__vite__mapDeps([3,4,1,2]));return t()},html:async()=>{let{html:t}=await e(async()=>{let{html:e}=await import(`./dist-DJjqNd_E.js`);return{html:e}},__vite__mapDeps([4,1,2]));return t()}};function sn(e){return e?le.define([{tag:v.keyword,color:`#d19afc`},{tag:v.string,color:`#87d68d`},{tag:v.number,color:`#f5a76c`},{tag:v.comment,color:`#8a8a8a`,fontStyle:`italic`},{tag:v.punctuation,color:`#7cc5e9`},{tag:v.function(v.variableName),color:`#7ea8f8`},{tag:v.propertyName,color:`#7ea8f8`},{tag:v.bool,color:`#f5a76c`},{tag:v.null,color:`#f5a76c`},{tag:v.operator,color:`#7cc5e9`},{tag:v.typeName,color:`#d19afc`},{tag:v.tagName,color:`#d19afc`},{tag:v.attributeName,color:`#87d68d`},{tag:v.attributeValue,color:`#87d68d`},{tag:v.heading,fontWeight:`bold`},{tag:v.emphasis,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`}]):le.define([{tag:v.keyword,color:`#8839ef`},{tag:v.string,color:`#40a02b`},{tag:v.number,color:`#d05d1a`},{tag:v.comment,color:`#8a8a8a`,fontStyle:`italic`},{tag:v.punctuation,color:`#1e66f5`},{tag:v.function(v.variableName),color:`#2b6cb0`},{tag:v.propertyName,color:`#2b6cb0`},{tag:v.bool,color:`#d05d1a`},{tag:v.null,color:`#d05d1a`},{tag:v.operator,color:`#1e66f5`},{tag:v.typeName,color:`#8839ef`},{tag:v.tagName,color:`#8839ef`},{tag:v.attributeName,color:`#40a02b`},{tag:v.attributeValue,color:`#40a02b`},{tag:v.heading,fontWeight:`bold`},{tag:v.emphasis,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`}])}function cn(e){return!(e.closest?.(`.theme-light`)||document.documentElement.classList.contains(`theme-light`))}function ln(){return n.theme({"&":{fontSize:`13px`,border:`1px solid var(--s2-border-subtle, #333)`,borderRadius:`var(--s2-radius-default, 8px)`,overflow:`hidden`},"&.cm-focused":{outline:`none`,borderColor:`var(--s2-border-focus, var(--s2-accent, #3562ff))`},".cm-content":{fontFamily:`var(--s2-font-mono, "SF Mono", "Fira Code", Consolas, monospace)`,caretColor:`var(--s2-accent, #3562ff)`,padding:`8px 0`},".cm-scroller":{overflow:`auto`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--s2-accent, #3562ff)`},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground":{background:`color-mix(in srgb, var(--s2-accent, #3562ff) 20%, transparent)`},".cm-activeLine":{background:`color-mix(in srgb, var(--s2-accent, #3562ff) 5%, transparent)`},".cm-gutters":{backgroundColor:`var(--s2-bg-layer-1, #1a1a1a)`,color:`var(--s2-content-tertiary, #5a5a5a)`,borderRight:`none`,borderRadius:`var(--s2-radius-default, 8px) 0 0 var(--s2-radius-default, 8px)`},".cm-lineNumbers .cm-gutterElement":{padding:`0 8px 0 12px`,minWidth:`32px`},".cm-placeholder":{color:`var(--s2-content-tertiary, #5a5a5a)`,fontStyle:`italic`}})}var un=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-9z8P-p4z.js","assets/dist-7wqtSoT3.js","assets/dist-ANJCbHMD.js","assets/dist-AKkMKegp.js","assets/dist-yvpVc8xu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-ca-nBW7U.js";import{$ as t,A as n,B as r,D as i,E as a,F as o,H as s,I as c,J as l,L as u,N as d,P as f,Q as p,R as m,S as ee,U as te,V as h,X as g,Y as ne,Z as re,at as _,c as ie,d as ae,j as oe,k as se,n as ce,nt as v,q as y,t as le,v as b,w as x,x as S,y as C,z as ue}from"./dist-7wqtSoT3.js";var de=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=T(e.state,n.from);return r.line?fe(e):r.block?me(e):!1};function w(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var fe=w(ve,0),pe=w(_e,0),me=w((e,t)=>_e(e,t,ge(t)),0);function T(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var E=50;function he(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-E,r),o=e.sliceDoc(i,i+E),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*E?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+E),d=e.sliceDoc(i-E,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function ge(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function _e(e,t,n=t.selection.ranges){let r=n.map(e=>T(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>he(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function ve(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=T(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var D=u.define(),ye=u.define(),be=te.define(),xe=te.define({combine(e){return re(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Se=l.define({create(){return P.empty},update(e,t){let n=t.state.facet(xe),r=t.annotation(D);if(r){let i=A.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?j(o,o.length,n.minDepth,i):je(o,t.startState.selection),new P(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ye);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(g.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=A.fromTransaction(t),o=t.annotation(g.time),s=t.annotation(g.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new P(e.done.map(A.fromJSON),e.undone.map(A.fromJSON))}});function Ce(e={}){return[Se,xe.of(e),n.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?we:e.inputType==`historyRedo`?k:null;return n?(e.preventDefault(),n(t)):!1}})]}function O(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Se,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var we=O(0,!1),k=O(1,!1),Te=O(0,!0),Ee=O(1,!0),A=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ue.fromJSON(t.changes),[],t.mapped&&m.fromJSON(t.mapped),t.startSelection&&h.fromJSON(t.startSelection),t.selectionsAfter.map(h.fromJSON))}static fromTransaction(t,n){let r=M;for(let e of t.startState.facet(be)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,M)}static selection(t){return new e(void 0,M,void 0,void 0,t)}};function j(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function De(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Oe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function ke(e,t){return e.length?t.length?e.concat(t):e:t}var M=[],Ae=200;function je(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Ae));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),j(e,e.length-1,1e9,n.setSelAfter(r)))}else return[A.selection([t])]}function Me(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function N(e,t){if(!e.length)return e;let n=e.length,r=M;for(;n;){let i=Ne(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[A.selection(r)]:M}function Ne(e,t,n){let r=ke(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):M,n);if(!e.changes)return A.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new A(i,y.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Pe=/^(input\.type|delete)($|\.)/,P=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Pe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,De(s.changes,t.changes))||r==`input.type.compose`)?j(o,o.length-1,i.minDepth,new A(t.changes.compose(s.changes),ke(y.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,M)):j(o,o.length,i.minDepth,t),new e(o,M,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:M;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Oe(a[a.length-1],t)?this:new e(je(this.done,t),this.undone,n,r)}addMapping(t){return new e(N(this.done,t),N(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:D.of({side:e,rest:Me(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?M:r.slice(0,r.length-1);return i.mapped&&(n=N(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:D.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};P.empty=new P(M,M);var Fe=[{key:`Mod-z`,run:we,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:k,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:k,preventDefault:!0},{key:`Mod-u`,run:Te,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Ee,preventDefault:!0}];function F(e,t){return h.create(e.ranges.map(t),e.mainIndex)}function I(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function L({state:e,dispatch:t},n){let r=F(e.selection,n);return r.eq(e.selection,!0)?!1:(t(I(e,r)),!0)}function R(e,t){return h.cursor(t?e.to:e.from)}function Ie(e,t){return L(e,n=>n.empty?e.moveByChar(n,t):R(n,t))}function z(e){return e.textDirectionAt(e.state.selection.main.head)==se.LTR}var B=e=>Ie(e,!z(e)),V=e=>Ie(e,z(e));function H(e,t){return L(e,n=>n.empty?e.moveByGroup(n,t):R(n,t))}var Le=e=>H(e,!z(e)),Re=e=>H(e,z(e));typeof Intl<`u`&&Intl.Segmenter;function ze(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function U(e,t,n){let r=i(e).resolveInner(t.head),a=n?_.closedBy:_.openedBy;for(let i=t.head;;){let t=n?r.childAfter(i):r.childBefore(i);if(!t)break;ze(e,t,a)?r=t:i=n?t.to:t.from}let o=r.type.prop(a),s,c;return c=o&&(s=n?x(e,r.from,1):x(e,r.to,-1))&&s.matched?n?s.end.to:s.end.from:n?r.to:r.from,h.cursor(c,n?-1:1)}var Be=e=>L(e,t=>U(e.state,t,!z(e))),Ve=e=>L(e,t=>U(e.state,t,z(e)));function W(e,t){return L(e,n=>{if(!n.empty)return R(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var He=e=>W(e,!1),Ue=e=>W(e,!0);function We(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,i=0,a;if(t){for(let t of e.state.facet(n.scrollMargins)){let n=t(e);n?.top&&(r=Math.max(n?.top,r)),n?.bottom&&(i=Math.max(n?.bottom,i))}a=e.scrollDOM.clientHeight-r-i}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function Ge(e,t){let r=We(e),{state:i}=e,a=F(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):R(n,t));if(a.eq(i.selection))return!1;let o;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),c=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>c&&t.bottom<l&&(o=n.scrollIntoView(a.main.head,{y:`start`,yMargin:t.top-c}))}return e.dispatch(I(i,a),{effects:o}),!0}var Ke=e=>Ge(e,!1),G=e=>Ge(e,!0);function K(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=h.cursor(r.from+n))}return i}var qe=e=>L(e,t=>K(e,t,!0)),Je=e=>L(e,t=>K(e,t,!1)),Ye=e=>L(e,t=>K(e,t,!z(e))),Xe=e=>L(e,t=>K(e,t,z(e))),Ze=e=>L(e,t=>h.cursor(e.lineBlockAt(t.head).from,1)),Qe=e=>L(e,t=>h.cursor(e.lineBlockAt(t.head).to,-1));function $e(e,t,n){let r=!1,i=F(e.selection,t=>{let i=x(e,t.head,-1)||x(e,t.head,1)||t.head>0&&x(e,t.head-1,1)||t.head<e.doc.length&&x(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?h.range(t.anchor,a):h.cursor(a)});return r?(t(I(e,i)),!0):!1}var et=({state:e,dispatch:t})=>$e(e,t,!1);function q(e,t){let n=F(e.state.selection,e=>{let n=t(e);return h.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(I(e.state,n)),!0)}function tt(e,t){return q(e,n=>e.moveByChar(n,t))}var nt=e=>tt(e,!z(e)),rt=e=>tt(e,z(e));function it(e,t){return q(e,n=>e.moveByGroup(n,t))}var at=e=>it(e,!z(e)),ot=e=>it(e,z(e)),st=e=>q(e,t=>U(e.state,t,!z(e))),ct=e=>q(e,t=>U(e.state,t,z(e)));function lt(e,t){return q(e,n=>e.moveVertically(n,t))}var ut=e=>lt(e,!1),dt=e=>lt(e,!0);function ft(e,t){return q(e,n=>e.moveVertically(n,t,We(e).height))}var pt=e=>ft(e,!1),mt=e=>ft(e,!0),ht=e=>q(e,t=>K(e,t,!0)),gt=e=>q(e,t=>K(e,t,!1)),_t=e=>q(e,t=>K(e,t,!z(e))),vt=e=>q(e,t=>K(e,t,z(e))),yt=e=>q(e,t=>h.cursor(e.lineBlockAt(t.head).from)),bt=e=>q(e,t=>h.cursor(e.lineBlockAt(t.head).to)),xt=({state:e,dispatch:t})=>(t(I(e,{anchor:0})),!0),St=({state:e,dispatch:t})=>(t(I(e,{anchor:e.doc.length})),!0),Ct=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:0})),!0),wt=({state:e,dispatch:t})=>(t(I(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Tt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Et=({state:e,dispatch:t})=>{let n=Q(e).map(({from:t,to:n})=>h.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:h.create(n),userEvent:`select`})),!0},Dt=({state:e,dispatch:t})=>{let n=F(e.selection,t=>{let n=i(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return h.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(I(e,n)),!0)};function Ot(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(I(n,h.create(i,i.length-1))),!0)}var kt=e=>Ot(e,!1),At=e=>Ot(e,!0),jt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=h.create([n.main]):n.main.empty||(r=h.create([h.cursor(n.main.head)])),r?(t(I(e,r)),!0):!1};function J(e,t){if(e.state.readOnly)return!1;let r=`delete.selection`,{state:i}=e,a=i.changeByRange(n=>{let{from:i,to:a}=n;if(i==a){let o=t(n);o<i?(r=`delete.backward`,o=Y(e,o,!1)):o>i&&(r=`delete.forward`,o=Y(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Y(e,i,!1),a=Y(e,a,!0);return i==a?{range:n}:{changes:{from:i,to:a},range:h.cursor(i,i<n.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(i.update(a,{scrollIntoView:!0,userEvent:r,effects:r==`delete.selection`?n.announce.of(i.phrase(`Selection deleted`)):void 0})),!0)}function Y(e,t,r){if(e instanceof n)for(let i of e.state.facet(n.atomicRanges).map(t=>t(e)))i.between(t,t,(e,n)=>{e<t&&n>t&&(t=r?n:e)});return t}var Mt=(e,n,r)=>J(e,i=>{let a=i.from,{state:o}=e,s=o.doc.lineAt(a),c,l;if(r&&!n&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,a-s.from))){if(c[c.length-1]==` `)return a-1;let e=p(c,o.tabSize)%b(o)||b(o);for(let t=0;t<e&&c[c.length-1-t]==` `;t++)a--;l=a}else l=t(s.text,a-s.from,n,n)+s.from,l==a&&s.number!=(n?o.doc.lines:1)?l+=n?1:-1:!n&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,a-s.from))&&(l=t(s.text,l-s.from,!1,!1)+s.from);return l}),X=e=>Mt(e,!1,!0),Nt=e=>Mt(e,!0,!1),Pt=(e,n)=>J(e,r=>{let i=r.head,{state:a}=e,o=a.doc.lineAt(i),s=a.charCategorizer(i);for(let e=null;;){if(i==(n?o.to:o.from)){i==r.head&&o.number!=(n?a.doc.lines:1)&&(i+=n?1:-1);break}let c=t(o.text,i-o.from,n)+o.from,l=o.text.slice(Math.min(i,c)-o.from,Math.max(i,c)-o.from),u=s(l);if(e!=null&&u!=e)break;(l!=` `||i!=r.head)&&(e=u),i=c}return i}),Z=e=>Pt(e,!1),Ft=e=>Pt(e,!0),It=e=>J(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Lt=e=>J(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Rt=e=>J(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),zt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:ne.of([``,``])},range:h.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Bt=({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let r=n.from,i=e.doc.lineAt(r),a=r==i.from?r-1:t(i.text,r-i.from,!1)+i.from,o=r==i.to?r+1:t(i.text,r-i.from,!0)+i.from;return{changes:{from:a,to:o,insert:e.doc.slice(r,o).append(e.doc.slice(a,r))},range:h.cursor(o)}});return r.changes.empty?!1:(n(e.update(r,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function Q(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Vt(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Q(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(h.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(h.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:h.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Ht=({state:e,dispatch:t})=>Vt(e,t,!1),Ut=({state:e,dispatch:t})=>Vt(e,t,!0);function Wt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Q(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Gt=({state:e,dispatch:t})=>Wt(e,t,!1),Kt=({state:e,dispatch:t})=>Wt(e,t,!0),qt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Q(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=F(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Jt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=i(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),o;return r&&a&&r.to<=t&&a.from>=t&&(o=r.type.prop(_.closedBy))&&o.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}var Yt=Zt(!1),Xt=Zt(!0);function Zt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Jt(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new ce(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=C(s,r);for(c??=p(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,S(t,c)];return o&&l.push(S(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:ne.of(l)},range:h.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function $(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:h.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Qt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new ce(e,{overrideIndentation:e=>n[e]??-1}),i=$(e,(t,i,a)=>{let o=C(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=S(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},$t=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ee)})}),{userEvent:`input.indent`})),!0),en=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=p(r,e.tabSize),a=0,o=S(e,Math.max(0,i-b(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),tn=e=>(e.setTabFocusMode(),!0),nn=[{key:`Ctrl-b`,run:B,shift:nt,preventDefault:!0},{key:`Ctrl-f`,run:V,shift:rt},{key:`Ctrl-p`,run:He,shift:ut},{key:`Ctrl-n`,run:Ue,shift:dt},{key:`Ctrl-a`,run:Ze,shift:yt},{key:`Ctrl-e`,run:Qe,shift:bt},{key:`Ctrl-d`,run:Nt},{key:`Ctrl-h`,run:X},{key:`Ctrl-k`,run:It},{key:`Ctrl-Alt-h`,run:Z},{key:`Ctrl-o`,run:zt},{key:`Ctrl-t`,run:Bt},{key:`Ctrl-v`,run:G}],rn=[{key:`ArrowLeft`,run:B,shift:nt,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Le,shift:at,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Ye,shift:_t,preventDefault:!0},{key:`ArrowRight`,run:V,shift:rt,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Re,shift:ot,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Xe,shift:vt,preventDefault:!0},{key:`ArrowUp`,run:He,shift:ut,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:xt,shift:Ct},{mac:`Ctrl-ArrowUp`,run:Ke,shift:pt},{key:`ArrowDown`,run:Ue,shift:dt,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:St,shift:wt},{mac:`Ctrl-ArrowDown`,run:G,shift:mt},{key:`PageUp`,run:Ke,shift:pt},{key:`PageDown`,run:G,shift:mt},{key:`Home`,run:Je,shift:gt,preventDefault:!0},{key:`Mod-Home`,run:xt,shift:Ct},{key:`End`,run:qe,shift:ht,preventDefault:!0},{key:`Mod-End`,run:St,shift:wt},{key:`Enter`,run:Yt,shift:Yt},{key:`Mod-a`,run:Tt},{key:`Backspace`,run:X,shift:X,preventDefault:!0},{key:`Delete`,run:Nt,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Z,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Ft,preventDefault:!0},{mac:`Mod-Backspace`,run:Lt,preventDefault:!0},{mac:`Mod-Delete`,run:Rt,preventDefault:!0}].concat(nn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),an=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Be,shift:st},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Ve,shift:ct},{key:`Alt-ArrowUp`,run:Ht},{key:`Shift-Alt-ArrowUp`,run:Gt},{key:`Alt-ArrowDown`,run:Ut},{key:`Shift-Alt-ArrowDown`,run:Kt},{key:`Mod-Alt-ArrowUp`,run:kt},{key:`Mod-Alt-ArrowDown`,run:At},{key:`Escape`,run:jt},{key:`Mod-Enter`,run:Xt},{key:`Alt-l`,mac:`Ctrl-l`,run:Et},{key:`Mod-i`,run:Dt,preventDefault:!0},{key:`Mod-[`,run:en},{key:`Mod-]`,run:$t},{key:`Mod-Alt-\\`,run:Qt},{key:`Shift-Mod-k`,run:qt},{key:`Shift-Mod-\\`,run:et},{key:`Mod-/`,run:de},{key:`Alt-A`,run:pe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:tn}].concat(rn),on={json:async()=>{let{json:t}=await e(async()=>{let{json:e}=await import(`./dist-9z8P-p4z.js`);return{json:e}},__vite__mapDeps([0,1,2]));return t()},markdown:async()=>{let{markdown:t}=await e(async()=>{let{markdown:e}=await import(`./dist-AKkMKegp.js`);return{markdown:e}},__vite__mapDeps([3,4,1,2]));return t()},html:async()=>{let{html:t}=await e(async()=>{let{html:e}=await import(`./dist-yvpVc8xu.js`);return{html:e}},__vite__mapDeps([4,1,2]));return t()}};function sn(e){return e?le.define([{tag:v.keyword,color:`#d19afc`},{tag:v.string,color:`#87d68d`},{tag:v.number,color:`#f5a76c`},{tag:v.comment,color:`#8a8a8a`,fontStyle:`italic`},{tag:v.punctuation,color:`#7cc5e9`},{tag:v.function(v.variableName),color:`#7ea8f8`},{tag:v.propertyName,color:`#7ea8f8`},{tag:v.bool,color:`#f5a76c`},{tag:v.null,color:`#f5a76c`},{tag:v.operator,color:`#7cc5e9`},{tag:v.typeName,color:`#d19afc`},{tag:v.tagName,color:`#d19afc`},{tag:v.attributeName,color:`#87d68d`},{tag:v.attributeValue,color:`#87d68d`},{tag:v.heading,fontWeight:`bold`},{tag:v.emphasis,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`}]):le.define([{tag:v.keyword,color:`#8839ef`},{tag:v.string,color:`#40a02b`},{tag:v.number,color:`#d05d1a`},{tag:v.comment,color:`#8a8a8a`,fontStyle:`italic`},{tag:v.punctuation,color:`#1e66f5`},{tag:v.function(v.variableName),color:`#2b6cb0`},{tag:v.propertyName,color:`#2b6cb0`},{tag:v.bool,color:`#d05d1a`},{tag:v.null,color:`#d05d1a`},{tag:v.operator,color:`#1e66f5`},{tag:v.typeName,color:`#8839ef`},{tag:v.tagName,color:`#8839ef`},{tag:v.attributeName,color:`#40a02b`},{tag:v.attributeValue,color:`#40a02b`},{tag:v.heading,fontWeight:`bold`},{tag:v.emphasis,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`}])}function cn(e){return!(e.closest?.(`.theme-light`)||document.documentElement.classList.contains(`theme-light`))}function ln(){return n.theme({"&":{fontSize:`13px`,border:`1px solid var(--s2-border-subtle, #333)`,borderRadius:`var(--s2-radius-default, 8px)`,overflow:`hidden`},"&.cm-focused":{outline:`none`,borderColor:`var(--s2-border-focus, var(--s2-accent, #3562ff))`},".cm-content":{fontFamily:`var(--s2-font-mono, "SF Mono", "Fira Code", Consolas, monospace)`,caretColor:`var(--s2-accent, #3562ff)`,padding:`8px 0`},".cm-scroller":{overflow:`auto`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--s2-accent, #3562ff)`},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground":{background:`color-mix(in srgb, var(--s2-accent, #3562ff) 20%, transparent)`},".cm-activeLine":{background:`color-mix(in srgb, var(--s2-accent, #3562ff) 5%, transparent)`},".cm-gutters":{backgroundColor:`var(--s2-bg-layer-1, #1a1a1a)`,color:`var(--s2-content-tertiary, #5a5a5a)`,borderRight:`none`,borderRadius:`var(--s2-radius-default, 8px) 0 0 var(--s2-radius-default, 8px)`},".cm-lineNumbers .cm-gutterElement":{padding:`0 8px 0 12px`,minWidth:`32px`},".cm-placeholder":{color:`var(--s2-content-tertiary, #5a5a5a)`,fontStyle:`italic`}})}var un=`
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
5
5
|
background: var(--s2-bg-layer-2, var(--s2-gray-75, #252525));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OffscreenClient as e}from"./offscreen-client-C-eO0M8j.js";function t(e){let t=!1,n=()=>{t||(t=!0,typeof e.start==`function`&&e.start())};return{onMessage:t=>{let r=e=>{t(e.data)};return e.addEventListener(`message`,r),n(),()=>{e.removeEventListener(`message`,r)}},send:t=>{e.postMessage(t)}}}function n(e){let n=t(e);return{onMessage:e=>n.onMessage(e),send:e=>{n.send({source:`panel`,payload:e})}}}function r(e,n){let r=t(e),i=new Map,a=r.onMessage(async e=>{let t=e;if(t?.type){if(t.type===`cdp-cmd`){let t=e;try{let e=await n.send(t.method,t.params,t.sessionId);r.send({type:`cdp-response`,id:t.id,result:e})}catch(e){r.send({type:`cdp-response`,id:t.id,error:e instanceof Error?e.message:String(e)})}return}if(t.type===`cdp-subscribe`){let t=e;if(i.has(t.event))return;let a=e=>{r.send({type:`cdp-event`,method:t.event,params:e})};i.set(t.event,a),n.on(t.event,a);return}if(t.type===`cdp-unsubscribe`){let t=e,r=i.get(t.event);if(!r)return;i.delete(t.event),n.off(t.event,r);return}}});return()=>{a();for(let[e,t]of i)n.off(e,t);i.clear()}}function i(){let e={};if(typeof localStorage>`u`)return e;for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n===null)continue;let r=localStorage.getItem(n);r!==null&&(e[n]=r)}return e}function a(t){let{worker:i,realCdpTransport:a,callbacks:o}=t,s=t.readyTimeoutMs??3e4,c=t.localStorageSeed??{},l=new MessageChannel,u=new MessageChannel,d=new e(o,n(l.port1)),f=r(u.port1,a),p=null,m=new Promise((e,t)=>{let n=null,r=null;p=()=>{r!==null&&(l.port1.removeEventListener(`message`,r),r=null),n!==null&&(clearTimeout(n),n=null)},r=t=>{t.data?.type===`kernel-worker-ready`&&(p?.(),e())},l.port1.addEventListener(`message`,r),n=setTimeout(()=>{p?.(),t(Error(`Kernel worker did not signal ready within ${s}ms`))},s)}),h={type:`kernel-worker-init`,kernelPort:l.port2,cdpPort:u.port2,localStorageSeed:c};i.postMessage(h,[l.port2,u.port2]);let g=!1;return{client:d,ready:m,dispose(){if(!g){g=!0,p?.(),f();try{i.postMessage({type:`kernel-worker-shutdown`})}catch{}i.terminate(),l.port1.close(),u.port1.close()}}}}function o(e){return a({worker:e.workerUrl?new Worker(e.workerUrl,{type:`module`}):new Worker(new URL(`/assets/kernel-worker-T6WVB03A.js`,``+import.meta.url),{type:`module`}),realCdpTransport:e.realCdpTransport,callbacks:e.callbacks,readyTimeoutMs:e.readyTimeoutMs,localStorageSeed:e.localStorageSeed??i()})}export{o as spawnKernelWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(!e)return null;try{let t=new URL(e.trim());t.search=``,t.hash=``,t.pathname!==`/`&&(t.pathname=t.pathname.replace(/\/+$/,``)||`/`);let n=t.toString();return n.endsWith(`/`)?n.slice(0,-1):n}catch{return null}}function t(t){if(!t)return null;try{let n=new URL(t.trim());n.search=``,n.hash=``;let r=n.toString(),i=n.pathname.split(`/`).filter(Boolean);if(i.length<2||i.at(-2)!==`join`)return null;let[a,o,...s]=decodeURIComponent(i.at(-1)).split(`.`);if(!a||!o||s.length>0)return null;i.splice(-2,2),n.pathname=i.length>0?`/${i.join(`/`)}`:`/`;let c=e(n.toString());return c?{workerBaseUrl:c,trayId:a,joinUrl:r}:null}catch{return null}}var n=`slicc.trayWorkerBaseUrl`,r=`slicc.trayJoinUrl`,i=`https://www.sliccy.ai`;function a(n){if(!n)return null;try{let r=new URL(n.trim());r.search=``,r.hash=``;let i=r.pathname.split(`/`).filter(Boolean),a=null;if(i.length>=2&&i.at(-2)===`tray`)a=decodeURIComponent(i.at(-1)),i.splice(-2,2),r.pathname=i.length>0?`/${i.join(`/`)}`:`/`;else if(i.length>=2&&i.at(-2)===`join`)return t(r.toString());let o=e(r.toString());return o?{workerBaseUrl:o,trayId:a,joinUrl:null}:null}catch{return null}}function o(e){let t=a(e);return t?.joinUrl?t:null}function s(e,t){let i=o(t);return i?(e.setItem(r,i.joinUrl),e.setItem(n,i.workerBaseUrl),i):null}function c(e){return!!o(e?.getItem(`slicc.trayJoinUrl`)??null)}var l={state:`inactive`,joinUrl:null,trayId:null,error:null,lastPingTime:null,reconnectAttempts:0,attachAttempts:0,lastAttachCode:null,connectingSince:null,lastError:null};function u(){return{...l}}var d=new Set;function f(){if(d.size!==0)for(let e of[...d])try{e({...l})}catch{}}function p(e){l={...e},f()}export{n as a,r as i,p as n,c as o,i as r,s,u as t};
|
package/dist/ui/index.html
CHANGED
|
@@ -5,34 +5,23 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BwXd759y.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-jRWAZmH_.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/preload-helper-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/simple-options-xknIywaW.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/headers-C5V-E251.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/openai-codex-responses-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/logger-GnnuzSDq.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/provider-settings-CUaP23bT.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/openai-codex-responses-DZCabvyg.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-Bfjhqqf1.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-O2aOn13V.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/logger-B-No_qN_.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/provider-settings-DqBn0YRV.js">
|
|
20
18
|
<link rel="modulepreload" crossorigin href="/assets/hash-Bt1aVMQ3.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/mount-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/path-utils-C99GOg2c.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/git-config-CrkeZAt9.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/db-UiVJ_81p.js">
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/types-U7svdiTt.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/magick-wasm-Bq3dEoCR.js">
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/skills-B0ehYakX.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/__vite-browser-external-B-U7N2L4.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/index-DSvcd4se.js">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/fs-DD0Q7cyC.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/mime-types-DL940yDZ.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/mount-picker-popup-BLHoVG3y.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/mount-DqlYdKCz.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-Zd1dbko2.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/index-BwXd759y.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/fs-CNwG-SWt.js">
|
|
36
25
|
<link rel="stylesheet" crossorigin href="/assets/index-DdfOxRii.css">
|
|
37
26
|
</head>
|
|
38
27
|
<body>
|
|
@@ -5,34 +5,23 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BwXd759y.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-jRWAZmH_.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/preload-helper-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/simple-options-xknIywaW.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/headers-C5V-E251.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/openai-codex-responses-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/logger-GnnuzSDq.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/provider-settings-CUaP23bT.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/openai-codex-responses-DZCabvyg.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-Bfjhqqf1.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-O2aOn13V.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/logger-B-No_qN_.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/provider-settings-DqBn0YRV.js">
|
|
20
18
|
<link rel="modulepreload" crossorigin href="/assets/hash-Bt1aVMQ3.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/mount-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/path-utils-C99GOg2c.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/git-config-CrkeZAt9.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/db-UiVJ_81p.js">
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/types-U7svdiTt.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/magick-wasm-Bq3dEoCR.js">
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/skills-B0ehYakX.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/__vite-browser-external-B-U7N2L4.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/index-DSvcd4se.js">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/fs-DD0Q7cyC.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/mime-types-DL940yDZ.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/mount-picker-popup-BLHoVG3y.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/mount-DqlYdKCz.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-Zd1dbko2.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/index-BwXd759y.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/fs-CNwG-SWt.js">
|
|
36
25
|
<link rel="stylesheet" crossorigin href="/assets/index-DdfOxRii.css">
|
|
37
26
|
</head>
|
|
38
27
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sliccy",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.0",
|
|
4
4
|
"description": "Browser-based coding agent with thin CLI server",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"start:electron": "node dist/node-server/index.js --electron",
|
|
40
40
|
"preflight": "node packages/dev-tools/tools/preflight-deps.mjs",
|
|
41
41
|
"pretypecheck": "npm run preflight",
|
|
42
|
-
"typecheck": "tsc --noEmit -p tsconfig.cli.json && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.worker.json",
|
|
42
|
+
"typecheck": "tsc --noEmit -p tsconfig.cli.json && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.worker.json && tsc --noEmit -p tsconfig.webapp-worker.json",
|
|
43
43
|
"pretest": "npm run preflight",
|
|
44
44
|
"test": "vitest run",
|
|
45
45
|
"test:coverage": "vitest run --coverage",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-jRWAZmH_.js";var t=e(((e,t)=>{t.exports={}}));export{t};
|