@blastlauncher/web 0.0.0-stage → 3.0.0-alpha.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/LICENSE +7 -0
- package/README.md +85 -2
- package/assets/almostnode.mjs +735 -0
- package/assets/blast-sources.json +1 -0
- package/assets/blast-web.js +35 -0
- package/assets/esbuild.mjs +2695 -0
- package/assets/esbuild.wasm +0 -0
- package/dist/browser-bundle.d.ts +54 -0
- package/dist/browser-bundle.js +441 -0
- package/dist/browser-install.d.ts +66 -0
- package/dist/browser-install.js +326 -0
- package/dist/bundle-config.d.ts +10 -0
- package/dist/bundle-config.js +31 -0
- package/dist/bundles.d.ts +29 -0
- package/dist/bundles.js +126 -0
- package/dist/capabilities.d.ts +66 -0
- package/dist/capabilities.js +288 -0
- package/dist/custom-element.d.ts +6 -0
- package/dist/custom-element.js +36 -0
- package/dist/default-renderer.d.ts +27 -0
- package/dist/default-renderer.js +145 -0
- package/dist/default-styles.d.ts +2 -0
- package/dist/default-styles.js +28 -0
- package/dist/extension-files.d.ts +21 -0
- package/dist/extension-files.js +86 -0
- package/dist/handlers.d.ts +18 -0
- package/dist/handlers.js +22 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +17 -0
- package/dist/launch.d.ts +11 -0
- package/dist/launch.js +29 -0
- package/dist/prebuilt.d.ts +24 -0
- package/dist/prebuilt.js +112 -0
- package/dist/render.d.ts +62 -0
- package/dist/render.js +288 -0
- package/dist/runtime-port.d.ts +5 -0
- package/dist/runtime-port.js +8 -0
- package/dist/sandbox.d.ts +25 -0
- package/dist/sandbox.js +71 -0
- package/dist/session.d.ts +77 -0
- package/dist/session.js +520 -0
- package/dist/source.d.ts +16 -0
- package/dist/source.js +42 -0
- package/package.json +33 -4
- package/sandbox/almostnode-full.mjs +19713 -0
- package/sandbox/index.html +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var ri=Object.create;var{getPrototypeOf:si,defineProperty:Jn,getOwnPropertyNames:oi}=Object;var Kn=Object.prototype.hasOwnProperty;function ii(e){return this[e]}var ai,ci,li=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var s=t?ai??=new WeakMap:ci??=new WeakMap,o=s.get(e);if(o)return o}n=e!=null?ri(si(e)):{};let i=t||!e||!e.__esModule||!Kn.call(e,"default")?Jn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of oi(e))if(!Kn.call(i,a))Jn(i,a,{get:ii.bind(e,a),enumerable:!0})}if(r)s.set(e,i);return i};var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var st=T(function(cp,vr){var aa=Number.MAX_SAFE_INTEGER||9007199254740991,ca=["major","premajor","minor","preminor","patch","prepatch","prerelease"];vr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:aa,RELEASE_TYPES:ca,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ht=T(function(lp,Ir){var la=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ir.exports=la});var ot=T(function(Ae,Ar){var{MAX_SAFE_COMPONENT_LENGTH:pn,MAX_SAFE_BUILD_LENGTH:ua,MAX_LENGTH:da}=st(),pa=ht();Ae=Ar.exports={};var fa=Ae.re=[],ma=Ae.safeRe=[],v=Ae.src=[],ha=Ae.safeSrc=[],I=Ae.t={},ga=0,fn="[a-zA-Z0-9-]",ba=[["\\s",1],["\\d",da],[fn,ua]],ya=(e)=>{for(let[t,n]of ba)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},L=(e,t,n)=>{let r=ya(t),s=ga++;pa(e,s,t),I[e]=s,v[s]=t,ha[s]=r,fa[s]=new RegExp(t,n?"g":void 0),ma[s]=new RegExp(r,n?"g":void 0)};L("NUMERICIDENTIFIER","0|[1-9]\\d*");L("NUMERICIDENTIFIERLOOSE","\\d+");L("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fn}*`);L("MAINVERSION",`(${v[I.NUMERICIDENTIFIER]})\\.(${v[I.NUMERICIDENTIFIER]})\\.(${v[I.NUMERICIDENTIFIER]})`);L("MAINVERSIONLOOSE",`(${v[I.NUMERICIDENTIFIERLOOSE]})\\.(${v[I.NUMERICIDENTIFIERLOOSE]})\\.(${v[I.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASEIDENTIFIER",`(?:${v[I.NONNUMERICIDENTIFIER]}|${v[I.NUMERICIDENTIFIER]})`);L("PRERELEASEIDENTIFIERLOOSE",`(?:${v[I.NONNUMERICIDENTIFIER]}|${v[I.NUMERICIDENTIFIERLOOSE]})`);L("PRERELEASE",`(?:-(${v[I.PRERELEASEIDENTIFIER]}(?:\\.${v[I.PRERELEASEIDENTIFIER]})*))`);L("PRERELEASELOOSE",`(?:-?(${v[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[I.PRERELEASEIDENTIFIERLOOSE]})*))`);L("BUILDIDENTIFIER",`${fn}+`);L("BUILD",`(?:\\+(${v[I.BUILDIDENTIFIER]}(?:\\.${v[I.BUILDIDENTIFIER]})*))`);L("FULLPLAIN",`v?${v[I.MAINVERSION]}${v[I.PRERELEASE]}?${v[I.BUILD]}?`);L("FULL",`^${v[I.FULLPLAIN]}$`);L("LOOSEPLAIN",`[v=\\s]*${v[I.MAINVERSIONLOOSE]}${v[I.PRERELEASELOOSE]}?${v[I.BUILD]}?`);L("LOOSE",`^${v[I.LOOSEPLAIN]}$`);L("GTLT","((?:<|>)?=?)");L("XRANGEIDENTIFIERLOOSE",`${v[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);L("XRANGEIDENTIFIER",`${v[I.NUMERICIDENTIFIER]}|x|X|\\*`);L("XRANGEPLAIN",`[v=\\s]*(${v[I.XRANGEIDENTIFIER]})(?:\\.(${v[I.XRANGEIDENTIFIER]})(?:\\.(${v[I.XRANGEIDENTIFIER]})(?:${v[I.PRERELEASE]})?${v[I.BUILD]}?)?)?`);L("XRANGEPLAINLOOSE",`[v=\\s]*(${v[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[I.XRANGEIDENTIFIERLOOSE]})(?:${v[I.PRERELEASELOOSE]})?${v[I.BUILD]}?)?)?`);L("XRANGE",`^${v[I.GTLT]}\\s*${v[I.XRANGEPLAIN]}$`);L("XRANGELOOSE",`^${v[I.GTLT]}\\s*${v[I.XRANGEPLAINLOOSE]}$`);L("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pn}})(?:\\.(\\d{1,${pn}}))?(?:\\.(\\d{1,${pn}}))?`);L("COERCE",`${v[I.COERCEPLAIN]}(?:$|[^\\d])`);L("COERCEFULL",v[I.COERCEPLAIN]+`(?:${v[I.PRERELEASE]})?(?:${v[I.BUILD]})?(?:$|[^\\d])`);L("COERCERTL",v[I.COERCE],!0);L("COERCERTLFULL",v[I.COERCEFULL],!0);L("LONETILDE","(?:~>?)");L("TILDETRIM",`(\\s*)${v[I.LONETILDE]}\\s+`,!0);Ae.tildeTrimReplace="$1~";L("TILDE",`^${v[I.LONETILDE]}${v[I.XRANGEPLAIN]}$`);L("TILDELOOSE",`^${v[I.LONETILDE]}${v[I.XRANGEPLAINLOOSE]}$`);L("LONECARET","(?:\\^)");L("CARETTRIM",`(\\s*)${v[I.LONECARET]}\\s+`,!0);Ae.caretTrimReplace="$1^";L("CARET",`^${v[I.LONECARET]}${v[I.XRANGEPLAIN]}$`);L("CARETLOOSE",`^${v[I.LONECARET]}${v[I.XRANGEPLAINLOOSE]}$`);L("COMPARATORLOOSE",`^${v[I.GTLT]}\\s*(${v[I.LOOSEPLAIN]})$|^$`);L("COMPARATOR",`^${v[I.GTLT]}\\s*(${v[I.FULLPLAIN]})$|^$`);L("COMPARATORTRIM",`(\\s*)${v[I.GTLT]}\\s*(${v[I.LOOSEPLAIN]}|${v[I.XRANGEPLAIN]})`,!0);Ae.comparatorTrimReplace="$1$2$3";L("HYPHENRANGE",`^\\s*(${v[I.XRANGEPLAIN]})\\s+-\\s+(${v[I.XRANGEPLAIN]})\\s*$`);L("HYPHENRANGELOOSE",`^\\s*(${v[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[I.XRANGEPLAINLOOSE]})\\s*$`);L("STAR","(<|>)?=?\\s*\\*");L("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");L("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ot=T(function(up,Nr){var wa=Object.freeze({loose:!0}),xa=Object.freeze({}),Ea=(e)=>{if(!e)return xa;if(typeof e!=="object")return wa;return e};Nr.exports=Ea});var mn=T(function(dp,Tr){var Or=/^[0-9]+$/,Cr=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let n=Or.test(e),r=Or.test(t);if(n&&r)e=+e,t=+t;return e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},$a=(e,t)=>Cr(t,e);Tr.exports={compareIdentifiers:Cr,rcompareIdentifiers:$a}});var te=T(function(pp,Pr){var Ct=ht(),{MAX_LENGTH:Lr,MAX_SAFE_INTEGER:Tt}=st(),{safeRe:Lt,t:Pt}=ot(),ka=Ot(),{compareIdentifiers:hn}=mn(),Sa=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;r<n.length;r++)if(hn(e[r],n[r])!==0)return!1;return!0};class ve{constructor(e,t){if(t=ka(t),e instanceof ve)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lr)throw TypeError(`version is longer than ${Lr} characters`);Ct("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Lt[Pt.LOOSE]:Lt[Pt.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Tt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Tt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Tt||this.patch<0)throw TypeError("Invalid patch version");if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map((r)=>{if(/^[0-9]+$/.test(r)){let s=+r;if(s>=0&&s<Tt)return s}return r});this.build=n[5]?n[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Ct("SemVer.compare",this.version,this.options,e),!(e instanceof ve)){if(typeof e==="string"&&e===this.version)return 0;e=new ve(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof ve))e=new ve(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof ve))e=new ve(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],r=e.prerelease[t];if(Ct("prerelease compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return hn(n,r)}while(++t)}compareBuild(e){if(!(e instanceof ve))e=new ve(e,this.options);let t=0;do{let n=this.build[t],r=e.build[t];if(Ct("build compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return hn(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw Error("invalid increment argument: identifier is empty");if(t){let r=`-${t}`.match(this.options.loose?Lt[Pt.PRERELEASELOOSE]:Lt[Pt.PRERELEASE]);if(!r||r[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,n);this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){let s=[t,r];if(n===!1)s=[t];if(Sa(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Pr.exports=ve});var _e=T(function(fp,Br){var Mr=te(),Ra=(e,t,n=!1)=>{if(e instanceof Mr)return e;try{return new Mr(e,t)}catch(r){if(!n)return null;throw r}};Br.exports=Ra});var jr=T(function(mp,Fr){var va=_e(),Ia=(e,t)=>{let n=va(e,t);return n?n.version:null};Fr.exports=Ia});var Vr=T(function(hp,_r){var Aa=_e(),Na=(e,t)=>{let n=Aa(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};_r.exports=Na});var qr=T(function(gp,Dr){var Ur=te(),Oa=(e,t,n,r,s)=>{if(typeof n==="string")s=r,r=n,n=void 0;try{return new Ur(e instanceof Ur?e.version:e,n).inc(t,r,s).version}catch(o){return null}};Dr.exports=Oa});var Hr=T(function(bp,Wr){var Gr=_e(),Ca=(e,t)=>{let n=Gr(e,null,!0),r=Gr(t,null,!0),s=n.compare(r);if(s===0)return null;let o=s>0,i=o?n:r,a=o?r:n,f=!!i.prerelease.length;if(!!a.prerelease.length&&!f){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let l=f?"pre":"";if(n.major!==r.major)return l+"major";if(n.minor!==r.minor)return l+"minor";if(n.patch!==r.patch)return l+"patch";return"prerelease"};Wr.exports=Ca});var Jr=T(function(yp,Xr){var Ta=te(),La=(e,t)=>new Ta(e,t).major;Xr.exports=La});var zr=T(function(wp,Kr){var Pa=te(),Ma=(e,t)=>new Pa(e,t).minor;Kr.exports=Ma});var Qr=T(function(xp,Yr){var Ba=te(),Fa=(e,t)=>new Ba(e,t).patch;Yr.exports=Fa});var es=T(function(Ep,Zr){var ja=_e(),_a=(e,t)=>{let n=ja(e,t);return n&&n.prerelease.length?n.prerelease:null};Zr.exports=_a});var xe=T(function($p,ns){var ts=te(),Va=(e,t,n)=>new ts(e,n).compare(new ts(t,n));ns.exports=Va});var ss=T(function(kp,rs){var Ua=xe(),Da=(e,t,n)=>Ua(t,e,n);rs.exports=Da});var is=T(function(Sp,os){var qa=xe(),Ga=(e,t)=>qa(e,t,!0);os.exports=Ga});var Mt=T(function(Rp,cs){var as=te(),Wa=(e,t,n)=>{let r=new as(e,n),s=new as(t,n);return r.compare(s)||r.compareBuild(s)};cs.exports=Wa});var us=T(function(vp,ls){var Ha=Mt(),Xa=(e,t)=>e.sort((n,r)=>Ha(n,r,t));ls.exports=Xa});var ps=T(function(Ip,ds){var Ja=Mt(),Ka=(e,t)=>e.sort((n,r)=>Ja(r,n,t));ds.exports=Ka});var gt=T(function(Ap,fs){var za=xe(),Ya=(e,t,n)=>za(e,t,n)>0;fs.exports=Ya});var Bt=T(function(Np,ms){var Qa=xe(),Za=(e,t,n)=>Qa(e,t,n)<0;ms.exports=Za});var gn=T(function(Op,hs){var ec=xe(),tc=(e,t,n)=>ec(e,t,n)===0;hs.exports=tc});var bn=T(function(Cp,gs){var nc=xe(),rc=(e,t,n)=>nc(e,t,n)!==0;gs.exports=rc});var Ft=T(function(Tp,bs){var sc=xe(),oc=(e,t,n)=>sc(e,t,n)>=0;bs.exports=oc});var jt=T(function(Lp,ys){var ic=xe(),ac=(e,t,n)=>ic(e,t,n)<=0;ys.exports=ac});var yn=T(function(Pp,ws){var cc=gn(),lc=bn(),uc=gt(),dc=Ft(),pc=Bt(),fc=jt(),mc=(e,t,n,r)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return cc(e,n,r);case"!=":return lc(e,n,r);case">":return uc(e,n,r);case">=":return dc(e,n,r);case"<":return pc(e,n,r);case"<=":return fc(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}};ws.exports=mc});var Es=T(function(Mp,xs){var hc=te(),gc=_e(),{safeRe:_t,t:Vt}=ot(),bc=(e,t)=>{if(e instanceof hc)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?_t[Vt.COERCEFULL]:_t[Vt.COERCE]);else{let f=t.includePrerelease?_t[Vt.COERCERTLFULL]:_t[Vt.COERCERTL],d;while((d=f.exec(e))&&(!n||n.index+n[0].length!==e.length)){if(!n||d.index+d[0].length!==n.index+n[0].length)n=d;f.lastIndex=d.index+d[1].length+d[2].length}f.lastIndex=-1}if(n===null)return null;let r=n[2],s=n[3]||"0",o=n[4]||"0",i=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return gc(`${r}.${s}.${o}${i}${a}`,t)};xs.exports=bc});var ks=T(function(Bp,$s){var yc=_e(),wc=st(),xc=te(),Ec=(e,t,n)=>{if(!wc.RELEASE_TYPES.includes(t))return null;let r=$c(e,n);return r&&kc(r,t)},$c=(e,t)=>{let n=e instanceof xc?e.version:e;return yc(n,t)},kc=(e,t)=>{if(Sc(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Sc=(e)=>e.startsWith("pre");$s.exports=Ec});var vs=T(function(Fp,Rs){class Ss{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,t)}return this}}Rs.exports=Ss});var Ee=T(function(jp,Os){var Rc=/\s+/g;class bt{constructor(e,t){if(t=Ic(t),e instanceof bt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new bt(e.raw,t);if(e instanceof wn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Rc," "),this.set=this.raw.split("||").map((n)=>this.parseRange(n.trim())).filter((n)=>n.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter((r)=>!As(r[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Bc(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let n=0;n<t.length;n++){if(n>0)this.formatted+=" ";this.formatted+=t[n].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Mc,"");let n=((this.options.includePrerelease&&Lc)|(this.options.loose&&Pc))+":"+e,r=Is.get(n);if(r)return r;let s=this.options.loose,o=s?le[ne.HYPHENRANGELOOSE]:le[ne.HYPHENRANGE];e=e.replace(o,Xc(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(le[ne.COMPARATORTRIM],Oc),W("comparator trim",e),e=e.replace(le[ne.TILDETRIM],Cc),W("tilde trim",e),e=e.replace(le[ne.CARETTRIM],Tc),W("caret trim",e);let i=e.split(" ").map((l)=>Fc(l,this.options)).join(" ").split(/\s+/).map((l)=>Hc(l,this.options));if(s)i=i.filter((l)=>(W("loose invalid filter",l,this.options),!!l.match(le[ne.COMPARATORLOOSE])));W("range list",i);let a=new Map,f=i.map((l)=>new wn(l,this.options));for(let l of f){if(As(l))return[l];a.set(l.value,l)}if(a.size>1&&a.has(""))a.delete("");let d=[...a.values()];return Is.set(n,d),d}intersects(e,t){if(!(e instanceof bt))throw TypeError("a Range is required");return this.set.some((n)=>Ns(n,t)&&e.set.some((r)=>Ns(r,t)&&n.every((s)=>r.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Ac(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Jc(this.set[t],e,this.options))return!0;return!1}}Os.exports=bt;var vc=vs(),Is=new vc,Ic=Ot(),wn=yt(),W=ht(),Ac=te(),{safeRe:le,src:Nc,t:ne,comparatorTrimReplace:Oc,tildeTrimReplace:Cc,caretTrimReplace:Tc}=ot(),{FLAG_INCLUDE_PRERELEASE:Lc,FLAG_LOOSE:Pc}=st(),Mc=new RegExp(Nc[ne.BUILD],"g"),As=(e)=>e.value==="<0.0.0-0",Bc=(e)=>e.value==="",Ns=(e,t)=>{let n=!0,r=e.slice(),s=r.pop();while(n&&r.length)n=r.every((o)=>s.intersects(o,t)),s=r.pop();return n},Fc=(e,t)=>(e=e.replace(le[ne.BUILD],""),W("comp",e,t),e=Uc(e,t),W("caret",e),e=_c(e,t),W("tildes",e),e=qc(e,t),W("xrange",e),e=Wc(e,t),W("stars",e),e),Q=(e)=>!e||e.toLowerCase()==="x"||e==="*",jc=(e,t,n)=>Q(e)&&!Q(t)||Q(t)&&n&&!Q(n),_c=(e,t)=>e.trim().split(/\s+/).map((n)=>Vc(n,t)).join(" "),Vc=(e,t)=>{let n=t.loose?le[ne.TILDELOOSE]:le[ne.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{W("tilde",e,s,o,i,a,f);let d;if(Q(o))d="";else if(Q(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Q(a))d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else if(f)W("replaceTilde pr",f),d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;return W("tilde return",d),d})},Uc=(e,t)=>e.trim().split(/\s+/).map((n)=>Dc(n,t)).join(" "),Dc=(e,t)=>{W("caret",e,t);let n=t.loose?le[ne.CARETLOOSE]:le[ne.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(s,o,i,a,f)=>{W("caret",e,s,o,i,a,f);let d;if(Q(o))d="";else if(Q(i))d=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(Q(a))if(o==="0")d=`>=${o}.${i}.0${r} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.0${r} <${+o+1}.0.0-0`;else if(f)if(W("replaceCaret pr",f),o==="0")if(i==="0")d=`>=${o}.${i}.${a}-${f} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a}-${f} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a}-${f} <${+o+1}.0.0-0`;else if(W("no pr"),o==="0")if(i==="0")d=`>=${o}.${i}.${a} <${o}.${i}.${+a+1}-0`;else d=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`;else d=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return W("caret return",d),d})},qc=(e,t)=>(W("replaceXRanges",e,t),e.split(/\s+/).map((n)=>Gc(n,t)).join(" ")),Gc=(e,t)=>{e=e.trim();let n=t.loose?le[ne.XRANGELOOSE]:le[ne.XRANGE];return e.replace(n,(r,s,o,i,a,f)=>{if(W("xRange",e,r,s,o,i,a,f),jc(o,i,a))return e;let d=Q(o),l=d||Q(i),p=l||Q(a),c=p;if(s==="="&&c)s="";if(f=t.includePrerelease?"-0":"",d)if(s===">"||s==="<")r="<0.0.0-0";else r="*";else if(s&&c){if(l)i=0;if(a=0,s===">")if(s=">=",l)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",l)o=+o+1;else i=+i+1;if(s==="<")f="-0";r=`${s+o}.${i}.${a}${f}`}else if(l)r=`>=${o}.0.0${f} <${+o+1}.0.0-0`;else if(p)r=`>=${o}.${i}.0${f} <${o}.${+i+1}.0-0`;return W("xRange return",r),r})},Wc=(e,t)=>(W("replaceStars",e,t),e.trim().replace(le[ne.STAR],"")),Hc=(e,t)=>(W("replaceGTE0",e,t),e.trim().replace(le[t.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),Xc=(e)=>(t,n,r,s,o,i,a,f,d,l,p,c)=>{if(Q(r))n="";else if(Q(s))n=`>=${r}.0.0${e?"-0":""}`;else if(Q(o))n=`>=${r}.${s}.0${e?"-0":""}`;else if(i)n=`>=${n}`;else n=`>=${n}${e?"-0":""}`;if(Q(d))f="";else if(Q(l))f=`<${+d+1}.0.0-0`;else if(Q(p))f=`<${d}.${+l+1}.0-0`;else if(c)f=`<=${d}.${l}.${p}-${c}`;else if(e)f=`<${d}.${l}.${+p+1}-0`;else f=`<=${f}`;return`${n} ${f}`.trim()},Jc=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++){if(W(e[r].semver),e[r].semver===wn.ANY)continue;if(e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var yt=T(function(_p,Bs){var wt=Symbol("SemVer ANY");class Ut{static get ANY(){return wt}constructor(e,t){if(t=Cs(t),e instanceof Ut)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),En("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===wt)this.value="";else this.value=this.operator+this.semver.version;En("comp",this)}parse(e){let t=this.options.loose?Ts[Ls.COMPARATORLOOSE]:Ts[Ls.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=n[1]!==void 0?n[1]:"",this.operator==="=")this.operator="";if(!n[2])this.semver=wt;else this.semver=new Ps(n[2],this.options.loose)}toString(){return this.value}test(e){if(En("Comparator.test",e,this.options.loose),this.semver===wt||e===wt)return!0;if(typeof e==="string")try{e=new Ps(e,this.options)}catch(t){return!1}return xn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ut))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ms(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ms(this.value,t).test(e.semver)}if(t=Cs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(xn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(xn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Bs.exports=Ut;var Cs=Ot(),{safeRe:Ts,t:Ls}=ot(),xn=yn(),En=ht(),Ps=te(),Ms=Ee()});var xt=T(function(Vp,Fs){var Kc=Ee(),zc=(e,t,n)=>{try{t=new Kc(t,n)}catch(r){return!1}return t.test(e)};Fs.exports=zc});var _s=T(function(Up,js){var Yc=Ee(),Qc=(e,t)=>new Yc(e,t).set.map((n)=>n.map((r)=>r.value).join(" ").trim().split(" "));js.exports=Qc});var Us=T(function(Dp,Vs){var Zc=te(),el=Ee(),tl=(e,t,n)=>{let r=null,s=null,o=null;try{o=new el(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===-1)r=i,s=new Zc(r,n)}}),r};Vs.exports=tl});var qs=T(function(qp,Ds){var nl=te(),rl=Ee(),sl=(e,t,n)=>{let r=null,s=null,o=null;try{o=new rl(t,n)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!r||s.compare(i)===1)r=i,s=new nl(r,n)}}),r};Ds.exports=sl});var Hs=T(function(Gp,Ws){var $n=te(),ol=Ee(),Gs=gt(),il=(e,t)=>{e=new ol(e,t);let n=new $n("0.0.0");if(e.test(n))return n;if(n=new $n("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r<e.set.length;++r){let s=e.set[r],o=null;if(s.forEach((i)=>{let a=new $n(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Gs(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!n||Gs(n,o)))n=o}if(n&&e.test(n))return n;return null};Ws.exports=il});var Js=T(function(Wp,Xs){var al=Ee(),cl=(e,t)=>{try{return new al(e,t).range||"*"}catch(n){return null}};Xs.exports=cl});var Dt=T(function(Hp,Qs){var ll=te(),Ys=yt(),{ANY:ul}=Ys,dl=Ee(),pl=xt(),Ks=gt(),zs=Bt(),fl=jt(),ml=Ft(),hl=(e,t,n,r)=>{e=new ll(e,r),t=new dl(t,r);let s,o,i,a,f;switch(n){case">":s=Ks,o=fl,i=zs,a=">",f=">=";break;case"<":s=zs,o=ml,i=Ks,a="<",f="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(pl(e,t,r))return!1;for(let d=0;d<t.set.length;++d){let l=t.set[d],p=null,c=null;if(l.forEach((u)=>{if(u.semver===ul)u=new Ys(">=0.0.0");if(p=p||u,c=c||u,s(u.semver,p.semver,r))p=u;else if(i(u.semver,c.semver,r))c=u}),p.operator===a||p.operator===f)return!1;if((!c.operator||c.operator===a)&&o(e,c.semver))return!1;else if(c.operator===f&&i(e,c.semver))return!1}return!0};Qs.exports=hl});var eo=T(function(Xp,Zs){var gl=Dt(),bl=(e,t,n)=>gl(e,t,">",n);Zs.exports=bl});var no=T(function(Jp,to){var yl=Dt(),wl=(e,t,n)=>yl(e,t,"<",n);to.exports=wl});var oo=T(function(Kp,so){var ro=Ee(),xl=(e,t,n)=>(e=new ro(e,n),t=new ro(t,n),e.intersects(t,n));so.exports=xl});var ao=T(function(zp,io){var El=xt(),$l=xe();io.exports=(e,t,n)=>{let r=[],s=null,o=null,i=e.sort((l,p)=>$l(l,p,n));for(let l of i)if(El(l,t,n)){if(o=l,!s)s=l}else{if(o)r.push([s,o]);o=null,s=null}if(s)r.push([s,null]);let a=[];for(let[l,p]of r)if(l===p)a.push(l);else if(!p&&l===i[0])a.push("*");else if(!p)a.push(`>=${l}`);else if(l===i[0])a.push(`<=${p}`);else a.push(`${l} - ${p}`);let f=a.join(" || "),d=typeof t.raw==="string"?t.raw:String(t);return f.length<d.length?f:t}});var mo=T(function(Yp,fo){var co=Ee(),Rn=yt(),{ANY:kn}=Rn,Sn=xt(),vn=xe(),kl=(e,t,n={})=>{if(e===t)return!0;e=new co(e,n),t=new co(t,n);let r=!1;e:for(let s of e.set){for(let o of t.set){let i=Rl(s,o,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Sl=[new Rn(">=0.0.0-0")],lo=[new Rn(">=0.0.0")],Rl=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===kn)if(t.length===1&&t[0].semver===kn)return!0;else if(n.includePrerelease)e=Sl;else e=lo;if(t.length===1&&t[0].semver===kn)if(n.includePrerelease)return!0;else t=lo;let r=new Set,s,o;for(let u of e)if(u.operator===">"||u.operator===">=")s=uo(s,u,n);else if(u.operator==="<"||u.operator==="<=")o=po(o,u,n);else r.add(u.semver);if(r.size>1)return null;let i;if(s&&o){if(i=vn(s.semver,o.semver,n),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let u of r){if(s&&!Sn(u,String(s),n))return null;if(o&&!Sn(u,String(o),n))return null;for(let g of t)if(!Sn(u,String(g),n))return!1;return!0}let a,f,d,l,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,c=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(l=l||u.operator===">"||u.operator===">=",d=d||u.operator==="<"||u.operator==="<=",s){if(c){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===c.major&&u.semver.minor===c.minor&&u.semver.patch===c.patch)c=!1}if(u.operator===">"||u.operator===">="){if(a=uo(s,u,n),a===u&&a!==s)return!1}else if(s.operator===">="&&!u.test(s.semver))return!1}if(o){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator==="<"||u.operator==="<="){if(f=po(o,u,n),f===u&&f!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||s)&&i!==0)return!1}if(s&&d&&!o&&i!==0)return!1;if(o&&l&&!s&&i!==0)return!1;if(c||p)return!1;return!0},uo=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e},po=(e,t,n)=>{if(!e)return t;let r=vn(e.semver,t.semver,n);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};fo.exports=kl});var yo=T(function(Qp,bo){var In=ot(),ho=st(),vl=te(),go=mn(),Il=_e(),Al=jr(),Nl=Vr(),Ol=qr(),Cl=Hr(),Tl=Jr(),Ll=zr(),Pl=Qr(),Ml=es(),Bl=xe(),Fl=ss(),jl=is(),_l=Mt(),Vl=us(),Ul=ps(),Dl=gt(),ql=Bt(),Gl=gn(),Wl=bn(),Hl=Ft(),Xl=jt(),Jl=yn(),Kl=Es(),zl=ks(),Yl=yt(),Ql=Ee(),Zl=xt(),eu=_s(),tu=Us(),nu=qs(),ru=Hs(),su=Js(),ou=Dt(),iu=eo(),au=no(),cu=oo(),lu=ao(),uu=mo();bo.exports={parse:Il,valid:Al,clean:Nl,inc:Ol,diff:Cl,major:Tl,minor:Ll,patch:Pl,prerelease:Ml,compare:Bl,rcompare:Fl,compareLoose:jl,compareBuild:_l,sort:Vl,rsort:Ul,gt:Dl,lt:ql,eq:Gl,neq:Wl,gte:Hl,lte:Xl,cmp:Jl,coerce:Kl,truncate:zl,Comparator:Yl,Range:Ql,satisfies:Zl,toComparators:eu,maxSatisfying:tu,minSatisfying:nu,minVersion:ru,validRange:su,outside:ou,gtr:iu,ltr:au,intersects:cu,simplifyRange:lu,subset:uu,SemVer:vl,re:In.re,src:In.src,tokens:In.t,SEMVER_SPEC_VERSION:ho.SEMVER_SPEC_VERSION,RELEASE_TYPES:ho.RELEASE_TYPES,compareIdentifiers:go.compareIdentifiers,rcompareIdentifiers:go.rcompareIdentifiers}});function ie(e){return e!==null&&typeof e==="object"&&"$handler"in e}function x(e){if(typeof e==="string"||typeof e==="number")return String(e);if(e&&typeof e==="object"&&"value"in e)return x(e.value);return""}function ke(e,t){return e.children.find((n)=>n.type==="Slot"&&n.props.name===t)}function J(e){return e?x(e.props.id??e.id):null}function Fe(e,t,n=[]){return e&&ie(t)?{node:e.id,handler:t.$handler,args:n}:void 0}function Z(e,t,n=[]){return Fe(e,e?.props[t],n)}function Zt(e){let t=e?.props.pagination;if(!t||typeof t!=="object"||Array.isArray(t))return;if(!("pageSize"in t)||!("hasMore"in t)||!("onLoadMore"in t))return;return t}function qe(e){return{...e?.tint?{iconTint:e.tint}:{},...e?.source?{iconSource:e.source}:{},...e?.mask?{iconMask:e.mask}:{}}}var zn={add:"+",addperson:"+",airplane:"✈",alarm:"⏰",alarmringing:"⏰",aligncentre:"≡",alignleft:"≡",alignright:"≡",anchor:"⚓",appwindow:"▭",appwindowgrid2x2:"▦",appwindowgrid3x3:"▦",appwindowlist:"☰",appwindowsidebarleft:"▯",appwindowsidebarright:"▯",arrowclockwise:"↻",arrowcounterclockwise:"↺",arrowdown:"↓",arrowdowncircle:"↓",arrowleft:"←",arrowleftcircle:"←",arrowne:"↗",arrowright:"→",arrowrightcircle:"→",arrowup:"↑",arrowupcircle:"↑",arrowscontract:"⤡",arrowsexpand:"⤢",atsymbol:"@",barchart:"▥",barcode:"▮",battery:"▭",batterycharging:"▭",batterydisabled:"▭",bell:"♢",belldisabled:"♢",bicycle:"⚲",bike:"⚲",binoculars:"◎",bird:"▷",blankdocument:"▤",bluetooth:"ᛒ",bold:"B",bolt:"ϟ",boltdisabled:"ϟ",book:"▤",bookmark:"▮",box:"▢",brush:"✎",bug:"☗",building:"▥",bulletpoints:"•",bullseye:"◎",calculator:"▦",calendar:"▦",camera:"◉",car:"▰",cart:"▰",cd:"◎",check:"✓",checkcircle:"✓",checklist:"✓",checkmark:"✓",chevrondown:"⌄",chevronleft:"‹",chevronright:"›",chevronup:"⌃",chevronupdown:"⇕",circle:"●",circledisabled:"○",circleellipsis:"◌",circlefilled:"●",circleprogress:"◌",clipboard:"▧",clock:"◷",cloud:"☁",cloudlightning:"☁",cloudrain:"☁",cloudsnow:"☁",cloudsun:"☁",code:"</>",codeblock:"</>",contrast:"◒",cog:"⚙",coin:"◉",coins:"◉",commandsymbol:"⌘",compass:"⊕",computerchip:"▣",copyclipboard:"⧉",creditcard:"▭",crop:"⌗",crown:"♛",crypto:"◈",deletedocument:"⌫",desktop:"▭",devices:"▭",dna:"⋈",document:"▤",dot:"·",download:"↓",droplets:"◌",duplicate:"⧉",eject:"⏏",ellipsis:"…",ellipsisvertical:"⋮",emoji:"☺",emojisad:"☹",envelope:"✉",eraser:"▱",exclamationmark:"!",exclamationmark2:"!",exclamationmark3:"!",eye:"◉",eyedisabled:"◌",eyedropper:"⌖",female:"♀",filmstrip:"▤",filter:"▽",finder:"⌕",fingerprint:"◎",flag:"⚑",folder:"▰",footprints:"∴",forward:"↷",gamecontroller:"▭",gauge:"◔",gear:"⚙",geopin:"⌖",gift:"▧",glasses:"∞",globe:"⊕",goal:"◎",hammer:"⚒",harddrive:"▭",hashtag:"#",heading:"H",headphones:"◠",heart:"♥",heartbeat:"♥",highlight:"▰",hourglass:"⌛",house:"⌂",humidity:"≈",image:"▣",important:"!",info:"ⓘ",italics:"I",key:"⚿",keyboard:"▦",layers:"▤",leaderboard:"▥",leaf:"❧",lightbulb:"☀",lightbulboff:"☼",linechart:"↗",link:"↗",list:"☰",livestream:"◉",lock:"⚿",lockdisabled:"⚿",lockunlocked:"⚿",logout:"⇥",lorry:"▰",lowercase:"a",magnifyingglass:"⌕",male:"♂",map:"⌗",mask:"◒",maximize:"⤢",medicalsupport:"+",megaphone:"◁",memorychip:"▣",memorystick:"▭",message:"▤",microphone:"◉",microphonedisabled:"◌",minimize:"⤡",minus:"−",minuscircle:"−",mobile:"▯",monitor:"▭",moon:"☾",moondown:"☾",moonrise:"☾",moonup:"☽",mountain:"▲",mouse:"▭",move:"✥",mug:"▯",multiply:"×",music:"♪",network:"⌗",newdocument:"+",newfolder:"+",number:"#",numberlist:"#",paperclip:"⌇",paragraph:"¶",patch:"✚",pause:"Ⅱ",pencil:"✎",person:"●",personcircle:"●",personlines:"●",phone:"☏",phoneringing:"☏",piechart:"◔",pill:"◍",pin:"⌖",pindisabled:"⌖",play:"▶",plug:"⚡",plus:"+",pluscircle:"+",plusminusedividemultiply:"±",plussquare:"+",plustoprightsquare:"+",power:"⏻",print:"⎙",questionmarkcircle:"?",quicklink:"↗",quotationmarks:"“",quoteblock:"▮",receipt:"▤",redo:"↷",removeperson:"−",repeat:"↻",replace:"⇄",reply:"↰",rewind:"◀",rocket:"▲",rosette:"✿",rotateanticlockwise:"↺",rotateclockwise:"↻",rss:"◎",ruler:"⌗",savedocument:"▤",shield:"⛨",shortparagraph:"¶",shuffle:"⤨",signal:"▂",snippets:"▤",snowflake:"❄",soccerball:"◉",speaker:"◁",speakerdown:"◁",speakerlow:"◁",speakerhigh:"◁",speakeroff:"◁",speakeron:"◁",speakerup:"◁",speechbubble:"▤",speechbubbleactive:"▣",speechbubbleimportant:"!",stackedbars:"▤",star:"★",starcircle:"★",stardisabled:"☆",stars:"✦",stop:"■",stopwatch:"◷",store:"⌂",strikethrough:"S",sun:"☀",sunrise:"☀",swatch:"◧",switch:"⇄",syringe:"⌇",tack:"⌖",tag:"⌑",temperature:"°",terminal:"▮",text:"T",textcursor:"▏",textinput:"▭",textselection:"▮",thumbsdown:"▽",thumbsup:"△",ticket:"▤",torch:"◉",trash:"⌫",tray:"▤",tree:"♣",trophy:"♛",twopeople:"●",umbrella:"☂",underline:"U",undo:"↶",upload:"↑",uppercase:"A",video:"▶",videodisabled:"▶",wallet:"▭",wand:"✧",warning:"⚠",waveform:"∿",weights:"▭",wifi:"▂",wifidisabled:"▂",wind:"≈",windsock:"◁",wrenchscrewdriver:"⚒",wristwatch:"◷",xmark:"×",xmarkcircle:"×",xmarktopleftsquare:"⧉",xmarktrightsquare:"⧉",xmarktoprightsquare:"⧉"},ui={"raycast-blue":"blue","raycast-green":"green","raycast-magenta":"magenta","raycast-orange":"orange","raycast-purple":"purple","raycast-red":"red","raycast-yellow":"yellow","raycast-primary-text":"primary-text","raycast-secondary-text":"secondary-text",blue:"blue",green:"green",magenta:"magenta",orange:"orange",purple:"purple",red:"red",yellow:"yellow"};function Qn(e,t){if(typeof e==="string")return ui[e.toLowerCase()]??e;if(e&&typeof e==="object"&&!Array.isArray(e)){let n=e;return Qn(t==="dark"?n.dark??n.light:n.light??n.dark,t)}return}function di(e,t){if(typeof e==="string")return{source:e,...en(e)?{image:!0}:{}};if(!e||typeof e!=="object"||Array.isArray(e))return{};let n=e;if(typeof n.fileIcon==="string")return{fileIcon:n.fileIcon,image:!0};let r=Qn(n.tintColor,t),s=n.mask==="circle"||n.mask==="roundedRectangle"?n.mask:void 0,o=n.source;if(o&&typeof o==="object"&&!Array.isArray(o)){let i=o;o=t==="dark"?i.dark??i.light:i.light??i.dark}return{...typeof o==="string"?{source:o,...en(o)?{image:!0}:{}}:{},...r?{tint:r}:{},...s?{mask:s}:{}}}function en(e){return/^(https?:|data:|file:|\/)/i.test(e)||/\.(png|jpe?g|gif|svg|webp|bmp|heic)$/i.test(e)}function pi(e,t){if(/^(https?:|data:)/i.test(e))return{kind:"url",url:e};if(/^file:/i.test(e))try{return{kind:"file",path:decodeURIComponent(new URL(e).pathname)}}catch{return}if(e.startsWith("/")||/^[a-z]:[\\/]/i.test(e))return{kind:"file",path:e};if(!en(e))return{kind:"builtin",name:e};if(!t||e.split(/[\\/]/).includes(".."))return;return{kind:"file",path:`${t.replace(/[\\/]+$/,"")}/${e.replace(/^\.?[\\/]/,"")}`}}function fi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();return n.join("").toLowerCase()}function Yn(e){return e.replace(/(^|\s)(\S)/g,(t,n,r)=>`${n}${r.toUpperCase()}`)}function mi(e){let n=(e.split(/[\\/]/).at(-1)??e).replace(/\.[a-z0-9]{1,5}$/i,"").split(/[-_\s]+/).filter(Boolean);while(n.length>1&&/^\d{1,2}$/.test(n.at(-1)??""))n.pop();let r=n.join(" ").trim();if(!r)return"◇";let s=Yn(r);return s.length<=12?s:`${Yn(r.slice(0,9))}…`}function ye(e,t={}){let{source:n,fileIcon:r,tint:s,mask:o,image:i}=di(e,t.appearance??"light"),a=r!==void 0?{kind:"fileIcon",path:r}:n===void 0?void 0:pi(n,t.assetsDir),f={...s?{tint:s}:{},...a?{source:a}:{},...o?{mask:o}:{}};if(!n)return{label:r===void 0?"◇":"▣",...f};let d=fi(n);return{label:zn[d]??zn[d.replace(/(?:filled|disabled|small|large)$/,"")]??void 0??(i?"▣":mi(n)),...f}}var hi=4,gi=3,bi=2,yi=1,wi=3,xi=2,Ei=1;function $i(e,t){let n=e.toLowerCase();if(n===t)return hi;if(n.startsWith(t))return gi;let r=n.indexOf(t);if(r<0)return 0;for(let s=r;s>=0;s=n.indexOf(t,s+1))if(s===0||!/[\p{L}\p{N}]/u.test(n[s-1]??""))return bi;return yi}function we(e,t){let n=t.toLowerCase();if(!n)return 1;let r=0,s=(o,i)=>{let a=o?$i(o,n):0;if(a)r=Math.max(r,a*4+i)};s(e.title,wi);for(let o of e.keywords??[])s(o,xi);return s(e.subtitle,Ei),r}function Qe(e){return{title:x(e.props.title),subtitle:x(e.props.subtitle),keywords:Array.isArray(e.props.keywords)?e.props.keywords.map(x):[]}}function Ce(e){let t=e?.props.filtering,n=t===void 0||t===null?!ie(e?.props.onSearchTextChange):t!==!1,r=!!t&&typeof t==="object"&&!Array.isArray(t)&&"keepSectionOrder"in t&&t.keepSectionOrder===!0;return{enabled:n,keepSectionOrder:r}}function Se(e,t,n,r){if(!r.enabled||!t)return e.filter((i)=>i.items.length>0);let s=e.map((i,a)=>{let f=i.items.map((d,l)=>({item:d,index:l,value:n(d)})).filter((d)=>d.value>0).toSorted((d,l)=>l.value-d.value||d.index-l.index);return{group:{...i,items:f.map((d)=>d.item)},order:a,best:f[0]?.value??0}}).filter((i)=>i.group.items.length>0);return(r.keepSectionOrder?s:s.toSorted((i,a)=>a.best-i.best||i.order-a.order)).map((i)=>i.group)}function Ze(e,t,n){let r=[],s;for(let o of e.children)if(n(o))s=void 0,r.push({section:o,items:o.children.filter(t)});else if(t(o)){if(!s)r.push(s={items:[]});s.items.push(o)}return r}function Zn(e,t){let n=e.props.columns;return typeof n==="number"&&n>0?n:t}function er(e){let t=e.props.content,n=t&&typeof t==="object"&&!Array.isArray(t)&&"value"in t?t.value:t;if(typeof n==="string")return n;if(n&&typeof n==="object"&&!Array.isArray(n)&&"color"in n){let r=x(n.color);return r?`■ ${r}`:"■"}return"◇"}function tr(e,t){let n=e.props.content,r=n&&typeof n==="object"&&!Array.isArray(n)&&"value"in n?n.value:n;if(r===void 0||r===null)return;if(typeof r==="object"&&!Array.isArray(r)&&"color"in r)return;return ye(r,t)}function nr(e,t="",n=Ce(e)){let r=[],s=[];if(e?.type!=="Grid")return{rows:r,cells:s};let o=Zn(e,5),i=Se(Ze(e,(a)=>a.type==="Grid.Item",(a)=>a.type==="Grid.Section"),t,(a)=>we(Qe(a),t),n);for(let a of i){let f=a.section?Zn(a.section,o):o;if(a.section)r.push({node:a.section,header:[x(a.section.props.title),x(a.section.props.subtitle)].filter(Boolean).join(" — "),cells:[]});let d;for(let l of a.items){if(!d||d.cells.length>=f)d={node:void 0,header:"",cells:[]},r.push(d);d.cells.push(l),s.push(l)}}return{rows:r,cells:s}}function rr(e,t,n){let r=e.map((p)=>p.cells),s;r.forEach((p,c)=>p.forEach((u,g)=>{if(J(u)===t)s={r:c,c:g}}));let o=(p,c)=>{let u=r[p];if(!u?.length)return;return{r:p,c:Math.min(c,u.length-1)}};if(!s){let p=r.find((c)=>c.length>0)?.[0];return p?J(p):null}let{r:i,c:a}=s,f=r[i]??[],d;if(n==="left")d=a>0?{r:i,c:a-1}:void 0;else if(n==="right")d=a+1<f.length?{r:i,c:a+1}:void 0;else if(n==="up")for(let p=i-1;p>=0&&!d;p--)d=o(p,a);else for(let p=i+1;p<r.length&&!d;p++)d=o(p,a);let l=d?r[d.r]?.[d.c]:f[a];return J(l)}function sr(e){return(e?ke(e,"searchBarAccessory"):void 0)?.children.find((n)=>n.type==="List.Dropdown"||n.type==="Grid.Dropdown")}function tn(e){let t=[];function n(r,s,o){if(r.type.endsWith("Dropdown.Section")){let i=x(r.props.title);r.children.forEach((a)=>n(a,i,r.id))}else if(r.type.endsWith("Dropdown.Item"))t.push({node:r,value:x(r.props.value),title:x(r.props.title),section:s,sectionId:o})}return e?.children.forEach((r)=>n(r,"","")),t}function ki(e,t,n={enabled:!0,keepSectionOrder:!1}){let r=[];for(let s of e){let o=r[r.length-1];if(o?.section===s.sectionId)o.items.push(s);else r.push({section:s.sectionId,items:[s]})}return Se(r,t,(s)=>we({title:s.title,subtitle:s.value,keywords:Array.isArray(s.node.props.keywords)?s.node.props.keywords.map(x):[]},t),n).flatMap((s)=>s.items)}function or(e,t){return ki(tn(e),t,Ce(e))}function ir(e,t){let n=x(e?.props.value??e?.props.defaultValue);return t.find((r)=>r.value===n)?.title||n}var Si=["cmd","ctrl","opt","shift","alt","windows"],Ri={return:"return",enter:"return",escape:"escape",space:"space",backspace:"backspace",delete:"backspace",deleteForward:"delete",tab:"tab",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right",pageUp:"pageup",pageDown:"pagedown",home:"home",end:"end"},vi={enter:"return",esc:"escape"};function et(e){return e&&typeof e==="object"&&"key"in e&&"modifiers"in e?e:void 0}function Ii(e,t){if(et(e))return et(e);if(!e||typeof e!=="object")return;if(t==="macOS")return"macOS"in e?et(e.macOS):void 0;if("Windows"in e&&et(e.Windows))return et(e.Windows);return"windows"in e?et(e.windows):void 0}function Ai(e,t){if(e==="shift")return"shift";if(e==="windows")return"super";if(e==="opt"||e==="alt")return"option";if(e==="cmd")return t==="macOS"?"meta":"ctrl";return"ctrl"}function ar(e,t){let n=Ii(e,t);if(!n)return;let{key:r,modifiers:s}=n;if(typeof r!=="string"||!Array.isArray(s))return;if(!s.every((i)=>typeof i==="string"&&Si.includes(i)))return;let o=Ri[r]??(r.length===1?r.toLowerCase():void 0);if(!o)return;return{key:o,modifiers:new Set(s.map((i)=>Ai(i,t)))}}function Ge(e,t,n="Linux"){let r=ar(e,n);if(!r)return!1;let s=t.name.toLowerCase(),o={ctrl:!!t.ctrl,option:!!t.option,shift:!!t.shift,meta:!!t.meta,super:!!t.super};return(vi[s]??s)===r.key&&Object.keys(o).every((i)=>o[i]===r.modifiers.has(i))}var Ni={ctrl:"⌃",option:"⌥",shift:"⇧",meta:"⌘",super:"❖"},Oi={ctrl:"Ctrl",option:"Alt",shift:"Shift",meta:"Cmd",super:"Win"},Ci=["ctrl","option","shift","meta","super"],Ti={return:"↵",escape:"⎋",space:"␣",backspace:"⌫",delete:"⌦",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},Li={return:"Enter",escape:"Esc",space:"Space",backspace:"Backspace",delete:"Delete",tab:"Tab",up:"Up",down:"Down",left:"Left",right:"Right",pageup:"PageUp",pagedown:"PageDown",home:"Home",end:"End"};function Te(e,t="Linux"){let n=ar(e,t);if(!n)return"";let r=t==="macOS",s=Ci.filter((o)=>n.modifiers.has(o));if(r)return[...s.map((o)=>Ni[o]),Ti[n.key]??n.key.toUpperCase()].join("");return[...s.map((o)=>Oi[o]),Li[n.key]??n.key.toUpperCase()].join("+")}function rn(e,t){if(e.props.shortcut!==void 0)return e.props.shortcut;if(e.type==="Action.CopyToClipboard")return{modifiers:["cmd"],key:"c"};if(t===1)return{modifiers:["cmd"],key:"return"};return}function vt(e){if(!e)return;if(e.type==="Action"||e.type.startsWith("Action."))return e;if(e.type==="ActionPanel.Submenu")return;for(let t of e.children){let n=vt(t);if(n)return n}}function We(e){if(e?.type==="Navigation")return We(e.children.find((t)=>t.type==="Navigation.Entry"&&t.props.active));if(e?.type==="Navigation.Entry")return We(e.children[0]);return e??void 0}function Pi(e,t){let n=e.props.accessories;return(Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?ye(s.icon,t).label:""].filter(Boolean).join(" ")}):[]).filter(Boolean).join(" ")}function Mi(e,t){let n=e.props.accessories,r=Array.isArray(n)?n.map((s)=>{if(!s||typeof s!=="object"||Array.isArray(s))return"";return[x(s.text),x(s.tag),s.icon?ye(s.icon,t).label:""].filter(Boolean).join(" ")}):[];return[e.props.icon?ye(e.props.icon,t).label:"",x(e.props.title),x(e.props.subtitle),...r].filter(Boolean).join(" ")}function Bi(e,t){return{node:e,text:Mi(e,t),item:!0,title:x(e.props.title),subtitle:x(e.props.subtitle),accessories:Pi(e,t),icon:Boolean(e.props.icon),...e.props.icon?{iconView:ye(e.props.icon,t)}:{}}}function Fi(e){let t=[x(e.props.title),x(e.props.subtitle)].filter(Boolean).join(" — ");return{node:e,text:t,title:t,item:!1}}function cr(e){return{node:e,title:e.type,text:`[Unsupported: ${e.type}]`,item:!1,unsupported:!0}}function dr(e,t){let n=We(e?.root),r=[],s=t.searchText,o=t.icons??{},i=Ce(n),a=n?.type==="Grid"?nr(n,s,i):void 0;if(n?.type==="List"){let c=Se(Ze(n,(u)=>u.type==="List.Item",(u)=>u.type==="List.Section"),s,(u)=>we(Qe(u),s),i);for(let u of c){let g=u.section?Fi(u.section):void 0;if(g)r.push(g);for(let y of u.items)r.push(Bi(y,o));if(g)g.count=u.items.length}for(let u of n.children)if(!["List.Item","List.Section","List.EmptyView","Slot"].includes(u.type))r.push(cr(u))}else if(!a&&n&&n.type!=="Detail")r.push(cr(n));let f=a?a.cells:r.filter((c)=>c.item).map((c)=>c.node),d=n?.props.selectedItemId??t.selectedId,l=f.find((c)=>(c.props.id??c.id)===d)??f[0],p=n?.children.find((c)=>c.type==="List.EmptyView"||c.type==="Grid.EmptyView");return{list:n,grid:a,accessory:sr(n),navigation:e?.root?.type==="Navigation"?e.root:void 0,actions:(l?ke(l,"actions"):void 0)??(!l&&p?ke(p,"actions"):void 0)??(n?ke(n,"actions"):void 0),detail:n?.type==="Detail"?ur(n):n?.props.isShowingDetail?ur(l?ke(l,"detail"):void 0):"",rows:r,items:f,empty:p,selected:l,title:x(n?.props.navigationTitle)||(n?.type==="MenuBarExtra"?[x(n.props.title),x(n.props.tooltip)].filter(Boolean).join(" — "):"")||t.fallbackTitle||"Blast",loading:n?.props.isLoading===!0||!e,emptyText:p?[p.props.icon?ye(p.props.icon,o).label:"",x(p.props.title),x(p.props.description)].filter(Boolean).join(" "):"No results",primary:vt(l?ke(l,"actions"):void 0)??vt(!l&&p?ke(p,"actions"):void 0)??vt(n?ke(n,"actions"):void 0)}}function lr(e,t,n){let r=e.type==="ActionPanel.Submenu",s=x(e.props.title),o=Te(rn(e,n),t);return{node:e,item:!0,title:s,shortcut:o,isSubmenu:r,text:`${s}${r?" ›":""} ${o}`.trim()}}function pr(e){return e.type==="ActionPanel.Submenu"||e.type==="Action"||e.type.startsWith("Action.")}function nn(e,t,n){for(let r of e.children)if(pr(r)){if(!n.current)t.push(n.current={items:[]});n.current.items.push(r)}else if(r.type==="ActionPanel.Section"){n.current=void 0;let s=[],o=[];nn(r,o,{});for(let i of o)s.push(...i.items);t.push({section:r,items:s})}else nn(r,t,n)}function It(e,t="",n="Linux",r={enabled:!0,keepSectionOrder:!1}){if(!e)return[];if(pr(e)){let i=lr(e,n,0);return we({title:x(e.props.title)},t)>0?[i]:[]}let s=[];nn(e,s,{});let o=0;return Se(s,t,(i)=>we({title:x(i.props.title)},t),r).flatMap((i)=>{let a=i.items.map((f)=>lr(f,n,o++));return i.section?[{node:i.section,item:!1,title:x(i.section.props.title),text:x(i.section.props.title)},...a]:a})}function At(e,t="",n="Linux"){return e?.type==="ActionPanel.Submenu"?It({...e,type:"ActionPanel"},t,n,Ce(e)):It(e,t,n)}function ur(e){if(!e)return"";let t=[x(e.props.markdown)];function n(r){if(r.type==="Slot"&&r.props.name==="actions")return;if(typeof r.props.markdown==="string")t.push(r.props.markdown);let s=[x(r.props.text),x(r.props.value),x(r.props.target)].filter(Boolean).join(" "),o=x(r.props.title??r.props.label);if(o||s)t.push([o,s].filter(Boolean).join(": "));r.children.forEach(n)}return e.children.forEach(n),t.filter(Boolean).join(`
|
|
2
|
+
`)}var hr=new Set(["TextField","TextArea","PasswordField","Checkbox","Dropdown","TagPicker","DatePicker","FilePicker"].map((e)=>`Form.${e}`));function ji(e){return e.children.filter((t)=>hr.has(t.type))}function _i(e,t,n){if(!e.length)return;let r=e.findIndex((s)=>s.id===t);return e[(Math.max(0,r)+n+e.length)%e.length]}function fr(e){function t(n){return n.type===`${e.type}.Item`?[n]:n.children.flatMap(t)}return e.children.flatMap(t)}function Vi(e,t=""){return Se(Ze(e,(n)=>n.type==="Form.Dropdown.Item",(n)=>n.type==="Form.Dropdown.Section"),t,(n)=>we({...Qe(n),subtitle:String(n.props.value??"")},t),Ce(e)).flatMap((n)=>n.items)}function Ui(e){if(!e)return null;if(!/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?)?$/.test(e))return;let t=new Date(e),n=new Date(`${e.slice(0,10)}T00:00:00Z`);if(!Number.isFinite(t.getTime())||n.toISOString().slice(0,10)!==e.slice(0,10))return;return t.toISOString()}var tt=(e)=>Object.hasOwn(e.props,"value")?e.props.value:e.props.defaultValue??null,He=(e,t,n,r=[])=>{let s=Z(t,n,r);if(s)e.push(s)},mr=(e)=>({value:x(e.props.value),title:x(e.props.title)});function gr(){let e,t=[],n=null,r,s=[],o=0,i=!0,a=new Map,f=new Map,d=(c)=>c.type==="Form.Dropdown"?Vi(c,f.get(c.id)??""):fr(c);function l(c,u,g=!0){if((c??null)===n)return;if(g&&i)He(u,t.find((y)=>y.id===n),"onBlur");if(n=c??null,o=0,c&&g&&i)s.push(c),He(u,t.find((y)=>y.id===c),"onFocus")}function p(c,u){if(c===i)return;i=c;let g=t.find((y)=>y.id===n);if(g&&c)s.push(g.id);He(u,g,c?"onFocus":"onBlur")}return{active:p,scene(c,u,g=!0){if(c?.id!==e?.id)n=null,r=void 0,s=[],o=0,a.clear(),f.clear();let y=t;e=c,t=c?ji(c):[],p(g,u);for(let[m,R]of a){let A=t.find((F)=>F.id===m),_=y.find((F)=>F.id===m);if(!A||A.type==="Form.TextField"&&A!==_||JSON.stringify(tt(A))!==JSON.stringify(tt(_??A))&&JSON.stringify(tt(A))!==JSON.stringify(R.value))a.delete(m)}let S=t.find((m)=>m.props.focused)?.id;if(S&&S!==r){let m=s.indexOf(S);if(m>=0)s.splice(0,m+1);else l(S,u,!1)}if(r=S,!t.some((m)=>m.id===n))l(t[0]?.id,u)},input(c,u){let g=t.find((y)=>y.id===("id"in c?c.id:n));if(c.type==="focusNext"||c.type==="focusPrev")return l(_i(t,n??void 0,c.type==="focusNext"?1:-1)?.id,u);if(!g)return;if(c.type==="focus")return l(g.id,u);if(c.type==="toggle"){if(g.type==="Form.Checkbox")He(u,g,"onChange",[!tt(g)])}else if(c.type==="optionMove"||c.type==="optionChoose"){if(!["Form.Dropdown","Form.TagPicker"].includes(g.type))return;let y=d(g),S=(m)=>Math.max(0,Math.min(y.length-1,m));if(o=S(o),c.type==="optionMove")o=S(o+Math.trunc(c.delta));else{let m=y[o]?.props.value;if(typeof m!=="string")return;let R=tt(g),A=Array.isArray(R)?R:[];He(u,g,"onChange",[g.type==="Form.Dropdown"?m:A.includes(m)?A.filter((_)=>_!==m):[...A,m]])}}else if(c.type==="setValue"){if(g.type==="Form.Dropdown"){f.set(g.id,c.value),o=0,He(u,g,"onSearchTextChange",[c.value]);return}if(!["Form.TextField","Form.TextArea","Form.PasswordField","Form.DatePicker","Form.FilePicker"].includes(g.type))return;let y=c.value,S="";if(g.type==="Form.DatePicker"){let m=Ui(c.value);S=m===void 0?"Enter a valid ISO date or date/time":"",y=m??null}else if(g.type==="Form.FilePicker"){let m=c.value.split(",").map((R)=>R.trim()).filter(Boolean);y=g.props.allowMultipleSelection===!1?m.slice(0,1):m}if(g.type!=="Form.PasswordField")a.set(g.id,{text:c.value,value:y,error:S});if(!S)He(u,g,"onChange",[y])}},view(){return{focusId:n,items:(e?.children??[]).flatMap((c)=>{if(hr.has(c.type))return[{kind:"field",id:c.id}];if(c.type==="Form.Separator")return[{kind:"separator",id:c.id}];if(c.type==="Form.Description")return[{kind:"description",id:c.id,title:x(c.props.title),text:x(c.props.text)}];return[]}),fields:t.map((c)=>{let u=c.type==="Form.PasswordField",g=u?null:tt(c),y=a.get(c.id),S=d(c).map(mr);return{id:c.id,type:c.type,title:x(c.props.title??c.props.id),required:c.props.required===!0,info:n===c.id?x(c.props.info):"",label:x(c.props.label),placeholder:x(c.props.placeholder),error:y?.error||x(c.props.error),value:g,text:u?"":y?.text??(Array.isArray(g)?g.map(x).join(", "):x(g)),checked:g===!0,hasValue:u&&c.props.hasValue===!0,selected:fr(c).map(mr).filter((m)=>Array.isArray(g)?g.includes(m.value):g===m.value),options:S,optionIndex:n===c.id&&S.length?Math.min(o,S.length-1):0,query:f.get(c.id)??"",focused:n===c.id}})}}}}function br(e,t,n,r){let s=Zt(e);if(!s||!ie(s.onLoadMore)||s.hasMore!==!0)return;let o=t.at(-1);if(!o||J(o)!==n||r===t.length)return;let i=Fe(e,s.onLoadMore);return i?{count:t.length,event:i}:void 0}var Di=200;function sn(e,t){if(!ie(e?.props.onSearchTextChange))return;let n=Z(e,"onSearchTextChange",[t]);if(!n)return;return{event:n,delayMs:e?.props.throttle?Di:0}}var Nt=2500;var yr=3000;function qi(e){return e?.root?.type==="Navigation"?e.root.children:[]}function Gi(e){return e==="immediate"||e==="suspended"?e:"default"}function Re(e){let t=qi(e),n=t.find((i)=>i.type==="Toast"),r=t.find((i)=>i.type==="HUD"),s=t.find((i)=>i.type==="Alert"),o=(i)=>{let a=s?.children.find((f)=>f.props.name===i);return a?{node:a,title:x(a.props.title),style:x(a.props.style)||"default"}:void 0};return{toast:n&&{node:n,style:x(n.props.style).toLowerCase(),title:x(n.props.title),message:x(n.props.message),actions:n.children.map((i)=>({node:i,name:x(i.props.name),title:x(i.props.title),shortcut:i.props.shortcut}))},hud:r&&{node:r,title:x(r.props.title),durationMs:Nt,popToRootType:Gi(r.props.popToRootType),clearRootSearch:r.props.clearRootSearch===!0},alert:s&&{node:s,title:x(s.props.title),message:x(s.props.message),rememberUserChoice:s.props.rememberUserChoice===!0,primary:o("primaryAction"),dismiss:o("dismissAction")}}}var Wi={path:[],selectedId:null};function Hi(e,t,n="Linux",r={}){if(e?.type!=="MenuBarExtra")return[];let s=e;for(let a of t){let f;if(function d(l){for(let p of l.children){if(f)return;if(p.type==="MenuBarExtra.Submenu"&&p.id===a)f=p;else d(p)}}(s),!f)break;s=f}let o=[];function i(a){if(a.type==="MenuBarExtra.Item"){let f=x(a.props.title),d=x(a.props.subtitle),l=Te(a.props.shortcut,n),p=a.props.icon===void 0?void 0:ye(a.props.icon,r);o.push({node:a,item:!0,disabled:!ie(a.props.onAction),title:f,subtitle:d,...p?{iconLabel:p.label,...qe(p)}:{},shortcut:l,text:[f,d,l].filter(Boolean).join(" ")})}else if(a.type==="MenuBarExtra.Submenu"){let f=x(a.props.title);o.push({node:a,item:!0,disabled:!1,title:f,isSubmenu:!0,text:`${f} ›`})}else if(a.type==="MenuBarExtra.Section"){let f=o.length,d=x(a.props.title);if(o.push({node:a,item:!1,disabled:!0,title:d,text:d}),a.children.forEach(i),o.length===f+1)o.splice(f,1)}}return s.children.forEach(i),o}function on(e,t=Wi,n="Linux",r={}){let s=We(e?.root),o=s?.type==="MenuBarExtra"?s:void 0,i=Hi(o,t.path,n,r),a=i.filter((f)=>f.item);return{menu:o,rows:i,items:a,selected:a.find((f)=>J(f.node)===t.selectedId)??a[0],path:t.path,isLoading:o?.props.isLoading===!0,title:x(o?.props.title),tooltip:x(o?.props.tooltip)}}function wr(e,t,n,r="Linux"){let s=on(e,t,r),o={state:t,events:[],leave:!1};if(n.type==="back"){if(t.path.length)return{...o,state:{path:t.path.slice(0,-1),selectedId:null}};return{...o,leave:n.escape===!0}}if(n.type==="move"){let a=s.items.findIndex((l)=>l.node===s.selected?.node),f=s.items[Math.max(0,Math.min(s.items.length-1,a+n.delta))],d=f?J(f.node):null;if(!f||d===J(s.selected?.node))return o;return{...o,state:{...t,selectedId:d},events:[Z(s.menu,"onSelectionChange",[d])].filter((l)=>l!==void 0)}}let i=s.selected;if(i?.node.type==="MenuBarExtra.Submenu")return{...o,state:{path:[...t.path,i.node.id],selectedId:null}};if(i&&!i.disabled)return{...o,events:[Fe(i.node,i.node.props.onAction,[{type:"left-click"}])].filter((a)=>a!==void 0)};return o}function xr(e,t,n="Linux"){if(e?.type!=="MenuBarExtra")return;let r=[...e.children];for(let s=r.shift();s;s=r.shift()){if(s.type==="MenuBarExtra.Item"&&ie(s.props.onAction)&&Ge(s.props.shortcut,t,n))return s;r.push(...s.children)}return}var an=()=>({events:[],effects:[]}),ae=(e,t)=>{if(t)e.events.push(t)},je=(e,t)=>ae(e,Z(t,Xi(t))),pt=(e,t)=>Math.max(0,Math.min(t-1,e)),Xi=(e)=>ie(e?.props.onAction)?"onAction":"onSubmit";function cn(e){let{platform:t}=e,n={appearance:e.appearance??"light",...e.assetsDir===void 0?{}:{assetsDir:e.assetsDir}},r,s=gr(),o="",i=null,a,f,d,l=[],p=null,c="",u=0,g=!1,y="",S=0,m=-1,R,A,_,F="",U="",re="",ue=!1,Pe=0,Ie="",se=!1,Ke=0,D=!1,K=!1,Ve=0,de=new Map,N=new Set,j="",M=(h)=>{if(D)return;D=!0,h.effects.push({type:"quit"})},V=(h,b,w)=>{if(de.delete(b),!w)return;if(!w.delayMs)return ae(h,w.event);let C=`${b}:${++Ve}`;de.set(b,{token:C,event:w.event}),h.effects.push({type:"schedule",ms:w.delayMs,token:C})},G=()=>dr(r,{searchText:o,selectedId:i,...e.fallbackTitle?{fallbackTitle:e.fallbackTitle}:{},icons:n}),X=(h)=>h.list?.type==="MenuBarExtra",pe=(h)=>{let b=h.actions;for(let w of p??[])b=At(b,"",t).find((C)=>C.node.id===w)?.node;return b},$e=(h)=>{let b=pe(h),w=At(b,c,t),C=w.filter((k)=>k.item),B=C.length?pt(u,C.length):-1;return{node:b,rows:w,items:C,index:B,chosen:C[B]?.node}},Ne=(h)=>{let b=or(h.accessory,y),w=b.length?pt(S,b.length):-1;return{options:b,index:w,chosen:b[w]}},z=(h,b)=>b?"alert":X(h)?"menu":g?"dropdown":p!==null?"panel":"base",ge=()=>{g=!1,y="",S=0},Me=(h)=>{p=h,c="",u=0},Be=(h,b)=>{if(ie(b.navigation?.props.pop))ae(h,Z(b.navigation,"pop"));else M(h)};function kt(h){R=h?.id,p=null,c="",u=0,i=null,a=void 0,d=void 0,l=[],ge(),m=-1,o=x(h?.props.searchText),_=void 0,de.delete("search"),de.delete("dropdown")}function ct(h){let b=G();if(s.active(z(b,!!Re(r).alert)==="base",h.events),g&&!b.accessory)ge();let w=J(b.selected);if(d!==void 0&&w===d)d=void 0;if(w!==null&&d===void 0){if(i=w,a!==w)a=w,ae(h,Z(b.list,"onSelectionChange",[w]))}let C=br(b.list,b.items,w,m);if(C)m=C.count,ae(h,C.event)}function Ue(h){let b=We(r?.root),w=b?.props.searchText;if(b?.id!==R)kt(b);else if(w!==A){if(w===_)_=void 0;if(typeof w==="string"&&_===void 0)o=w}A=w;let C=b?.props.selectedItemId;if(C!==f)d=void 0;f=C;let B=G();s.scene(b?.type==="Form"?b:void 0,h.events,z(B,!!Re(r).alert)==="base"),K=!1;let k=B.navigation?.props;if(k){let Y=JSON.stringify(k.clearSearchBar)??"",be=JSON.stringify(k.popToRoot)??"",fe=k.popToRoot;if(Y&&Y!==F||be!==U&&fe&&typeof fe==="object"&&!Array.isArray(fe)&&"clearSearchBar"in fe&&fe.clearSearchBar)o="",_=void 0,de.delete("search"),K=!0,ae(h,Z(B.list,"onSearchTextChange",[""]));if(F=Y,U=be,k.closeMainWindow)M(h)}let{hud:P}=Re(r),H=P?`${P.node.id}\x00${P.title}`:"";if(H!==re){re=H,ue=!!P;let Y=++Pe;if(P)h.effects.push({type:"schedule",ms:e.hudDurationMs??P.durationMs??Nt,token:`hud:${Y}`})}let q=Re(r).toast,ee=q?`${q.node.id}\x00${JSON.stringify(q.node)}`:"";if(ee!==Ie){Ie=ee,se=!!q;let Y=++Ke;if(q&&q.style!=="animated")h.effects.push({type:"schedule",ms:e.toastDurationMs??yr,token:`toast:${Y}`})}}function Oe(h,b){let w=G(),C=b==="up"||b==="down",B=b==="down"||b==="right"?1:-1;switch(z(w,!!Re(r).alert)){case"alert":return;case"menu":return ut(h,w,C?{type:"move",delta:B}:b==="left"?{type:"back"}:{type:"activate"});case"dropdown":if(C)S=pt(Ne(w).index+B,Ne(w).options.length);return;case"panel":if(C)u=pt($e(w).index+B,$e(w).items.length);return}if(w.list?.type==="Form")return;if(!C&&!w.grid)return;let k=J(w.selected),P=w.items.findIndex((H)=>H.id===w.selected?.id);lt(h,w,w.grid?rr(w.grid.rows,k,b):J(w.items[pt(P+B,w.items.length)]))}function lt(h,b,w){if(b.list?.props.selectedItemId==null){i=w;return}if(w===null||w===J(b.selected))return;d=w,a=w,ae(h,Z(b.list,"onSelectionChange",[w]))}function ut(h,b,w){let C=wr(r,{path:l,selectedId:i},w,t);if(C.leave)Be(h,b);l=C.state.path,i=C.state.selectedId;for(let B of C.events)ae(h,B)}function St(h,b){switch(z(b,!!Re(r).alert)){case"alert":return;case"menu":return ut(h,b,{type:"activate"});case"dropdown":{let{chosen:w}=Ne(b);if(!w)return;return ae(h,Z(b.accessory,"onChange",[w.value])),ge()}case"panel":{let{chosen:w}=$e(b);if(w?.type==="ActionPanel.Submenu")return ae(h,Z(w,"onOpen")),Me([...p??[],w.id]);je(h,w),p=null;return}}je(h,b.primary)}function Rt(h,b){let{alert:w}=Re(r);switch(z(b,!!w)){case"alert":return je(h,w?.dismiss?.node);case"menu":return ut(h,b,{type:"back",escape:!0});case"dropdown":return ge();case"panel":{let C=p??[];p=C.length?C.slice(0,-1):null,c="",u=0;return}}Be(h,b)}function ze(h,b,w){let C=Re(r),B=z(b,!!C.alert);if(B==="menu"){let ee=xr(b.list,w,t);if(!ee)return;h.handled=!0;let Y=Fe(ee,ee.props.onAction,[{type:"left-click"}]);if(Y)ae(h,Y);return}if(B!=="base"&&B!=="panel")return;let k=B==="base"&&se&&C.toast?.actions.find((ee)=>Ge(ee.shortcut,w,t));if(k)return h.handled=!0,je(h,k.node);let P=It(b.actions,"",t),H=0,q=P.find((ee)=>{if(!ee.item)return!1;let Y=Ge(rn(ee.node,H),w,t);return H++,Y});if(!q)return;if(h.handled=!0,p=null,c="",u=0,q.node.type==="ActionPanel.Submenu")ae(h,Z(q.node,"onOpen")),Me([q.node.id]);else je(h,q.node)}function zt(h,b){let w=G(),C=Re(r),B=z(w,!!C.alert);switch(b.type){case"focus":case"focusNext":case"focusPrev":case"setValue":case"toggle":case"optionMove":case"optionChoose":if(B==="base"&&w.list?.type==="Form")s.input(b,h.events);return;case"submit":if(B==="base"&&w.list?.type==="Form")je(h,w.primary);return;case"search":{if(B!=="base"||X(w)||o===b.text)return;o=b.text,K=!1;let k=sn(w.list,b.text);return _=k?b.text:void 0,V(h,"search",k)}case"move":return Oe(h,b.direction);case"select":{if(B!=="base"||X(w))return;if(w.items.some((k)=>J(k)===b.id))lt(h,w,b.id);return}case"primary":return St(h,w);case"openActions":if(B==="base"&&w.list?.type!=="MenuBarExtra")Me([]);return;case"closeActions":if(B==="panel")p=null;return;case"actionsQuery":{if(B!=="panel")return;return c=b.text,u=0,ae(h,Z($e(w).node,"onSearchTextChange",[b.text]))}case"key":return ze(h,w,b.key);case"back":return Rt(h,w);case"openDropdown":if(B==="base"&&w.accessory)g=!0,y="",S=0;return;case"dropdownQuery":if(B!=="dropdown")return;return y=b.text,S=0,V(h,"dropdown",sn(w.accessory,b.text));case"chooseDropdown":if(B==="dropdown")St(h,w);return;case"toastAction":{if(B==="alert")return;let k=se&&C.toast?.actions[b.index];return k?je(h,k.node):void 0}case"alert":{let{alert:k}=C;if(!k)return;if(b.remember!==void 0)ae(h,Z(k.node,"onRememberUserChoiceChange",[b.remember]));return je(h,(b.confirm?k.primary:k.dismiss)?.node)}}}function De(h){ct(h);let b=dt(),w=JSON.stringify(b);if(w!==j){j=w;for(let C of N)C(b)}return h}function dt(){let h=G(),b=Re(r),w=z(h,!!b.alert),C=!h.list?"empty":h.list.type==="Grid"?"grid":h.list.type==="Detail"?"detail":h.list.type==="Form"?"form":h.list.type==="MenuBarExtra"?"menu-bar":"list",B=J(h.selected),k=(O)=>{let oe=O.item;return{id:oe?J(O.node)??O.node.id:O.node.id,kind:oe?"item":O.unsupported?"unsupported":"section",title:O.title??O.text,subtitle:O.subtitle??"",accessories:O.accessories??"",icon:O.icon===!0,iconLabel:O.iconView?.label??"",...qe(O.iconView),count:O.count??null,selected:oe&&O.node.id===h.selected?.id,text:O.text}},P=$e(h),H=Ne(h),q=on(r,{path:l,selectedId:i},t,n),ee=h.primary,Y=[];if(p?.length){let O=h.actions;Y=p.map((oe)=>(O=At(O,"",t).find((Ye)=>Ye.node.id===oe)?.node,x(O?.props.title)))}let be=se?b.toast:void 0,fe=b.alert,Yt=fe?.dismiss,Qt=fe?.primary,Xn=h.empty?.props.icon?ye(h.empty.props.icon,n):void 0;return{kind:C,title:h.title,navigation:{canGoBack:ie(h.navigation?.props.pop)},loading:h.loading,search:{text:o,placeholder:x(h.list?.props.searchBarPlaceholder)||"Search…"},rows:C==="list"?h.rows.map(k):[],grid:h.grid?h.grid.rows.map((O)=>({id:O.node?O.node.id:null,header:O.header,cells:O.cells.map((oe)=>{let Ye=tr(oe,n);return{id:J(oe)??oe.id,title:x(oe.props.title),subtitle:x(oe.props.subtitle),content:er(oe),...Ye?.source?{iconSource:Ye.source}:{},...Ye?.mask?{iconMask:Ye.mask}:{},selected:oe.id===h.selected?.id}})})):null,selectedId:B,emptyText:h.emptyText,empty:h.empty?{title:x(h.empty.props.title),description:x(h.empty.props.description),iconLabel:Xn?.label??"",...qe(Xn)}:null,detail:h.detail,primary:{title:x(ee?.props.title)||(C==="form"?"Submit":"Run"),shortcut:Te({modifiers:[],key:"return"},t),enabled:!!ee},actions:{open:w==="panel",title:x(P.node?.props.title)||"Actions",query:c,breadcrumb:Y,rows:P.rows.map((O)=>({id:O.node.id,kind:!O.item?"section":O.isSubmenu?"submenu":"action",title:O.title??O.text,shortcut:O.shortcut??"",selected:O.item&&O.node.id===P.chosen?.id})),selectedIndex:P.index},dropdown:h.accessory?{label:ir(h.accessory,tn(h.accessory)),tooltip:x(h.accessory.props.tooltip),open:w==="dropdown",query:y,options:H.options.map((O,oe)=>({value:O.value,title:O.title,section:O.section,current:O.value===x(h.accessory?.props.value??h.accessory?.props.defaultValue),selected:oe===H.index})),selectedIndex:H.index}:null,feedback:{toast:be?{style:be.style,title:be.title,message:be.message,actions:be.actions.map((O)=>({title:O.title,shortcut:Te(O.shortcut,t)}))}:null,hud:b.hud&&ue?{title:b.hud.title}:null,alert:fe?{title:fe.title,message:fe.message,rememberUserChoice:fe.rememberUserChoice,remember:fe.node.props.rememberChoice===!0,primary:Qt?{title:Qt.title,style:Qt.style}:null,dismiss:Yt?{title:Yt.title,style:Yt.style}:null}:null},menuBar:q.menu?{title:q.title,tooltip:q.tooltip,loading:q.isLoading,path:q.path,selectedId:q.selected?J(q.selected.node):null,rows:q.rows.map((O)=>({id:O.node.id,kind:!O.item?"section":O.isSubmenu?"submenu":"item",title:O.title??"",subtitle:O.subtitle??"",iconLabel:O.iconLabel??"",...O.iconTint?{iconTint:O.iconTint}:{},...O.iconSource?{iconSource:O.iconSource}:{},...O.iconMask?{iconMask:O.iconMask}:{},shortcut:O.shortcut??"",disabled:O.disabled,selected:O.item&&O.node.id===q.selected?.node.id}))}:null,form:C==="form"?s.view():null,requests:{quit:D,clearSearch:K}}}return{scene(h){r=h;let b=an();return Ue(b),De(b)},input(h){let b=an();return zt(b,h),De(b)},tick(h){let b=an();if(h===`hud:${Pe}`)ue=!1;if(h===`toast:${Ke}`)se=!1;for(let[w,C]of de)if(C.token===h)de.delete(w),ae(b,C.event);return De(b)},view:dt,subscribe(h){return N.add(h),()=>void N.delete(h)}}}var Ji="Search commands…",Er="Open Command",Ki="Configure Command",$r={modifiers:["cmd","shift"],key:","},kr=[{id:"open"},{id:"configure"}],zi={view:"Command","no-view":"No View","menu-bar":"Menu Bar"},nt=(e)=>`${e.extension}:${e.command}`;function Sr(e=[],t={}){let n=t.platform??"Linux",r=e,s="",o=null,i=!1,a=0,f=null,d=new Set,l=()=>{let y=new Map;for(let m of r){let R=y.get(m.extension);if(R)R.push(m);else y.set(m.extension,[m])}let S=[...y].map(([m,R])=>({section:m,items:R}));return Se(S,s,(m)=>we({title:m.title,subtitle:m.subtitle||m.description||"",keywords:[m.command,m.extension,m.extensionTitle??""]},s),{enabled:!0,keepSectionOrder:!0}).flatMap((m)=>m.items)},p=(y)=>y.find((S)=>nt(S)===o)??y[0],c=()=>{let y=l(),S=p(y),m=[],R;for(let A of y){if(A.extension!==R){R=A.extension;let F=A.extensionTitle??R;m.push({id:`section:${R}`,kind:"section",title:F,subtitle:"",accessories:"",icon:!1,count:y.filter((U)=>U.extension===R).length,selected:!1,iconLabel:"",text:F})}let _=A.subtitle||A.description||"";m.push({id:nt(A),kind:"item",title:A.title,subtitle:_,accessories:A.mode?zi[A.mode]:"",icon:!!A.icon,count:null,selected:A===S,iconLabel:A.icon?.label??"",...qe(A.icon),text:_?`${A.title} ${_}`:A.title})}return{kind:"list",title:"Commands",navigation:{canGoBack:!1},loading:!1,search:{text:s,placeholder:Ji},rows:m,grid:null,selectedId:S?nt(S):null,emptyText:s?"No matching commands":"No commands",empty:null,detail:"",primary:{title:Er,shortcut:"",enabled:!!S},actions:{open:i&&!!S,title:S?.title??"Actions",query:"",breadcrumb:[],rows:i&&S?[{id:"open",kind:"action",title:Er,shortcut:"",selected:a===0},{id:"configure",kind:"action",title:Ki,shortcut:Te($r,n),selected:a===1}]:[],selectedIndex:i&&S?a:-1},dropdown:null,feedback:{toast:f&&{style:"failure",...f,actions:[]},hud:null,alert:null},menuBar:null,form:null,requests:{quit:!1,clearSearch:!1}}},u=()=>{let y=c();for(let S of d)S(y)},g=(y)=>{let S=p(l());return i=!1,{effects:S?[{type:y,extension:S.extension,command:S.command}]:[]}};return{input(y){f=null;let S={effects:[]};switch(y.type){case"search":s=y.text,o=null,i=!1;break;case"move":{let m=l(),R=y.direction==="down"?1:y.direction==="up"?-1:0,A=p(m);if(i){a=Math.max(0,Math.min(kr.length-1,a+R));break}let _=m[(A?m.indexOf(A):0)+R];if(_)o=nt(_);break}case"select":{let m=l().find((R)=>nt(R)===y.id);if(m)o=nt(m);break}case"primary":S=g(i&&kr[a]?.id==="configure"?"configure":"launch");break;case"key":if(Ge($r,y.key,n))S=g("configure");break;case"openActions":i=!0,a=0;break;case"closeActions":case"back":i=!1;break;default:break}return u(),S},setCatalog(y){r=y,u()},fail(y,S){f={title:y,message:S},u()},reset(){s="",i=!1,f=null,u()},view:c,subscribe(y){return d.add(y),y(c()),()=>d.delete(y)}}}class ft extends Error{code="BROWSER_MISSING_FILE";path;constructor(e){super(`Browser bundle file is missing: ${e}`);this.name="BrowserMissingFileError",this.path=e}}class ln extends Error{code="BROWSER_MISSING_DEPENDENCY";packages;constructor(e){let t=[...new Set(e)].toSorted();super(`Browser bundle dependencies are missing: ${t.join(", ")}`);this.name="BrowserMissingDependencyError",this.packages=t}}class un extends Error{code="BROWSER_NATIVE_MODULE";modules;constructor(e){let t=[...new Set(e)].toSorted();super(`Native modules are not supported in a browser bundle: ${t.join(", ")}`);this.name="BrowserNativeModuleError",this.modules=t}}var dn=[".tsx",".ts",".jsx",".js",".json"],Yi=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"],Qi=new Set(Yi),Zi=new Set(["better-sqlite3","canvas","fsevents","keytar","node-gyp-build","sharp","sqlite3"]);function ce(e){let t=[];for(let n of e.replaceAll("\\","/").split("/")){if(!n||n===".")continue;if(n==="..")t.pop();else t.push(n)}return`/${t.join("/")}`}function rt(e){return e.startsWith("@")?e.split("/").slice(0,2).join("/"):e.split("/")[0]}function ea(e){return e.startsWith("node:")||Qi.has(e)}function ta(e){let t=dn.find((n)=>e.endsWith(n));if(t===".tsx")return"tsx";if(t===".ts")return"ts";if(t===".jsx")return"jsx";if(t===".json")return"json";return"js"}function na(e){return e}function ra(e){return typeof e==="string"?e:new TextDecoder().decode(e)}function me(e,t){let n=ce(t),r=n.replace(/\.[cm]?jsx?$/,""),s=[n,...r===n?[]:dn.map((o)=>`${r}${o}`),...dn.map((o)=>`${n}${o}`),`${n}/index.ts`,`${n}/index.tsx`,`${n}/index.js`,`${n}/index.json`];for(let o of s){if(e.has(o))return o;let i=o.slice(1);if(e.has(i))return i}return}function sa(e,t){let n=me(e,`${t}/package.json`);if(!n)return;try{let r=JSON.parse(ra(e.get(n)));return r&&typeof r==="object"?r:void 0}catch{return}}function oa(e,t,n){let r=[],s=ce(t.slice(0,t.lastIndexOf("/"))||"/");while(!0){let i=ce(`${s}/node_modules/${n}`);if(e.has(i)||e.has(i.slice(1))||[...e.keys()].some((a)=>ce(a).startsWith(`${i}/`)))r.push(i);if(s==="/")break;s=ce(`${s}/..`)}let o=`/${n}`;if(e.has(o)||e.has(n)||[...e.keys()].some((i)=>ce(i).startsWith(`${o}/`)))r.push(o);return[...new Set(r)]}function mt(e,t){if(typeof e==="string")return e;if(e===null||e===!1)return!1;if(Array.isArray(e)){for(let s of e){let o=mt(s,t);if(o!==void 0&&o!==!1)return o}return}if(!e||typeof e!=="object")return;let n=e,r=Object.keys(n).filter((s)=>s.startsWith("."));if(r.length){let s=n[t];if(s!==void 0)return mt(s,t);let o=r.filter((i)=>i.endsWith("*")&&t.startsWith(i.slice(0,-1))).toSorted((i,a)=>a.length-i.length)[0];if(o){let i=mt(n[o],t);return typeof i==="string"?i.replaceAll("*",t.slice(o.length-1)):i}return}for(let s of["browser","import","module","require","default"])if(n[s]!==void 0){let o=mt(n[s],t);if(o!==void 0)return o}return}function ia(e,t,n){let r=rt(t),s=t.slice(r.length).replace(/^\//,"");for(let o of oa(e,n,r)){let i=sa(e,o),a=s?`./${s}`:".";if(i?.exports!==void 0){let c=mt(i.exports,a);if(c===!1||c===void 0)return[];let u=me(e,ce(`${o}/${c}`));return u?[u]:[]}let f=s?ce(`${o}/${s}`):void 0;if(f){let c=me(e,f);if(c)return[c];continue}let d=i?.browser;if(typeof d==="string"){let c=me(e,ce(`${o}/${d}`));if(c)return[c]}let l=[],p=typeof i?.module==="string"?i.module:typeof i?.main==="string"?i.main:"index";if(typeof d==="object"&&d){let c=d[`./${p}`]??d["."];if(typeof c==="string")l.push(ce(`${o}/${c}`))}if(l.push(ce(`${o}/${p}`)),typeof i?.main==="string"&&typeof i?.module==="string")l.push(ce(`${o}/${i.main}`));l.push(ce(`${o}/index`));for(let c of l){let u=me(e,c);if(u)return[u]}}return[]}async function Rr(e){let t=new Map([...e.files,...e.packages]),n=me(t,e.command),r=me(t,e.runtimeEntry);if(!n)throw new ft(e.command);if(!r)throw new ft(e.runtimeEntry);let s=new Set,o=new Set,i=new Set,a="/__blast_browser_bundle_entry__.js",f={name:"blast-browser-memory",setup(p){p.onResolve({filter:/.*/},(c)=>{let u=c.path;if(c.kind==="entry-point"){if(u===a)return{path:a};let m=me(t,u);return m?{path:m}:void 0}if(e.sharedRuntime&&e.sharedModules?.includes(u))return{path:`/__blast_shared_${u.replaceAll("/","_")}`};let g=e.aliases?.[u];if(g)return{path:me(t,g)??g};if(ea(u))return{path:u,external:!0};if(u.endsWith(".node"))return o.add(u),{errors:[{text:`Native module ${u} is not supported`}]};if(!u.startsWith(".")&&!u.startsWith("/")&&Zi.has(rt(u)))return o.add(rt(u)),{errors:[{text:`Native package ${rt(u)} is not supported`}]};if(u==="@blastlauncher/command")return{path:n};let y=u.startsWith(".")||u.startsWith("/"),S=y?me(t,ce(`${c.importer.slice(0,c.importer.lastIndexOf("/"))}/${u}`)):g?me(t,g):ia(t,u,c.importer).map((m)=>me(t,m)).find(Boolean);if(S)return{path:S.startsWith("/")?S:`/${S}`};if(!y)return s.add(rt(u)),{errors:[{text:`Missing browser dependency ${rt(u)}`}]};return i.add(u),{errors:[{text:`Missing browser file ${u}`}]}}),p.onLoad({filter:/.*/},(c)=>{if(c.path===a)return{contents:e.entryCode?e.entryCode:e.sharedRuntime?`const __blastRuntime = globalThis.__blastRuntime;
|
|
3
|
+
if (typeof __blastRuntime?.start === "function") __blastRuntime.start(async () => { const __blastCommand = await import(${JSON.stringify(n)}); return { ...__blastCommand, default: __blastCommand.default ?? __blastCommand }; });`:`import * as __blastRuntime from ${JSON.stringify(r)};
|
|
4
|
+
if (typeof __blastRuntime.start === "function") __blastRuntime.start(async () => { const __blastCommand = await import(${JSON.stringify(n)}); return { ...__blastCommand, default: __blastCommand.default ?? __blastCommand }; });`,loader:"js",resolveDir:"/"};if(c.path.startsWith("/__blast_shared_")){let g=c.path.slice(16).replaceAll("_","/");return{contents:`module.exports = globalThis.__blastModules[${JSON.stringify(g)}];`,loader:"js"}}let u=me(t,c.path);if(!u)return{errors:[{text:`Missing browser file ${c.path}`}]};return{contents:na(t.get(u)),loader:ta(u),resolveDir:ce(u.slice(0,u.lastIndexOf("/")))}})}},d=await e.esbuild.build({absWorkingDir:"/",entryPoints:[a],bundle:!0,write:!1,format:"cjs",platform:"browser",target:"es2020",minify:!0,legalComments:"none",jsx:"automatic",plugins:[f],logLevel:"silent"}).catch((p)=>{if(o.size)throw new un(o);if(s.size)throw new ln(s);if(i.size)throw new ft([...i].toSorted()[0]);throw p});if(o.size)throw new un(o);if(s.size)throw new ln(s);if(i.size)throw new ft([...i].toSorted()[0]);let l=d.outputFiles?.[0];if(!l)throw Error("esbuild returned no browser bundle");return{code:l.text,warnings:(d.warnings??[]).map((p)=>p.text),bytes:l.contents.byteLength}}var Le=li(yo(),1);function wo(e){return e==="@raycast/api"||/^react(?:\/|$)/.test(e)||e.startsWith("@types/")}class Je extends Error{code;constructor(e,t){super(t);this.name="BrowserInstallError",this.code=e}}class xo extends Je{packageName;expected;actual;constructor(e,t,n){super("BROWSER_INTEGRITY",`Integrity check failed for ${e}`);this.name="BrowserIntegrityError",this.packageName=e,this.expected=t,this.actual=n}}class Eo extends Je{limit;actual;constructor(e,t){super("BROWSER_SIZE_LIMIT",`Browser dependency size limit exceeded (${t} > ${e} bytes)`);this.name="BrowserSizeLimitError",this.limit=e,this.actual=t}}class $o extends Je{limit;constructor(e){super("BROWSER_PACKAGE_LIMIT",`Browser dependency package limit exceeded (${e})`);this.name="BrowserPackageLimitError",this.limit=e}}class ko extends Je{packageName;constructor(e){super("BROWSER_NATIVE_MODULE",`Native package is not supported in the browser: ${e}`);this.name="BrowserNativePackageError",this.packageName=e}}class Et extends Je{packageName;constructor(e,t){super("BROWSER_RESOLUTION",`Unable to resolve ${e}@${t} from the npm registry`);this.name="BrowserResolutionError",this.packageName=e}}var du=33554432,pu=128;function Xe(e){return`node_modules/${e}`}function fu(e,t){if(!e)return[Xe(t)];let n=[`${e}/node_modules/${t}`],r=e;while(r&&r!=="."){let s=r.slice(0,r.lastIndexOf("/"));if(!s)break;n.push(`${s}/${t}`);let o=s.lastIndexOf("/");if(o<0)break;r=s.slice(0,o)}return n.push(Xe(t)),[...new Set(n)]}function An(e,t){return e?.packages?.[t]?.version}function mu(e,t){return e?.dependencies?.[t]?.version}function hu(e){if(e===void 0)return;if(typeof e==="string")return JSON.parse(e);return e}function So(e){return new TextDecoder().decode(e)}function Nn(e){return So(e).replace(/\0.*$/,"").trim()}function gu(e){let t=Nn(e).replace(/[^0-7].*$/,"");return t?Number.parseInt(t,8):0}class On extends Je{path;constructor(e){super("BROWSER_TAR_PATH",`Unsafe path in npm archive: ${e}`);this.name="BrowserTarPathError",this.path=e}}function bu(e){if(e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))throw new On(e);let t=e.split("/");if(t.some((n)=>n===".."))throw new On(e);return t.filter((n)=>n!==""&&n!==".").join("/")}function yu(e){let t=new Map,n=0,r;while(n+512<=e.length){let s=e.subarray(n,n+512);if(n+=512,s.every((l)=>l===0))break;let o=gu(s.subarray(124,136)),i=s[156],a=Nn(s.subarray(0,100)),f=Nn(s.subarray(345,500));if(f)a=`${f}/${a}`;let d=e.subarray(n,n+o);if(n+=Math.ceil(o/512)*512,i===120){for(let l of So(d).split(`
|
|
5
|
+
`)){let p=l.indexOf("=");if(p>0){if(l.slice(l.indexOf(" ")+1,p)==="path")r=l.slice(p+1)}}continue}if(a=bu(r??a),r=void 0,!a||i===53||i===1||i===2||a.endsWith("/"))continue;if(i===0||i===48||i===void 0)t.set(a,d.slice())}return t}async function wu(e){let t=new Uint8Array(e.byteLength);t.set(e);let n=new Blob([t.buffer]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(n).arrayBuffer())}async function xu(e){let t=new Uint8Array(e.byteLength);t.set(e);let n=await globalThis.crypto.subtle.digest("SHA-512",t.buffer),r="";for(let s of new Uint8Array(n))r+=String.fromCharCode(s);return`sha512-${btoa(r)}`}async function Ro(e){let t=e.maxBytes??du,n=e.maxPackages??pu,r=hu(e.lockfile),s=(e.registry??"https://registry.npmjs.org").replace(/\/$/,""),o=new Map,i=new Map,a=new Map,f=0,d=(u)=>{if(f+=u,f>t)throw new Eo(t,f)},l=new Map,p=(u,g)=>{let y=l.get(u);if(!y)y=e.fetch(`${s}/${u}`,{headers:{Accept:"application/vnd.npm.install-v1+json"}}).then((S)=>{if(!S.ok)throw new Et(u,g);return S.json()}),l.set(u,y);return y};async function c(u,g,y){if(wo(u))return;let S=await p(u,g),m=fu(y,u),R=m.find((D)=>a.has(D));if(R){let D=a.get(R);if(Le.satisfies(D.version,g)){if(!D.active)await D.promise;return}}let A=R?void 0:m.find((D)=>{let K=An(r,D);return K!==void 0&&Le.satisfies(K,g)&&!a.has(D)});if(!A)if(R)A=`${y??Xe(u)}/node_modules/${u}`;else if(y===void 0)A=Xe(u);else{let D=Xe(u),K=An(r,D);A=K!==void 0&&!Le.satisfies(K,g)?`${y}/node_modules/${u}`:D}while(a.has(A)){let D=a.get(A);if(Le.satisfies(D.version,g)){if(!D.active)await D.promise;return}A=`${A}/node_modules/${u}`}let _=An(r,A)??(A===Xe(u)?mu(r,u):void 0),F=_!==void 0&&Le.satisfies(_,g)?_:Le.maxSatisfying(Object.keys(S.versions??{}),g);if(!F||!Le.satisfies(F,g))throw new Et(u,g);let U=S.versions?.[F],re=U?.dist?.tarball;if(!U||!re)throw new Et(u,g);if(a.size>=n)throw new $o(n);let ue,Pe,Ie=new Promise((D,K)=>{ue=D,Pe=K}),se={name:u,version:F,promise:Ie,active:!0};a.set(A,se);let Ke=(async()=>{try{let D=await e.fetch(re);if(!D.ok)throw new Et(u,F);let K=new Uint8Array(await D.arrayBuffer());d(K.byteLength);let Ve=await xu(K),N=U.dist?.integrity?.split(/\s+/).find((G)=>G.startsWith("sha512-"));if(N&&N!==Ve)throw new xo(u,N,Ve);let j=yu(await wu(K));if([...j.keys()].some((G)=>G.endsWith(".node")||G==="binding.gyp"||G.endsWith("/binding.gyp")))throw new ko(u);for(let[G,X]of j){let pe=G.replace(/^package\/?/,"");if(pe)o.set(`${A}/${pe}`,X)}if(!o.has(`${A}/package.json`))o.set(`${A}/package.json`,JSON.stringify({name:u,version:F}));if(!i.has(u)||A===Xe(u))i.set(u,F);let M=new Set(Object.entries(U.peerDependenciesMeta??{}).filter(([,G])=>G?.optional===!0).map(([G])=>G)),V=Object.fromEntries(Object.entries({...U.dependencies,...U.peerDependencies}).filter(([G])=>!M.has(G)));await Promise.all(Object.entries(V).map(([G,X])=>c(G,X,A))),se.active=!1,ue()}catch(D){se.active=!1,Pe(D)}})();return Ie}return await Promise.all(Object.entries(e.manifest.dependencies??{}).map(([u,g])=>c(u,g))),{packages:o,versions:i,bytes:f}}var vo={"@raycast/api":"/packages/runtime/src/api/index.ts","@blastlauncher/protocol":"/packages/protocol/src/index.ts",react:"/node_modules/react/index.js","react/jsx-runtime":"/node_modules/react/jsx-runtime.js","react/jsx-dev-runtime":"/node_modules/react/jsx-dev-runtime.js","react-reconciler":"/node_modules/react-reconciler/index.js","react-reconciler/constants.js":"/node_modules/react-reconciler/constants.js",scheduler:"/node_modules/scheduler/index.js","stream/promises":"/packages/web/sandbox/stream-promises.ts","node:stream/promises":"/packages/web/sandbox/stream-promises.ts","util/types":"/packages/web/sandbox/util-types.ts","node:util/types":"/packages/web/sandbox/util-types.ts"};var Cn=()=>({extension:{},commands:{}});function Ln(e,t){let n=`blast:${e}:preferences`,r=null,s=()=>{try{return t?.getItem(n)??r}catch{return r}},o=()=>{let a=s();if(!a)return Cn();try{let f=JSON.parse(a);if(!f||typeof f!=="object"||!f.extension||!f.commands)return Cn();return{extension:f.extension,commands:f.commands}}catch{return Cn()}},i=(a)=>{let f=JSON.stringify(a);r=f;try{t?.setItem(n,f)}catch{}};return{read:o,save:i,values(a){let f=o();return{...f.extension,...f.commands[a]}},update(a,f,d){let l=o();i({extension:{...l.extension,...a},commands:{...l.commands,[f]:{...l.commands[f],...d}}})}}}var he=(e)=>({ok:!1,error:{code:"DENIED",message:e}});function Eu(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function Io(e,t){return e.extensions.find((n)=>n.name===t)}var No=(e,t,n)=>`blast:${e}:${n?"internal":"user"}:${t}`,Ao=(e)=>{if(e===null)return null;try{return JSON.parse(e)}catch{return null}},Tn=(e,t)=>No(e,`oauth:${t}`,!0);function Oo(e){let t=new Map,n="",r=e.storage,s=(d)=>{try{return r?.getItem(d)??t.get(d)??null}catch{return t.get(d)??null}},o=(d,l)=>{t.set(d,l);try{r?.setItem(d,l)}catch{}},i=(d)=>{t.delete(d);try{r?.removeItem(d)}catch{}},a=(d)=>{let l=`blast:${d}:user:`,p=new Map;try{for(let u=0;u<(r?.length??0);u++){let g=r?.key(u);if(g?.startsWith(l)){let y=g.slice(l.length),S=r?.getItem(g);if(typeof S==="string")p.set(y,S)}}}catch{}for(let[u,g]of t)if(u.startsWith(l))p.set(u.slice(l.length),g);let c={};for(let[u,g]of p)try{c[u]=JSON.parse(g)}catch{}return c},f=(d)=>{let l=`blast:${d}:user:`,p=new Set;for(let c of t.keys())if(c.startsWith(l))p.add(c);try{for(let c=0;c<(r?.length??0);c++){let u=r?.key(c);if(u?.startsWith(l))p.add(u)}}catch{}for(let c of p)i(c)};return async function(l,p){let c=Eu(l.params);if(l.name==="storage.get"||l.name==="storage.set"||l.name==="storage.remove"){let u=typeof c.key==="string"?c.key:"";if(!u)return he(`${l.name} requires a non-empty key`);let g=No(p.extensionName,u,c.scope==="blast:internal");if(l.name==="storage.get")return{ok:!0,value:Ao(s(g))};if(l.name==="storage.remove")return i(g),{ok:!0,value:null};return o(g,JSON.stringify(c.value)),{ok:!0,value:null}}if(l.name==="storage.all")return{ok:!0,value:a(p.extensionName)};if(l.name==="storage.clear")return f(p.extensionName),{ok:!0,value:null};if(l.name==="oauth.tokens.get")return{ok:!0,value:Ao(s(Tn(p.extensionName,String(c.providerId??""))))};if(l.name==="oauth.tokens.set")return o(Tn(p.extensionName,String(c.providerId??"")),JSON.stringify(c.tokens)),{ok:!0,value:null};if(l.name==="oauth.tokens.remove")return i(Tn(p.extensionName,String(c.providerId??""))),{ok:!0,value:null};if(l.name==="clipboard.copy"||l.name==="clipboard.paste"){let u=typeof c.text==="string"?c.text:"";n=u;try{await e.clipboard?.writeText?.(u)}catch{}if(l.name==="clipboard.paste")e.status?.("Copied — paste with ⌘V");else e.status?.("Copied");return{ok:!0,value:null}}if(l.name==="clipboard.read"){try{let u=await e.clipboard?.readText?.();if(typeof u==="string")return{ok:!0,value:{text:u}}}catch{}return{ok:!0,value:{text:n}}}if(l.name==="clipboard.clear")return n="",{ok:!0,value:null};if(l.name==="open.url"){let u=typeof c.url==="string"?c.url:"";return e.openUrl?.(u),{ok:!0,value:null}}if(l.name==="command.metadata")return Io(e.catalog,p.extensionName)?.commands.find((g)=>g.name===p.commandName)?{ok:!0,value:null}:he("This command is not in the browser catalog");if(l.name==="command.launch"){let u=String(c.extensionName??p.extensionName);if(u!==p.extensionName)return he("The browser demo can launch commands only from the current extension");let g=typeof c.name==="string"?c.name:"";if(!Io(e.catalog,u)?.commands.some((y)=>y.name===g))return he("That command is not in the browser catalog");if(c.type==="background")return e.status?.(`Background command accepted: ${g}`),{ok:!0,value:null};if(!e.launchCommand)return he("Command launching is unavailable in this browser session");return await e.launchCommand(p.source,g),{ok:!0,value:null}}if(l.name==="oauth.authorize")return he("OAuth authorization needs a host redirect and is unavailable in a browser tab");if(l.name==="preferences.open"){let u=c.scope;if(u!=="extension"&&u!=="command")return he("preferences.open requires an extension or command scope");return e.openPreferences?.(u,p),{ok:!0,value:null}}if(l.name==="applications.list")return{ok:!0,value:[]};if(l.name==="applications.default"||l.name==="applications.frontmost")return he("Applications are unavailable in a browser tab");if(l.name.startsWith("applications."))return he("Applications are unavailable in a browser tab");if(l.name.startsWith("selection."))return he("Selection is unavailable in a browser tab");if(l.name.startsWith("window."))return he("Window management is unavailable in a browser tab");if(l.name.startsWith("ai."))return he("AI access is unavailable in a browser tab");return he(`${l.name} is not supported by the browser demo`)}}var Co=`
|
|
6
|
+
.blast-web{--blast-bg:#fcfcfc;--blast-fg:#171717;--blast-muted:#646464;--blast-line:#e2e2e2;--blast-selection:#ededed;--blast-accent:#ff6338;--blast-error:#d93036;--blast-radius:12px;font:14px/1.4 system-ui,sans-serif;background:var(--blast-bg);color:var(--blast-fg);border:1px solid var(--blast-line);border-radius:var(--blast-radius);overflow:hidden}
|
|
7
|
+
.blast-web[data-theme=dark]{--blast-bg:#161616;--blast-fg:#f2f2f2;--blast-muted:#a0a0a0;--blast-line:#343434;--blast-selection:#282828}
|
|
8
|
+
@media(prefers-color-scheme:dark){.blast-web:not([data-theme=light]){--blast-bg:#161616;--blast-fg:#f2f2f2;--blast-muted:#a0a0a0;--blast-line:#343434;--blast-selection:#282828}}
|
|
9
|
+
.blast-web main{display:flex;flex-direction:column;min-height:16rem}
|
|
10
|
+
.blast-web header{padding:.5rem .75rem;border-bottom:1px solid var(--blast-line)}
|
|
11
|
+
.blast-web h1{margin:0 0 .25rem;font-size:12px;font-weight:600;color:var(--blast-muted)}
|
|
12
|
+
.blast-web .search-line{display:flex;gap:.5rem;align-items:center}
|
|
13
|
+
.blast-web input,.blast-web textarea,.blast-web select{font:inherit;color:inherit;background:transparent;border:0;outline:0}
|
|
14
|
+
.blast-web #search,.blast-web .search-line input{flex:1;padding:.25rem 0}
|
|
15
|
+
.blast-web ul{margin:0;padding:.25rem;list-style:none;flex:1;overflow:auto}
|
|
16
|
+
.blast-web li{display:flex;gap:.5rem;align-items:center;padding:.4rem .5rem;border-radius:8px}
|
|
17
|
+
.blast-web li.selected,.blast-web .selected{background:var(--blast-selection)}
|
|
18
|
+
.blast-web .section-header{color:var(--blast-muted);font-size:12px}
|
|
19
|
+
.blast-web small,.blast-web .root-accessory{color:var(--blast-muted)}
|
|
20
|
+
.blast-web .root-copy{flex:1;display:flex;gap:.5rem;align-items:baseline}
|
|
21
|
+
.blast-web footer{display:flex;gap:.75rem;align-items:center;padding:.4rem .75rem;border-top:1px solid var(--blast-line);color:var(--blast-muted)}
|
|
22
|
+
.blast-web footer #status{flex:1}
|
|
23
|
+
.blast-web #status[data-error=true],.blast-web [data-blast-error]{color:var(--blast-error)}
|
|
24
|
+
.blast-web button{font:inherit;color:inherit;background:transparent;border:0;border-radius:6px;cursor:pointer}
|
|
25
|
+
.blast-web kbd{font:inherit;font-size:11px;padding:0 .3rem;margin-left:.25rem;border:1px solid var(--blast-line);border-radius:4px}
|
|
26
|
+
.blast-web .actions,.blast-web .dropdown-panel{margin:.5rem;padding:.5rem;border:1px solid var(--blast-line);border-radius:8px;background:var(--blast-bg)}
|
|
27
|
+
.blast-web .empty,.blast-web [role=status]:not(#status){padding:1rem;color:var(--blast-muted)}
|
|
28
|
+
.blast-web .detail,.blast-web .extension-form{padding:.75rem}
|
|
29
|
+
.blast-web .form-field{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.5rem}
|
|
30
|
+
.blast-web .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
31
|
+
`;function E(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var To=(e,t,n)=>`<button type="button" class="footer-key" data-footer="${n}"><span>${E(e)}</span><kbd>${E(t)}</kbd></button>`,Mn=(e,t,n)=>{if(!t)return"";let r=n?.(t);return r?`<${e} class="reserved" title="${E(r)}" aria-label="${E(`${t}, ${r}`)}">${E(t)}</${e}>`:`<${e}>${E(t)}</${e}>`},$u=(e,t,n=!1)=>`<button data-input="${E(t)}"${n?' class="selected"':""}>${E(e)}</button>`,Lo=(e,t)=>{if(t&&/^data:image\/[a-z0-9.+-]+[;,]\S*$/iu.test(e))return e;try{return new URL(e).protocol==="https:"?e:void 0}catch{return}},qt=(e)=>E(e).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__([^_]+)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/(^|[^\w])_([^_]+)_(?!\w)/g,"$1<em>$2</em>"),Pn=(e)=>{let t="",n=0;for(let r of e.matchAll(/`([^`]+)`|(!?)\[([^\]]*)\]\(([^\s)]+)\)/gu)){t+=qt(e.slice(n,r.index)),n=r.index+r[0].length;let[,s,o,i="",a=""]=r;if(s!==void 0)t+=`<code>${E(s)}</code>`;else if(o){let f=Lo(a,!0);t+=f?`<img src="${E(f)}" alt="${E(i)}">`:E(i)}else{let f=Lo(a,!1);t+=f?`<a href="${E(f)}" target="_blank" rel="noreferrer noopener">${qt(i)}</a>`:qt(i)}}return t+qt(e.slice(n))};function ku(e){let t=String(e??"").split(/\r?\n/),n=[],r=!1;for(let s of t){let o=s.match(/^\s*[-*]\s+(.+)$/);if(o){if(!r)n.push("<ul>"),r=!0;n.push(`<li>${Pn(o[1]??"")}</li>`);continue}if(r)n.push("</ul>"),r=!1;let i=s.match(/^\s*(#{1,3})\s+(.+)$/);if(i){let a=i[1]?.length??1;n.push(`<h${a}>${Pn(i[2]??"")}</h${a}>`);continue}if(!s.trim())continue;n.push(`<p>${Pn(s)}</p>`)}if(r)n.push("</ul>");return n.join("")}function Su(e){return`<span id="status" role="status" data-error="${e.error?"true":"false"}"${e.stage?` data-stage="${E(e.stage)}"`:""}>${e.progress?'<span class="status-spinner" aria-hidden="true"></span>':""}${E(e.text)}</span>`}function Ru(e){if(!e)return"";return`<div class="breadcrumb"><span class="breadcrumb-icon" aria-hidden="true">${e.iconUrl?`<img src="${E(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:E(e.icon??"⌘")}</span><span>${E(e.extensionTitle)}</span><span class="breadcrumb-separator">›</span><span>${E(e.commandTitle)}</span></div>`}function vu(e,t){if(!e)return"";return`<span class="footer-context" aria-hidden="true"><span class="footer-icon">${e.iconUrl?`<img src="${E(e.iconUrl)}" alt="" width="20" height="20" onerror="this.hidden=true">`:E(e.icon??"⌘")}</span><span class="footer-title">${E(t||e.commandTitle)}</span></span>`}function Iu(e,t={}){let n=e.feedback.toast?`<aside class="toast" data-style="${E(e.feedback.toast.style)}"><strong>${E(e.feedback.toast.title)}</strong> ${E(e.feedback.toast.message)}${e.feedback.toast.actions.map((o,i)=>`<button type="button" data-toast-action="${i}">${E(o.title)} ${Mn("small",o.shortcut,t.reservedHint)}</button>`).join("")}</aside>`:"",r=e.feedback.hud?`<aside class="hud" role="status">${E(e.feedback.hud.title)}</aside>`:"",s=e.feedback.alert?`<section class="alert-backdrop"><dialog open class="alert" role="alertdialog" aria-modal="true" aria-labelledby="alert-title"><h2 id="alert-title">${E(e.feedback.alert.title)}</h2><p>${E(e.feedback.alert.message)}</p>${e.feedback.alert.rememberUserChoice?`<label><input id="alert-remember" type="checkbox"${e.feedback.alert.remember?" checked":""}> Remember my choice</label>`:""}<footer>${e.feedback.alert.dismiss?`<button type="button" data-alert="dismiss">${E(e.feedback.alert.dismiss.title)}</button>`:""}${e.feedback.alert.primary?`<button type="button" data-alert="confirm">${E(e.feedback.alert.primary.title)}</button>`:""}</footer></dialog></section>`:"";return`${n}${r}${s}`}function Po(e,t={}){let n=t.status??{text:"Ready"},r=`<input id="search" value="${E(e.search.text)}" placeholder="${E(e.search.placeholder)}" aria-label="Search">${e.dropdown?`<button type="button" class="dropdown-trigger" data-dropdown-open aria-label="${E(e.dropdown.tooltip||e.dropdown.label)}">${E(e.dropdown.label||"Filter")}⌄</button>`:""}`,s=e.rows.map((m)=>m.kind==="section"?`<li class="section-header" data-id="${E(m.id)}"><strong>${E(m.title)}</strong>${m.count===null?"":`<small>${m.count}</small>`}</li>`:`<li${m.selected?' class="selected"':""} data-id="${E(m.id)}"><span class="root-icon"${m.iconTint?` style="color:${E(m.iconTint)}"`:""}>${E(m.iconLabel)}</span><span class="root-copy"><strong>${E(m.title)}</strong>${m.subtitle?`<small>${E(m.subtitle)}</small>`:""}</span>${m.accessories?`<span class="root-accessory">${E(m.accessories)}</span>`:""}</li>`).join(""),o=(e.grid??[]).map((m)=>`${m.header?`<li class="grid-header">${E(m.header)}</li>`:""}<li class="grid-row">${m.cells.map((R)=>`<button type="button" class="grid-cell${R.selected?" selected":""}" data-id="${E(R.id)}"><span class="grid-content">${E(R.content)}</span><strong>${E(R.title)}</strong><small>${E(R.subtitle)}</small></button>`).join("")}</li>`).join(""),i=e.dropdown?.open?`<section class="dropdown-panel" role="dialog" aria-label="${E(e.dropdown.label)}"><input id="dropdown-search" data-dropdown-search value="${E(e.dropdown.query)}" aria-label="Filter options"><ul>${e.dropdown.options.map((m)=>`<li><button type="button" data-dropdown-value="${E(m.value)}"${m.selected?' class="selected"':""}>${E(m.title)}${m.current?" ✓":""}</button></li>`).join("")}</ul></section>`:"",a=e.actions.open?`<section class="actions"><strong>${E(e.actions.title)}</strong><div class="breadcrumb">${e.actions.breadcrumb.map(E).join(" / ")}</div><input id="action-search" value="${E(e.actions.query)}" placeholder="Search actions…" aria-label="Action search"><ul>${e.actions.rows.map((m,R)=>`<li${m.selected?' class="selected"':""} data-action-index="${R}">${E(m.title)} ${Mn("small",m.shortcut,t.reservedHint)}</li>`).join("")}</ul></section>`:"",f=e.form,d=f?`<form class="extension-form">${f.items.map((m)=>{if(m.kind==="separator")return'<hr class="form-separator">';if(m.kind==="description")return`<p class="form-description">${E(m.title)}${m.text?`: ${E(m.text)}`:""}</p>`;let R=f.fields.find((re)=>re.id===m.id);if(!R)return"";let A=E(R.title||R.label||R.id),_=`id="field-${E(R.id)}" data-field="${E(R.id)}"`,F=R.error?`<small class="form-error" role="alert">${E(R.error)}</small>`:"";if(R.type==="Form.Checkbox")return`<label class="form-field checkbox"><span>${A}</span><input ${_} type="checkbox"${R.checked?" checked":""}></label>`;if(R.type==="Form.Dropdown"||R.type==="Form.TagPicker")return`<label class="form-field"><span>${A}</span><select ${_} ${R.type==="Form.TagPicker"?"multiple":""}>${R.options.map((re)=>`<option value="${E(re.value)}"${R.selected.some((ue)=>ue.value===re.value)?" selected":""}>${E(re.title)}</option>`).join("")}</select>${F}</label>`;if(R.type==="Form.DatePicker")return`<label class="form-field"><span>${A}</span><input ${_} type="date" value="${E(R.text.slice(0,10))}">${F}</label>`;if(R.type==="Form.FilePicker")return`<p class="form-unavailable">${A}: not available in the browser</p>`;let U=R.type==="Form.TextArea";return`<label class="form-field"><span>${A}</span>${U?`<textarea ${_} placeholder="${E(R.placeholder)}">${E(R.text)}</textarea>`:`<input ${_} type="${R.type==="Form.PasswordField"?"password":"text"}"${R.hasValue?" data-has-value":""} value="${E(R.text)}" placeholder="${E(R.placeholder)}">`}${F}</label>`}).join("")}${$u("Submit","primary")}</form>`:"",l=e.kind==="detail"||e.kind==="list"&&e.detail?`<article class="detail">${ku(e.detail)}</article>`:"",p=e.kind==="grid"?(e.grid??[]).every((m)=>m.cells.length===0):e.rows.length===0,c=e.empty?`<p class="empty"><strong>${E(e.empty.title)}</strong> ${E(e.empty.description)}</p>`:p&&(e.kind==="list"||e.kind==="grid")?`<p class="empty">${E(e.emptyText||"No results")}</p>`:"",u=e.menuBar?`<nav class="menu-bar" aria-label="${E(e.menuBar.tooltip||e.menuBar.title||"Menu")}"><h2>${E(e.menuBar.title||"Menu")}</h2><ul>${e.menuBar.rows.map((m)=>m.kind==="section"?`<li class="menu-section"><strong>${E(m.title)}</strong></li>`:`<li><button type="button" data-menu-id="${E(m.id)}"${m.selected?' class="selected"':""}${m.disabled?" disabled":""}><span class="menu-icon"${m.iconTint?` style="color:${E(m.iconTint)}"`:""}>${E(m.iconLabel||"")}</span><span>${E(m.title)}</span>${m.subtitle?`<small>${E(m.subtitle)}</small>`:""}${Mn("kbd",m.shortcut,t.reservedHint)}${m.kind==="submenu"?" ›":""}</button></li>`).join("")}</ul></nav>`:"",g=e.kind==="menu-bar"?u:e.kind==="form"?d:e.kind==="detail"?l:e.kind==="grid"?`<ul class="grid">${o}</ul>${c}`:l?`<div class="list-split"><div class="list-pane"><ul class="rows">${s}</ul>${c}</div>${l}</div>`:`<ul class="rows">${s}</ul>${c}`,y=`<footer>${vu(t.context,e.title)}${Su(n)}<span class="footer-hints">${e.primary.enabled?To(e.primary.title,e.primary.shortcut||"↵","primary"):""}${To("Actions",t.actionsKey??"⌘K","actions")}</span></footer>`,S='<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>';return`<main data-kind="${E(e.kind)}" data-loading="${e.loading?"true":"false"}" aria-busy="${e.loading?"true":"false"}"><header><h1>${E(e.title)}</h1><div class="search-line">${'<button type="button" class="back-key" data-footer="back" title="Back (Esc)"><span aria-hidden="true">←</span><span class="visually-hidden">Back</span></button>'}${Ru(t.context)}${r}</div></header>${g}${a}${i}${y}${Iu(e,t)}</main>`}var Mo="blast-web-styles";function Au(e){if(e.getElementById(Mo))return;let t=e.createElement("style");t.id=Mo,t.textContent=Co,e.head.prepend(t)}var Nu=(e)=>e instanceof HTMLElement?e.closest("[data-field]"):null;function Bo(e,t,n={}){if(Au(e.ownerDocument),e.classList.add("blast-web"),typeof n.theme==="string")e.dataset.theme=n.theme;else if(n.theme)for(let[d,l]of Object.entries(n.theme))e.style.setProperty(d,l);if(!e.hasAttribute("tabindex"))e.tabIndex=0;let r,s=(d)=>{if(!r)return;let l=d.target,p=l instanceof HTMLTextAreaElement;if(d.key==="ArrowDown")t({type:"move",direction:"down"});else if(d.key==="ArrowUp")t({type:"move",direction:"up"});else if(d.key==="Enter"&&(d.metaKey||d.ctrlKey))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if(d.key==="Enter"&&!p&&!(l instanceof HTMLButtonElement))t(r.kind==="form"?{type:"submit"}:{type:"primary"});else if((d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k")t({type:r.actions.open?"closeActions":"openActions"});else if(d.key==="Escape")if(!r.actions.open&&!r.dropdown?.open&&r.search.text)t({type:"search",text:""});else t({type:"back"});else return;d.preventDefault()},o=(d)=>{let l=d.target,p=Nu(l);if(l.id==="search")t({type:"search",text:l.value});else if(l.id==="action-search")t({type:"actionsQuery",text:l.value});else if(l.hasAttribute("data-dropdown-search"))t({type:"dropdownQuery",text:l.value});else if(p?.dataset.field)t(l.type==="checkbox"?{type:"toggle",id:p.dataset.field}:{type:"setValue",id:p.dataset.field,value:l.value})},i=(d)=>{let l=d.target,p=l.closest("[data-footer]")?.dataset.footer;if(p==="primary")return t({type:"primary"});if(p==="actions")return t({type:"openActions"});if(p==="back")return t({type:"back"});if(l.closest("[data-dropdown-open]"))return t({type:"openDropdown"});let c=l.closest("[data-action-index]");if(c&&r?.actions.open){let g=Number(c.dataset.actionIndex)-r.actions.selectedIndex;for(let y=0;y<Math.abs(g);y++)t({type:"move",direction:g>0?"down":"up"});return t({type:"primary"})}let u=l.closest("[data-id], [data-menu-id]");if(u)t({type:"select",id:u.dataset.id??u.dataset.menuId??""})},a=(d)=>{d.preventDefault(),t({type:"submit"})};e.addEventListener("keydown",s),e.addEventListener("input",o),e.addEventListener("click",i),e.addEventListener("submit",a);let f=(d)=>{let l=e.contains(document.activeElement)?document.activeElement:void 0,p=l?.id||l?.dataset.field,c=l?[l.selectionStart,l.selectionEnd]:void 0;d();let u=(p?e.querySelector(`#${CSS.escape(p)}, [data-field="${p}"]`):null)??(l?null:e.querySelector("#search"));if(!u)return;if(u.focus({preventScroll:!0}),c?.[0]!=null&&c[1]!=null)u.setSelectionRange?.(c[0],c[1])};return{draw(d,l){if("type"in d&&d.type==="loading"){r=void 0,e.innerHTML='<p role="status" aria-busy="true"></p>',e.firstElementChild.textContent=l.text||"Loading extension…";return}if("type"in d&&d.type==="error"){r=void 0,e.innerHTML='<p role="alert" data-blast-error></p>',e.firstElementChild.textContent=d.message;return}r=d,f(()=>{e.innerHTML=Po(r,{status:l,...n.actionsKey?{actionsKey:n.actionsKey}:{}})})},destroy(){e.removeEventListener("keydown",s),e.removeEventListener("input",o),e.removeEventListener("click",i),e.removeEventListener("submit",a),e.classList.remove("blast-web"),e.replaceChildren()}}}function Gt(e){let t=e.trim();if(!t)throw Error("Enter a GitHub extension URL or name");if(!t.includes("://")){if(t.includes("/")||t.includes("\\"))throw Error("Extension names cannot contain a path separator");return{kind:"github",owner:"raycast",repo:"extensions",ref:"main",path:`extensions/${t}`}}let n;try{n=new URL(t)}catch{throw Error("Invalid extension URL")}if(n.protocol!=="https:"||n.hostname!=="github.com")throw Error("Extension URL must use https://github.com");let r=n.pathname.split("/").filter(Boolean);if(r[2]!=="tree"||r.length<5)throw Error("GitHub URL must be /<owner>/<repo>/tree/<ref>/<path>");let[s,o,,i,...a]=r;if(!s||!o||!i||a.length===0)throw Error("GitHub URL must include an extension path");return{kind:"github",owner:s,repo:o,ref:i,path:a.join("/")}}function Wt(e){return/\.(?:cjs|css|html?|js|jsx|json|md|mjs|ts|tsx|txt|yaml|yml)$/i.test(e)}function Fo(e,t){return t&&e.owner==="raycast"&&e.repo==="extensions"}var Ou=(e)=>e.split("/").map((t)=>encodeURIComponent(t)).join("/"),jo=(e)=>e.status===403&&e.headers.get("x-ratelimit-remaining")==="0";function Bn(e){return/^raycast\/extensions\/([^/]+)$/.exec(e.trim())?.[1]??e}async function _o(e,t={}){let n=t.fetch??((l,p)=>fetch(l,p)),r=Gt(Bn(e)),s=new Map,o=async(l,p)=>{let c=await n(p);if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to fetch ${l} (${c.status})`)}let u=new Uint8Array(await c.arrayBuffer());s.set(`/${l}`,Wt(l)?new TextDecoder().decode(u):u)},i=r.path,a=[];if(Fo(r,t.fixturesUrl!==void 0)){let l=`${t.fixturesUrl}${encodeURIComponent(r.path.replace(/^extensions\//,""))}`,p=await n(`${l}/__files`).catch(()=>{return});if(p?.ok){a=await p.json(),i=r.path.replace(/^extensions\//,"");for(let c of a)await o(c,`${l}/${c}`)}}if(a.length===0){let l=async(p)=>{let c=await n(`https://api.github.com/repos/${encodeURIComponent(r.owner)}/${encodeURIComponent(r.repo)}/contents/${Ou(p)}?ref=${encodeURIComponent(r.ref)}`,{headers:{Accept:"application/vnd.github+json"}});if(!c.ok){if(jo(c))throw Error("GitHub API rate limit reached; try again later or use a local fixture");throw Error(`Unable to list GitHub extension files (${c.status})`)}let u=await c.json(),g=[];for(let y of u){if(!y.path||y.path.split("/").includes("node_modules"))continue;if(y.type==="dir")g.push(...await l(y.path));else if(y.type==="file")g.push(y.path.slice(r.path.length+1))}return g};if(a=await l(r.path),!a.includes("package.json"))throw Error("Extension package.json was not found");for(let p of a)await o(p,`https://raw.githubusercontent.com/${r.owner}/${r.repo}/${encodeURIComponent(r.ref)}/${r.path}/${p}`)}let f=JSON.parse(String(s.get("/package.json"))),d=s.get("/package-lock.json");return{files:s,manifest:f,root:i,...typeof d==="string"?{lockfile:d}:{}}}function Vo(e,t){for(let n of["tsx","ts","jsx","js"]){let r=`/src/${t}.${n}`;if(e.has(r))return r}if(e.has("/src/index.tsx"))return"/src/index.tsx";throw Error(`Command source not found for ${t}`)}function Fn(e){let t=e.commands;return Array.isArray(t)?t.flatMap((n)=>typeof n?.name==="string"?[n.name]:[]):[]}function jn(){let e;try{e=globalThis.localStorage}catch{}return{...e?{storage:e}:{},clipboard:{readText:()=>navigator.clipboard.readText(),writeText:(t)=>navigator.clipboard.writeText(t)},openUrl:(t)=>{if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer")}}}class Uo extends Error{code="BROWSER_LAUNCH_TIMEOUT";stage;constructor(e,t){super(`Command did not start (${t}) after ${e} ms`);this.name="BrowserLaunchTimeoutError",this.stage=t}}function _n(e,t,n="waiting for runtime port"){return new Promise((r,s)=>{let o=setTimeout(()=>s(new Uo(t,n)),t);e.then((i)=>{clearTimeout(o),r(i)},(i)=>{clearTimeout(o),s(i)})})}function Do(){let e=0;return{next:()=>++e,current:()=>e,isCurrent:(t)=>t===e}}var Cu=["appPicker","checkbox","dropdown","password","textfield","file","directory"];function it(e,t="Preferences"){if(e===void 0)return[];if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((n,r)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} entry ${r+1} must be an object`);let s=n,{name:o,type:i,default:a,description:f,placeholder:d,label:l}=s;if(typeof o!=="string"||!o)throw Error(`${t} entry ${r+1} needs a name`);if(typeof i!=="string"||!Cu.includes(i))throw Error(`Preference ${JSON.stringify(o)} has an unknown type ${JSON.stringify(i)}`);if(a!==void 0&&typeof a!=="string"&&typeof a!=="boolean"&&!(typeof a==="number"&&Number.isFinite(a)))throw Error(`Preference ${JSON.stringify(o)} needs a scalar "default"`);if(f!==void 0&&typeof f!=="string")throw Error(`Preference ${JSON.stringify(o)} needs a string "description"`);return{name:o,type:i,title:(i==="checkbox"?l:s.title)||o,required:s.required===!0,data:Array.isArray(s.data)?s.data.filter((p)=>!!p&&typeof p==="object"&&typeof p.value==="string"&&typeof p.title==="string"):[],...typeof f==="string"?{description:f}:{},...typeof d==="string"?{placeholder:d}:{},...typeof l==="string"?{label:l}:{},...a===void 0?{}:{default:a}}})}function Ht(e,t){return[...new Map([...e,...t].map((n)=>[n.name,n])).values()]}function qo(e,t){return Object.fromEntries(Ht(e,t).filter((n)=>n.default!==void 0).map((n)=>[n.name,n.default]))}function Vn(e,t){return e.filter((n)=>n.required&&n.default===void 0&&(t[n.name]===void 0||t[n.name]===""))}function Un(e,t){return`${e}/${t}`}function Dn(e){if(!e||typeof e!=="object")throw Error("Invalid browser bundle index");let t=e;if(typeof t.buildSha!=="string"||!t.bundles||typeof t.bundles!=="object")throw Error("Invalid browser bundle index shape");let n=t.runtime,r;if(n!==void 0){if(!n||typeof n!=="object")throw Error("Invalid runtime bundle");let o=n;if(o.path!=="bundles/runtime.js"||typeof o.bytes!=="number"||!Number.isInteger(o.bytes)||typeof o.sha256!=="string"||!/^[0-9a-f]{64}$/.test(o.sha256))throw Error("Invalid runtime bundle");r={path:o.path,bytes:o.bytes,sha256:o.sha256}}let s={};for(let[o,i]of Object.entries(t.bundles)){if(!i||typeof i!=="object")throw Error(`Invalid bundle entry: ${o}`);let a=i;if(typeof a.path!=="string"||!/^bundles\/[^/]+\/[^/]+\.js$/.test(a.path)||typeof a.bytes!=="number"||!Number.isInteger(a.bytes)||a.bytes<0||typeof a.sha256!=="string"||!/^[0-9a-f]{64}$/.test(a.sha256))throw Error(`Invalid bundle entry shape: ${o}`);let f={};if(a.files!==void 0){if(!a.files||typeof a.files!=="object")throw Error(`Invalid bundle files: ${o}`);for(let[l,p]of Object.entries(a.files)){if(!p||typeof p!=="object")throw Error(`Invalid bundle file: ${o}/${l}`);let c=p;if(typeof c.path!=="string"||!c.path.startsWith("bundles/")||typeof c.bytes!=="number"||!Number.isInteger(c.bytes)||c.bytes<0||typeof c.sha256!=="string"||!/^[0-9a-f]{64}$/.test(c.sha256))throw Error(`Invalid bundle file shape: ${o}/${l}`);f[l]={path:c.path,bytes:c.bytes,sha256:c.sha256}}}let d;if(a.manifest!==void 0){if(!a.manifest||typeof a.manifest!=="object")throw Error(`Invalid bundle manifest: ${o}`);let l=a.manifest;if(typeof l.name!=="string"||!l.commands||typeof l.commands!=="object")throw Error(`Invalid bundle manifest shape: ${o}`);let p={},c={},u=l.modes;if(u!==void 0&&(!u||typeof u!=="object"))throw Error(`Invalid bundle manifest modes: ${o}`);for(let[S,m]of Object.entries(u??{})){if(m!=="view"&&m!=="no-view"&&m!=="menu-bar"&&m!=="model-provider")throw Error(`Invalid bundle manifest mode: ${o}/${S}`);c[S]=m}for(let[S,m]of Object.entries(l.commands))p[S]=it(m,`Bundle ${o} command ${S} preferences`);for(let S of Object.keys(p))c[S]??="view";let g={},y=l.arguments;if(y!==void 0&&(!y||typeof y!=="object"))throw Error(`Invalid bundle manifest arguments: ${o}`);for(let[S,m]of Object.entries(y??{})){if(!Array.isArray(m))throw Error(`Invalid bundle manifest arguments: ${o}/${S}`);g[S]=m.map((R)=>{let A=R;if(!A||typeof A.name!=="string"||typeof A.required!=="boolean")throw Error(`Invalid bundle manifest argument: ${o}/${S}`);return{name:A.name,required:A.required}})}d={name:l.name,preferences:it(l.preferences,`Bundle ${o} preferences`),commands:p,...Object.keys(g).length?{arguments:g}:{},...Object.keys(c).length?{modes:c}:{}}}s[o]={path:a.path,bytes:a.bytes,sha256:a.sha256,...Object.keys(f).length?{files:f}:{},...d?{manifest:d}:{}}}return{buildSha:t.buildSha,bundles:s,...r?{runtime:r}:{}}}async function Xt(e){let t=await globalThis.crypto.subtle.digest("SHA-256",e);return[...new Uint8Array(t)].map((n)=>n.toString(16).padStart(2,"0")).join("")}async function qn(e,t,n,r){let s=e?.bundles[n];return Boolean(s&&t===e?.buildSha&&s.bytes===r.byteLength&&await Xt(r)===s.sha256)}var Hn=()=>globalThis.location?.href,Gn=new Map,Wn=new Map,Go=(e)=>`${e.bundlesUrl}
|
|
32
|
+
${e.buildUrl??""}`,Wo=(e,t)=>new URL(e,new URL(t.bundlesUrl,Hn()));async function Ho(e,t){let n=await fetch(Wo(e.path,t));if(!n.ok)return;let r=await n.arrayBuffer();if(r.byteLength!==e.bytes||await Xt(r)!==e.sha256)return;return r}function Xo(e){let t=Go(e),n=Gn.get(t);if(!n)n=(async()=>{let[r,s]=await Promise.all([fetch(new URL(e.bundlesUrl,Hn())),e.buildUrl?fetch(new URL(e.buildUrl,Hn())):null]);if(!r.ok||s&&!s.ok)return;let o=Dn(await r.json());if(s){if((await s.json()).sha!==o.buildSha)return}return o})().catch(()=>{return}),n.then((r)=>r??Gn.delete(t)),Gn.set(t,n);return n}function Jo(e){let t=Go(e),n=Wn.get(t);if(!n)n=(async()=>{let r=await Xo(e),s=r?.runtime?await Ho(r.runtime,e):void 0;return s?new TextDecoder().decode(s):void 0})().catch(()=>{return}),n.then((r)=>r??Wn.delete(t)),Wn.set(t,n);return n}function Tu(e){try{let t=Gt(Bn(e)),[n,r,...s]=t.path.split("/");return t.owner==="raycast"&&t.repo==="extensions"&&n==="extensions"&&r&&s.length===0?r:void 0}catch{return}}async function Ko(e,t,n){try{let r=Tu(t),s=r?await Xo(e):void 0;if(!r||!s)return;let o=Un(r,n),i=s.bundles[o];if(!i?.manifest)return;let a=await fetch(Wo(i.path,e));if(!a.ok)return;let f=await a.arrayBuffer();if(!await qn(s,s.buildSha,o,f))return;let d=new Map;for(let[l,p]of Object.entries(i.files??{})){let c=await Ho(p,e);if(!c)return;d.set(`/${l}`,Wt(l)?new TextDecoder().decode(c):new Uint8Array(c))}return{code:new TextDecoder().decode(f),files:d,manifest:i.manifest}}catch{return}}function Lu(e){return typeof e==="object"&&e!==null&&e.type==="blast-port-request"}function zo(e,t,n,r){return!n&&e===t&&Lu(r)}var at,Pu=()=>new URL("./",import.meta.url),Jt=(e,t)=>new URL(t,e.assetsUrl?new URL(e.assetsUrl,globalThis.location?.href):Pu()).toString(),Yo=(e)=>[e.sandboxUrl,Jt(e,"./"),e.bundlesUrl,e.buildUrl].join(`
|
|
33
|
+
`);function $t(e){try{e?.terminate?.()}catch{}e?.iframe?.remove()}async function Qo(e,t){let n=await import(Jt(e,"almostnode.mjs")),r=await n.createRuntime(new n.VirtualFS,{sandbox:e.sandboxUrl});r.iframe?.setAttribute("data-blast",t);try{let s=e.bundlesUrl?await Jo({bundlesUrl:e.bundlesUrl,buildUrl:e.buildUrl}):void 0;if(s)await r.execute(`${s}
|
|
34
|
+
module.exports = null;`,"/runtime.cjs")}catch(s){throw $t(r),s}return r}function Mu(e){let t=Yo(e);if(at?.key===t)return;let n=at;at={key:t,runtime:Qo(e,"warm").catch(()=>{return})},n?.runtime.then($t)}async function Zo(e){if(at?.key===Yo(e)){let t=at.runtime;at=void 0;let n=await t;if(n)return n.iframe?.setAttribute("data-blast","session"),n}return Qo(e,"session")}var ei=new WeakSet,ti=30000,Bu="/packages/web/sandbox/runtime-entry.ts",Fu=()=>{let e=navigator.platform||"";if(/mac|iphone|ipad/i.test(e))return"macOS";return/win/i.test(e)?"Windows":"Linux"},ni=(e)=>e==="no-view"||e==="menu-bar"||e==="model-provider"?e:"view";function ju(e,t,n){let s=(Array.isArray(e.commands)?e.commands:[]).find((o)=>o?.name===t);return{extensionName:String(e.name??n),commands:Fn(e),extensionPreferences:it(e.preferences,"Extension preferences"),commandPreferences:it(s?.preferences,`Command ${t} preferences`),mode:ni(s?.mode),...typeof s?.title==="string"?{title:s.title}:{}}}function _u(e,t){return{extensionName:e.name,commands:Object.keys(e.commands),extensionPreferences:e.preferences,commandPreferences:e.commands[t]??[],mode:ni(e.modes?.[t])}}function Kt(e,t){let n=t.source??t.extension;if(!n)throw TypeError("mount requires extension or source");let r=n;if(!t.sandboxUrl)throw TypeError("mount requires sandboxUrl");let s=(N)=>Jt(t,N),o={...jn(),...t.handlers},i=Do(),a=new Set,f=Fu(),d=!1,l={text:"Loading extension…",progress:!0},p,c,u,g,y,S,m="view",R=r,A=(N)=>{if(d)return;if(p){let M=p.input(N);return re(M),M}if(!c)return;let j=c.input(N);for(let M of j.effects)if(M.type==="launch")de(M.command);return{events:[],effects:[]}},_=t.render?void 0:Bo(e,(N)=>void A(N),{...t.theme===void 0?{}:{theme:t.theme},actionsKey:f==="macOS"?"⌘K":"Ctrl+K"}),F=(N)=>{if(d)return;if(t.render)t.render(N,A,{...S?{scene:S}:{},status:l});else _?.draw(N,l)},U=(N,j=!1,M=!1)=>{l={text:N,...j?{error:j}:{},...M?{progress:M}:{}},t.onStatus?.(l)};function re(N){for(let j of N.events)u?.postMessage({type:"event",node:j.node,handler:j.handler,args:j.args});for(let j of N.effects)if(j.type==="quit"){if(m!=="no-view")Pe("quit")}else{let M=i.current(),V=setTimeout(()=>{if(a.delete(V),!i.isCurrent(M)||!p)return;re(p.tick(j.token))},j.ms);a.add(V)}}function ue(){i.next();for(let N of a)clearTimeout(N);a.clear(),y?.(),y=void 0,u?.close(),u=void 0,p=void 0,S=void 0,$t(g),g=void 0}function Pe(N){let j=p?.view();if(ue(),t.onExit)t.onExit({reason:N,...j?{view:j}:{}});else if(c)c.reset(),F(c.view()),U("Ready");else if(j)U("Command finished")}function Ie(N){if(d)return;let j=N instanceof Error?N.message:String(N);if(ue(),U(j,!0),c)c.fail("Command failed",j),F(c.view());else F({type:"error",message:j})}let se,Ke=async()=>{if(typeof t.esbuild==="function")return t.esbuild();if(t.esbuild)return t.esbuild;if(se??=await import(s("esbuild.mjs")),!ei.has(se))ei.add(se),await se.initialize({wasmURL:s("esbuild.wasm"),worker:!1});return se},D,K=()=>D??=_o(r,{fixturesUrl:t.fixtures?s("fixtures/"):void 0});async function Ve(N,j,M,V){if(!t.preferenceForm)return;let G=Ln(N.extensionName,o.storage),X=M==="extension"?N.extensionPreferences:Ht(N.extensionPreferences,N.commandPreferences),pe=await t.preferenceForm({extension:N.extensionName,command:j,scope:M,fields:X,values:V});if(!pe)return;let $e=new Set(N.extensionPreferences.map((ge)=>ge.name)),Ne={},z={};for(let[ge,Me]of Object.entries(pe))($e.has(ge)?Ne:z)[ge]=Me;return G.update(Ne,j,z),pe}async function de(N){ue();let j=i.current(),M=()=>!d&&i.isCurrent(j);try{U("Fetching extension…",!1,!0),F({type:"loading",extension:r,command:N});let V=t.bundlesUrl?await Ko({bundlesUrl:t.bundlesUrl,buildUrl:t.buildUrl},r,N):void 0;if(!M())return;let G,X,pe,$e;if(V)G=V.files,X=_u(V.manifest,N),pe=`/src/${N}.tsx`,$e=V.code;else{let k=await K();if(!M())return;G=k.files,X=ju(k.manifest,N,r),pe=Vo(k.files,N),U("Installing…",!1,!0);let P=await(await fetch(s("blast-sources.json"))).json(),H=await Ro({fetch:(Y,be)=>fetch(Y,be),manifest:k.manifest,...k.lockfile===void 0?{}:{lockfile:k.lockfile}});if(!M())return;U("Bundling…",!1,!0);let q=await Ke();if(!M())return;let ee=new Map(Object.entries(P));for(let[Y,be]of k.files)ee.set(Y,be);if($e=(await Rr({esbuild:q,files:ee,packages:H.packages,command:pe,runtimeEntry:Bu,aliases:vo})).code,!M())return}R=X.extensionName,m=X.mode;let Ne=Ln(R,o.storage),z={...qo(X.extensionPreferences,X.commandPreferences),...Ne.values(N),...t.preferences},ge=Ht(X.extensionPreferences,X.commandPreferences),Me=Vn(ge,z);if(Me.length>0){if(!t.preferenceForm)throw Error(`Missing required preferences: ${Me.map((P)=>P.title||P.name).join(", ")}`);let k=await Ve(X,N,"command",z);if(!M()||!k)return;if(z={...z,...k},Vn(ge,z).length)throw Error("Required preferences are missing");U("Fetching extension…",!1,!0),F({type:"loading",extension:r,command:N})}U("Starting…",!1,!0);let Be=await Zo(t);if(!M()){$t(Be);return}g=Be;let kt=R.replace(/[^A-Za-z0-9._-]/gu,"_")||"extension",ct=`/blast/support/${kt}`,Ue=`/blast/assets/${kt}`,Oe=Be.getVFS();Oe.mkdirSync(ct,{recursive:!0}),Oe.mkdirSync(Ue,{recursive:!0}),Oe.writeFileSync(`${ct}/.keep`,""),Oe.writeFileSync(`${Ue}/.keep`,"");for(let[k,P]of G){if(k.includes("/node_modules/"))continue;let H=k.startsWith("/assets/")?k.slice(8):k.startsWith("/src/")?/\.(?:cjs|css|html?|js|jsx|mjs|ts|tsx)$/iu.test(k)?void 0:k.slice(5):k.replace(/^\//u,"");if(!H)continue;let q=`${Ue}/${H}`;if(Oe.mkdirSync(q.slice(0,q.lastIndexOf("/")),{recursive:!0}),Oe.writeFileSync(q,P),k==="/package.json")Oe.writeFileSync("/blast/assets/package.json",P)}let lt={extensionName:R,commandName:N,source:r},ut=Oo({catalog:{extensions:[{name:R,commands:X.commands.map((k)=>({name:k}))}]},...o.storage?{storage:o.storage}:{},...o.clipboard?{clipboard:o.clipboard}:{},...o.openUrl?{openUrl:o.openUrl}:{},status:(k,P)=>U(k,P===!0),launchCommand:async(k,P)=>{de(P)},openPreferences:(k)=>{if(!t.preferenceForm){U("Preferences are not available in this embed",!0);return}Ve(X,N,k,{...z}).then((P)=>{if(P&&M())de(N)})}}),St=async(k)=>{let H=await o.capability?.(k,lt)??await ut(k,lt);if(!M())return;if(u?.postMessage({type:"capability.result",id:k.id,...H}),!H.ok)U(H.error.message,!0)},Rt=new MessageChannel;u=Rt.port1,u.start();let ze,zt=(k)=>{if(!M())return;if(k.type==="scene"){if(!p)return;S=k;let P=p.scene(k);if(ze)U("Ready");ze?.resolve(),ze=void 0,F(p.view()),re(P)}else if(k.type==="capability.request")St(k).catch((P)=>{if(!M())return;let H=P instanceof Error?P.message:String(P);u?.postMessage({type:"capability.result",id:k.id,ok:!1,error:{code:"DENIED",message:H}}),U(H,!0)});else if(k.type==="exit")if(k.code===0)Pe("exit");else Ie(Error(`Command exited with code ${k.code}`));else if(k.type==="error")Ie(Error(k.message))};u.addEventListener("message",(k)=>zt(k.data));let De=!1,dt,h=new Promise((k)=>dt=k),b=(k)=>{if(!M())return;let P=Be.iframe?.contentWindow??void 0;if(!zo(k.source,P,De,k.data))return;De=!0,y?.(),P?.postMessage({type:"blast-port"},"*",[Rt.port2]),dt()};if(window.addEventListener("message",b),y=()=>window.removeEventListener("message",b),await _n((async()=>{if(await Be.execute(`${$e}
|
|
35
|
+
module.exports = null;`,`${Ue}/bundle.cjs`),M())await h})(),ti,"waiting for runtime port"),!M()||!De)return;let w=t.commandTitle??X.title;p=cn({platform:f,...w?{fallbackTitle:w}:{}});let C=p;C.subscribe((k)=>{if(M()&&p===C)F(k)});let B=new Promise((k,P)=>ze={resolve:k,reject:P});u.postMessage({type:"init",protocol:1,command:{extension:R,name:N,entry:pe,mode:m},preferences:{...z},environment:{extensionName:R,commandName:N,ownerOrAuthorName:"Browser",assetsPath:Ue,supportPath:ct,isDevelopment:!1,appearance:t.theme==="light"?"light":"dark",textSize:"medium"}}),await _n(B,ti,"waiting for first scene")}catch(V){if(M())Ie(V)}}return(async()=>{try{if(U("Fetching extension…",!1,!0),F({type:"loading",extension:r,...t.command?{command:t.command}:{}}),!t.root){let V=t.command??Fn((await K()).manifest)[0];if(!d)await de(V??"index");return}let N=(await K()).manifest;if(d)return;R=String(N.name??r);let M=(Array.isArray(N.commands)?N.commands:[]).flatMap((V)=>typeof V?.name==="string"?[{extension:R,extensionTitle:String(N.title??R),command:V.name,title:typeof V.title==="string"?V.title:V.name,...typeof V.subtitle==="string"?{subtitle:V.subtitle}:{},mode:V.mode==="no-view"||V.mode==="menu-bar"?V.mode:"view"}]:[]);c=Sr(M),c.subscribe((V)=>{if(!p)F(V)}),U("Ready"),F(c.view())}catch(N){Ie(N)}})(),{input:A,view:()=>p?.view(),close(){if(d)return;ue(),d=!0,_?.destroy()}}}function Vu(e="blast-extension"){if(customElements.get(e))return;customElements.define(e,class extends HTMLElement{#e;connectedCallback(){let t={sandboxUrl:this.getAttribute("sandbox-url")??"/sandbox/",root:this.hasAttribute("root"),fixtures:this.hasAttribute("fixtures")};for(let[n,r]of[["extension","extension"],["source","source"],["command","command"],["assets-url","assetsUrl"],["theme","theme"]]){let s=this.getAttribute(n);if(s)t[r]=s}this.#e=Kt(this,t)}disconnectedCallback(){this.#e?.close(),this.#e=void 0}})}function qf(e,t){if(!e)throw TypeError("mount requires an element");return Kt(e,t)}export{Je as BrowserInstallError,xo as BrowserIntegrityError,ln as BrowserMissingDependencyError,ft as BrowserMissingFileError,un as BrowserNativeModuleError,ko as BrowserNativePackageError,$o as BrowserPackageLimitError,Et as BrowserResolutionError,Eo as BrowserSizeLimitError,On as BrowserTarPathError,Yi as browserBuiltinModules,Rr as bundleForBrowser,Un as bundleKey,qn as bundleMatches,jn as createDefaultHandlers,Vu as defineBlastExtension,Ro as installForBrowser,qf as mount,Dn as parseBundleIndex,Mu as prewarm,Xt as sha256Hex,yu as unpackTar};
|