forge-terminal 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/chunks/{about-credits-VZQJAWG3.js → about-credits-DBQHH5HA.js} +1 -1
- package/dist/chunks/{args-FZXEZBPA.js → args-TZMA4ZR6.js} +1 -1
- package/dist/chunks/{boot-NYKO3NLR.js → boot-E57BKWEC.js} +1 -1
- package/dist/chunks/{chunk-TARDT6LZ.js → chunk-3CLPUPJT.js} +1 -1
- package/dist/chunks/chunk-3GHHQNR6.js +3 -0
- package/dist/chunks/{chunk-KMLT45OJ.js → chunk-4YFFT5CZ.js} +2 -2
- package/dist/chunks/{chunk-XPATZLEH.js → chunk-5IZBFF6Y.js} +1 -1
- package/dist/chunks/{chunk-63ZZRDSV.js → chunk-5YUOG3A5.js} +1 -1
- package/dist/chunks/{chunk-GT6U6HV3.js → chunk-6LMVOQQA.js} +1 -1
- package/dist/chunks/chunk-6RMRWBMB.js +3 -0
- package/dist/chunks/{chunk-R24JCIZ5.js → chunk-7VR6LODN.js} +1 -1
- package/dist/chunks/{chunk-RK3WGALB.js → chunk-AFEYLHDD.js} +1 -1
- package/dist/chunks/{chunk-ZFLFBNIK.js → chunk-AIINYKXW.js} +1 -1
- package/dist/chunks/{chunk-LA5JVBFP.js → chunk-E2BYNETT.js} +1 -1
- package/dist/chunks/{chunk-DYIATUFE.js → chunk-EPDF4NQI.js} +1 -1
- package/dist/chunks/{chunk-W2QJA73Q.js → chunk-EURVTBPH.js} +1 -1
- package/dist/chunks/{chunk-IVBSXPNS.js → chunk-FLMQ5VFR.js} +1 -1
- package/dist/chunks/{chunk-K6ERQTUQ.js → chunk-IE6NFN3N.js} +1 -1
- package/dist/chunks/{chunk-IED6VBE6.js → chunk-IJRLRAC5.js} +1 -1
- package/dist/chunks/{chunk-XUKYIVJC.js → chunk-IKZTH2RL.js} +1 -1
- package/dist/chunks/{chunk-J2UQI544.js → chunk-ITJZ7ODJ.js} +2 -2
- package/dist/chunks/chunk-MNI6IKIU.js +3 -0
- package/dist/chunks/{chunk-CW2Y2KDQ.js → chunk-N3X3H4IZ.js} +1 -1
- package/dist/chunks/{chunk-RXI6QLNY.js → chunk-NHMACTW3.js} +1 -1
- package/dist/chunks/{chunk-ITW5FG4K.js → chunk-QPJ2LNXB.js} +1 -1
- package/dist/chunks/{chunk-JGJU3AW5.js → chunk-TDYKRRZH.js} +1 -1
- package/dist/chunks/chunk-TFOEI5VF.js +3 -0
- package/dist/chunks/{chunk-2AFHW44W.js → chunk-Z2H2GT2X.js} +2 -2
- package/dist/chunks/{chunk-GRWOJKQB.js → chunk-ZYIW4MAG.js} +1 -1
- package/dist/chunks/clip-command-QPLYCGJ2.js +3 -0
- package/dist/chunks/{colour-LMZO2EE6.js → colour-PZOAKNTH.js} +1 -1
- package/dist/chunks/{entry-TV4FJQDR.js → entry-REXB6JNP.js} +2 -2
- package/dist/chunks/execute-GKO4THUK.js +3 -0
- package/dist/chunks/{extensions-4UJRQ32J.js → extensions-UV4X2UUA.js} +1 -1
- package/dist/chunks/{extensions-command-VROVGVD4.js → extensions-command-TLW53BUK.js} +1 -1
- package/dist/chunks/{ffmpeg-OIVMTPY7.js → ffmpeg-32EEMAZS.js} +1 -1
- package/dist/chunks/{image-J5WDYORX.js → image-YMCS4PTS.js} +1 -1
- package/dist/chunks/{install-5XLVERRR.js → install-7ZRVQKCF.js} +1 -1
- package/dist/chunks/launch-IVBMNYNY.js +17 -0
- package/dist/chunks/{manager-T3WDLUKR.js → manager-XPO4ZIRY.js} +1 -1
- package/dist/chunks/{needed-YU5BPYD6.js → needed-NOGBHTHE.js} +1 -1
- package/dist/chunks/{notify-LTV7F634.js → notify-YEBP67MP.js} +1 -1
- package/dist/chunks/{own-OJAQ5FRQ.js → own-G4G4MRGM.js} +1 -1
- package/dist/chunks/{pdfium-7HNCQ3K3.js → pdfium-BAMNBCNW.js} +1 -1
- package/dist/chunks/{preset-command-VP5RAXBG.js → preset-command-XXKLUJOS.js} +1 -1
- package/dist/chunks/{registry-E5PNQWOZ.js → registry-PKOPEG3Z.js} +1 -1
- package/dist/chunks/{server-EFNTD7ZW.js → server-AR73FWWG.js} +3 -3
- package/dist/chunks/{theme-NF3LQHPV.js → theme-D4AMWFFW.js} +1 -1
- package/dist/chunks/{transcribe-CQFHXBTV.js → transcribe-EFVJPBPG.js} +1 -1
- package/dist/chunks/{transcribe-command-ZXB3JJFZ.js → transcribe-command-Q4J3WTOB.js} +1 -1
- package/dist/chunks/{update-note-CJ5XYKYH.js → update-note-2YR3TLPK.js} +1 -1
- package/dist/chunks/{watch-command-ZNMO4SF7.js → watch-command-2D7NLDAM.js} +1 -1
- package/dist/index.js +6 -6
- package/package.json +7 -11
- package/dist/chunks/chunk-M6LYLTFH.js +0 -3
- package/dist/chunks/chunk-SNFUGJ3M.js +0 -3
- package/dist/chunks/chunk-T37DEXUI.js +0 -3
- package/dist/chunks/chunk-ZHNPBRCX.js +0 -3
- package/dist/chunks/clip-command-SLSAWJF4.js +0 -3
- package/dist/chunks/execute-NEDE4JM6.js +0 -3
- package/dist/chunks/launch-5JMWS5CI.js +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
3
|
import{b as C}from"./chunk-Q7ERPAG3.js";import{c as Q}from"./chunk-YK26E3OX.js";import{a as h,b as q,c as A}from"./chunk-MF3KKEFB.js";import{a as k,b as F,c as K,d as M,e as V,f as x,g as O}from"./chunk-I25E2XDH.js";import"./chunk-HON4OV7M.js";import{p as H,q as $}from"./chunk-BIBDLXCG.js";import{E as G,K as g,L as X,R as v,S as N,a as U}from"./chunk-CVNYUROW.js";import{a as D}from"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";import{createHash as ie,randomBytes as se}from"node:crypto";import{createReadStream as Ee,createWriteStream as Se}from"node:fs";import{chmod as Pe,copyFile as Ne,mkdir as ne,readdir as I,readFile as ae,rm as y,rmdir as ce,stat as fe,statfs as $e,writeFile as ue}from"node:fs/promises";import{release as ke}from"node:os";import{join as a}from"node:path";import{Readable as Oe,Transform as Ae}from"node:stream";import{pipeline as Be}from"node:stream/promises";import{gunzip as Ie}from"node:zlib";import{mkdir as Y,writeFile as pe}from"node:fs/promises";import{dirname as ge,join as ye,posix as be,resolve as Z,sep as ve}from"node:path";var E=512;function S(e,t,n){let r=e.indexOf(0,t);return e.toString("utf8",t,r===-1||r>t+n?t+n:r)}function ee(e,t,n){let r=Number.parseInt(S(e,t,n).trim()||"0",8);if(Number.isNaN(r))throw new Error("bad tar header");return r}var xe=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;function T(e){return e.startsWith("/")||e.includes("\\")||e.includes(":")?!0:e.split("/").some(t=>t===".."||xe.test(t)||t!=="."&&t!==""&&(t.endsWith(".")||t.endsWith(" ")))}function W(e,t){let n=Z(e),r=Z(t);return r===n||r.startsWith(n+ve)}async function te(e,t){let n=0,r;for(;n+E<=e.length;){let o=e.subarray(n,n+E);if(o.every(f=>f===0))return;let s=ee(o,124,12),i=ee(o,100,8),d=String.fromCharCode(o[156]??0),p=S(o,345,155),l=p.length>0?`${p}/${S(o,0,100)}`:S(o,0,100);n+=E;let m=e.subarray(n,n+s);if(m.length<s)throw new Error("truncated tar");if(n+=Math.ceil(s/E)*E,d==="L"){r=S(m,0,m.length);continue}if(d==="x"){let f=/(?:^|\n)\d+ path=([^\n]*)\n/.exec(m.toString("utf8"));f?.[1]!==void 0&&(r=f[1]);continue}if(d==="g")continue;r!==void 0&&(l=r,r=void 0);let w=be.normalize(l),u=ye(t,w);if(T(w)||!W(t,u))throw new Error(`unsafe path in archive: ${l}`);if(d==="5")await Y(u,{recursive:!0});else if(d==="0"||d==="\0")await Y(ge(u),{recursive:!0}),await pe(u,m,{mode:i&64?493:420});else throw new Error(`unsupported entry type in archive: ${l}`)}}async function J(e){let t=0;for(let n of await I(e,{withFileTypes:!0}).catch(()=>[])){let r=a(e,n.name);n.isDirectory()?t+=await J(r):n.isFile()&&(t+=(await fe(r).catch(()=>{}))?.size??0)}return t}var at=e=>J(a(h(),e));function Fe(){let e=Number.parseInt(ke(),10);return e>=25?e+1:e-9}function de(e,t=process.platform,n=process.arch){return M.includes(t)?O(e,t)?t!=="darwin"?x(e,t,n)===void 0?{supported:!1,reason:`no build for ${n} ${F(t)}s`}:{supported:!0}:e.minMacos!==void 0&&Fe()<e.minMacos?{supported:!1,reason:`needs macOS ${e.minMacos} or later`}:x(e,t,n)===void 0?{supported:!1,reason:`no build for ${n} Macs`}:{supported:!0}:{supported:!1,reason:`not available on ${K(t)}`}:{supported:!1,reason:"extensions need macOS, Windows or Linux"}}function R(e,t){let n=V(e);if(n!==void 0)return M.includes(t)&&!O(n,t)?void 0:n}function le(e,t){let n=k.filter(r=>R(r.id,t)!==void 0);return G(`${e} is not a known extension.`,`Try one of: ${n.map(r=>r.id).join(", ")}.`)}async function ct(e=process.platform,t=process.arch){return Promise.all(k.filter(n=>O(n,e)).map(async n=>{let r=await A(n.id),o=de(n,e,t),s=x(n,e,t),i={entry:n,updateAvailable:r!==void 0&&s!==void 0&&r.version!==s.version,supported:o.supported};return r!==void 0&&(i.installed=r.version,i.installedBytes=await J(a(h(),n.id))),o.reason!==void 0&&(i.reason=o.reason),o.supported&&s!==void 0&&(i.downloadBytes=s.bytes),i}))}var Me=e=>new Promise((t,n)=>{Ie(e,(r,o)=>r?n(r):t(o))});async function Ce(e){let t=ie("sha256");for await(let n of Ee(e))t.update(n);return t.digest("hex")}async function Te(e,t,n){let r=JSON.parse(await ae(a(e,"manifest.json"),"utf8"));if(r.id!==t.id||r.version!==n)throw new Error("the archive is for a different extension or version");let o=r.files;if(typeof o!="object"||o===null)throw new Error("manifest lists no files");if(r.kind!=="node"&&r.kind!=="exec"||typeof r.entry!="string"||!(r.entry in o))throw new Error("manifest has no valid entry");for(let[s,i]of Object.entries(o)){if(T(s)||!W(e,a(e,s)))throw new Error(`unsafe path ${s}`);if(await Ce(a(e,s)).catch(()=>{})!==i)throw new Error(`${s} does not match the manifest`)}}async function We(e,t,n,r=process.platform){if(r!=="win32"){await $(e,t,r);return}try{await $(e,t,r,void 0,H)}catch{throw g(n,"its files stayed in use (often an antivirus scan) and could not be moved into place.")}}async function Je(e,t){let n=a(e,`.current-${se(4).toString("hex")}`);await ue(n,`${t}
|
|
4
|
-
`),await $(n,a(e,"current"))}function re(e){let t=process.env.FORGE_EXTENSIONS_BASE_URL;return t===void 0||t===""?e:`${t.replace(/\/+$/,"")}/${e.slice(e.lastIndexOf("/")+1)}`}var Re=600*1e3;async function me(e){let t=Date.now()-Re,n=async(r,o)=>{for(let s of await I(r).catch(()=>[])){if(!s.startsWith(o))continue;let i=a(r,s),d=await fe(i).catch(()=>{});d!==void 0&&d.mtimeMs<t&&await y(i,{recursive:!0,force:!0}).catch(()=>{})}};await n(e,".download-");for(let r of k){let o=a(e,r.id);await n(o,".staging-"),await n(o,".current-"),await ce(o).catch(()=>{})}}function oe(e){return e?.code==="ENOSPC"}var B=class extends Error{};async function _e(e,t={}){let{platform:n=process.platform,arch:r=process.arch}=t,o=R(e,n);if(o===void 0)throw le(e,n);await me(h());let s=de(o,n,r),i=x(o,n,r);if(!s.supported||i===void 0){let f=`no build for this ${F(n)}`;throw X(e,s.reason??f,n)}let d=await A(o.id);if(d?.version===i.version)return d;let p=h(),l=a(p,o.id);await ne(l,{recursive:!0});try{let f=await $e(p);if(f.bavail*f.bsize<i.bytes*2.5)throw N(e,`not enough free disk space (about ${D(Math.ceil(i.bytes*2.5))} needed).`)}catch(f){if(U(f))throw f}let m=se(6).toString("hex"),w=a(p,`.download-${m}.tar.gz`),u=a(l,`.staging-${m}`);try{let f=t.fetchImpl??fetch,b;try{b=await f(re(i.url),{signal:t.signal})}catch{throw v(e,`could not reach ${new URL(re(i.url)).host}.`)}if(!b.ok||b.body===null)throw v(e,`the server answered ${b.status}.`);let _=ie("sha256"),P=0,he=new Ae({transform(c,je,z){if(P+=c.length,P>i.bytes)return z(new B);_.update(c),t.onProgress?.(P,i.bytes),z(null,c)}});try{await Be(Oe.fromWeb(b.body),he,Se(w),t.signal?{signal:t.signal}:{})}catch(c){throw t.signal?.aborted?c:c instanceof B?g(e,"the download is larger than its published size."):oe(c)?N(e,"the disk filled up during the download."):v(e,"the connection dropped before the download finished.")}if(P<i.bytes)throw v(e,"the download ended early.");if(_.digest("hex")!==i.sha256)throw g(e,"the download does not match its published checksum.");t.signal?.throwIfAborted();try{if(await ne(u,{recursive:!0}),i.binary===void 0)await te(await Me(await ae(w)),u);else{await Ne(w,a(u,i.binary)),await Pe(a(u,i.binary),493);let c={id:o.id,version:i.version,files:{[i.binary]:i.sha256},entry:i.binary,kind:"exec"};await ue(a(u,"manifest.json"),JSON.stringify(c))}await Te(u,o,i.version)}catch(c){throw oe(c)?N(e,"the disk filled up while unpacking."):g(e,c instanceof Error?c.message:"the archive could not be unpacked.")}t.signal?.throwIfAborted(),await C(o.id);let L=a(l,i.version);await y(L,{recursive:!0,force:!0}),await We(u,L,e,n),await Je(l,i.version);for(let c of await I(l))c!==i.version&&c!=="current"&&q.test(c)&&await y(a(l,c),{recursive:!0,force:!0});let j=await A(o.id);if(j===void 0)throw g(e,"the installed files could not be read.");return j}finally{await y(w,{force:!0}),await y(u,{recursive:!0,force:!0}),await ce(l).catch(()=>{})}}async function Le(e,t=process.platform){let n=R(e,t);if(n===void 0)throw le(e,t);return Q(n.id,async()=>{await me(h()),await C(n.id);let r=a(h(),n.id),o=(await I(r).catch(()=>[])).some(s=>!s.startsWith("."));return await y(r,{recursive:!0,force:!0}),o},{waitMs:0,action:"remove",what:`${n.title} is being removed`})}async function we(e){if(e!=="boost")return;let{resyncMenu:t}=await import("./entry-
|
|
4
|
+
`),await $(n,a(e,"current"))}function re(e){let t=process.env.FORGE_EXTENSIONS_BASE_URL;return t===void 0||t===""?e:`${t.replace(/\/+$/,"")}/${e.slice(e.lastIndexOf("/")+1)}`}var Re=600*1e3;async function me(e){let t=Date.now()-Re,n=async(r,o)=>{for(let s of await I(r).catch(()=>[])){if(!s.startsWith(o))continue;let i=a(r,s),d=await fe(i).catch(()=>{});d!==void 0&&d.mtimeMs<t&&await y(i,{recursive:!0,force:!0}).catch(()=>{})}};await n(e,".download-");for(let r of k){let o=a(e,r.id);await n(o,".staging-"),await n(o,".current-"),await ce(o).catch(()=>{})}}function oe(e){return e?.code==="ENOSPC"}var B=class extends Error{};async function _e(e,t={}){let{platform:n=process.platform,arch:r=process.arch}=t,o=R(e,n);if(o===void 0)throw le(e,n);await me(h());let s=de(o,n,r),i=x(o,n,r);if(!s.supported||i===void 0){let f=`no build for this ${F(n)}`;throw X(e,s.reason??f,n)}let d=await A(o.id);if(d?.version===i.version)return d;let p=h(),l=a(p,o.id);await ne(l,{recursive:!0});try{let f=await $e(p);if(f.bavail*f.bsize<i.bytes*2.5)throw N(e,`not enough free disk space (about ${D(Math.ceil(i.bytes*2.5))} needed).`)}catch(f){if(U(f))throw f}let m=se(6).toString("hex"),w=a(p,`.download-${m}.tar.gz`),u=a(l,`.staging-${m}`);try{let f=t.fetchImpl??fetch,b;try{b=await f(re(i.url),{signal:t.signal})}catch{throw v(e,`could not reach ${new URL(re(i.url)).host}.`)}if(!b.ok||b.body===null)throw v(e,`the server answered ${b.status}.`);let _=ie("sha256"),P=0,he=new Ae({transform(c,je,z){if(P+=c.length,P>i.bytes)return z(new B);_.update(c),t.onProgress?.(P,i.bytes),z(null,c)}});try{await Be(Oe.fromWeb(b.body),he,Se(w),t.signal?{signal:t.signal}:{})}catch(c){throw t.signal?.aborted?c:c instanceof B?g(e,"the download is larger than its published size."):oe(c)?N(e,"the disk filled up during the download."):v(e,"the connection dropped before the download finished.")}if(P<i.bytes)throw v(e,"the download ended early.");if(_.digest("hex")!==i.sha256)throw g(e,"the download does not match its published checksum.");t.signal?.throwIfAborted();try{if(await ne(u,{recursive:!0}),i.binary===void 0)await te(await Me(await ae(w)),u);else{await Ne(w,a(u,i.binary)),await Pe(a(u,i.binary),493);let c={id:o.id,version:i.version,files:{[i.binary]:i.sha256},entry:i.binary,kind:"exec"};await ue(a(u,"manifest.json"),JSON.stringify(c))}await Te(u,o,i.version)}catch(c){throw oe(c)?N(e,"the disk filled up while unpacking."):g(e,c instanceof Error?c.message:"the archive could not be unpacked.")}t.signal?.throwIfAborted(),await C(o.id);let L=a(l,i.version);await y(L,{recursive:!0,force:!0}),await We(u,L,e,n),await Je(l,i.version);for(let c of await I(l))c!==i.version&&c!=="current"&&q.test(c)&&await y(a(l,c),{recursive:!0,force:!0});let j=await A(o.id);if(j===void 0)throw g(e,"the installed files could not be read.");return j}finally{await y(w,{force:!0}),await y(u,{recursive:!0,force:!0}),await ce(l).catch(()=>{})}}async function Le(e,t=process.platform){let n=R(e,t);if(n===void 0)throw le(e,t);return Q(n.id,async()=>{await me(h()),await C(n.id);let r=a(h(),n.id),o=(await I(r).catch(()=>[])).some(s=>!s.startsWith("."));return await y(r,{recursive:!0,force:!0}),o},{waitMs:0,action:"remove",what:`${n.title} is being removed`})}async function we(e){if(e!=="boost")return;let{resyncMenu:t}=await import("./entry-REXB6JNP.js");await t()}async function ft(e,t={}){let n=await _e(e,t);return await we(e),n}async function ut(e,t=process.platform){let n=await Le(e,t);return await we(e),n}export{at as extensionBytes,ft as installExtension,ct as listExtensions,We as moveIntoPlace,ut as removeExtension};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-TMUK2DD3.js";async function a(t){let n=t.filter(e=>(e.entry.id==="whisper"||e.entry.id==="read-text")&&e.installed===void 0);if(n.length===0)return t;let{appleDoes:i}=await import("./transcribe-
|
|
3
|
+
import"./chunk-TMUK2DD3.js";async function a(t){let n=t.filter(e=>(e.entry.id==="whisper"||e.entry.id==="read-text")&&e.installed===void 0);if(n.length===0)return t;let{appleDoes:i}=await import("./transcribe-EFVJPBPG.js"),r=await i();return t.filter(e=>!n.includes(e)||(e.entry.id==="whisper"?!r.hears:!r.reads))}export{a as hideUnneeded};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{B as a,C as b,D as c,E as d,F as e,G as f,H as g,I as h,J as i}from"./chunk-
|
|
3
|
+
import{B as a,C as b,D as c,E as d,F as e,G as f,H as g,I as h,J as i}from"./chunk-3CLPUPJT.js";import"./chunk-6RMRWBMB.js";import"./chunk-VLVNA4T3.js";import"./chunk-TMUK2DD3.js";export{a as AUMID,e as gvariantString,f as linuxNotifyCommand,g as notify,d as notifyCommand,i as postFinishNotice,b as psEscape,h as terminalInFront,c as toastScript};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-6LMVOQQA.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";export{a as OWNABLE,h as chosenPath,j as findOwn,b as isOwnable,e as newer,m as ownUpdate,g as probeOwn,k as removeForgeCopy,l as resolveYtDlp,f as searchDirs,i as setChosenPath,d as toolFormula,c as toolName,o as updateOwn,n as updater};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c}from"./chunk-
|
|
3
|
+
import{a,b,c}from"./chunk-IE6NFN3N.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{b as extractPdfText,a as openPdf,c as pdfiumEngine};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as I}from"./chunk-
|
|
3
|
+
import{a as I}from"./chunk-QPJ2LNXB.js";import{a as w}from"./chunk-IKZTH2RL.js";import"./chunk-ZYIW4MAG.js";import"./chunk-IJRLRAC5.js";import"./chunk-O7DK3GJT.js";import"./chunk-EPDF4NQI.js";import"./chunk-EEQSUBBL.js";import"./chunk-E2BYNETT.js";import"./chunk-IE6NFN3N.js";import{d as k,e as R}from"./chunk-N6RCLJE6.js";import{c as g}from"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import{c as v,d as y,f as P}from"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import{E as h,q as d}from"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";async function C(t){let{prefs:T}=await R(),u=T.presets??[],s=u.find(e=>e.name===t.name);if(!s){let e=u.map(o=>o.name);throw h(`No preset is called ${t.name}.`,e.length>0?`Saved presets: ${e.join(", ")}.`:"Save one from Done with p, after a conversion.")}let a=await w(t.inputs,{recursive:t.recursive}),i=[],p=[...a.failures],m=0,c=0,f=t.output??(s.saveTo==="same"||s.saveTo==="ask"?void 0:k(s.saveTo));for(let e of a.sources){if(e.kind!=="image"){p.push({path:e.path,error:d("preset","presets work on images","Try an image such as a JPEG, PNG, WebP or HEIC file.")});continue}let o=g(s.steps,e.format),l=o[o.length-1];if(l?.kind!=="encode")continue;let n=y({sourcePath:e.path,target:l.target,...f===void 0?{}:{output:f},...a.roots.get(e.path)?{sourceRoot:a.roots.get(e.path)}:{}});(v(n,e.path)||t.keepBoth)&&(n=P(n));let r=await I(e,o,n,{force:t.force});r.kind==="done"?(i.push(r.result),m+=e.bytes,c+=r.result.outputBytes):r.kind==="unreachable"?p.push({path:e.path,error:r.entry.error}):r.kind!=="cancelled"&&p.push({path:e.path,error:r.error})}return{kind:"preset",results:i,failures:p,inputBytes:m,outputBytes:c}}export{C as runPresetCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{f as a,g as b,h as c,i as d,j as e}from"./chunk-
|
|
3
|
+
import{f as a,g as b,h as c,i as d,j as e}from"./chunk-EPDF4NQI.js";import"./chunk-EEQSUBBL.js";import"./chunk-E2BYNETT.js";import"./chunk-IE6NFN3N.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{a as ENGINES,d as engineForJob,b as engineForSource,c as engineForTarget,e as probe};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as Pd,b as Ed,c as Td}from"./chunk-CW2Y2KDQ.js";import"./chunk-ZOQA3JAR.js";import"./chunk-TYWGB767.js";import{a as zd,d as kd}from"./chunk-J2UQI544.js";import{a as yd,b as vd,f as bd}from"./chunk-W2QJA73Q.js";import"./chunk-ZHNPBRCX.js";import"./chunk-Q6KQWJ4J.js";import{f as Cd}from"./chunk-PBIS2ONZ.js";import"./chunk-SNFUGJ3M.js";import"./chunk-XUKYIVJC.js";import"./chunk-GRWOJKQB.js";import"./chunk-IED6VBE6.js";import{a as dc}from"./chunk-U5TEGDGH.js";import{b as Id}from"./chunk-R24JCIZ5.js";import{d as _d,f as Sd}from"./chunk-XPATZLEH.js";import"./chunk-QVACE4IE.js";import{e as us,f as Rd,g as $d,h as wd}from"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import{a as _t}from"./chunk-RK3WGALB.js";import"./chunk-O7DK3GJT.js";import"./chunk-DYIATUFE.js";import"./chunk-EEQSUBBL.js";import"./chunk-LA5JVBFP.js";import"./chunk-K6ERQTUQ.js";import{b as mc}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-T37DEXUI.js";import{m as gd}from"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import{E as st,a as cs}from"./chunk-CVNYUROW.js";import{d as pc}from"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import{d as lc}from"./chunk-TMUK2DD3.js";var pS=Object.create,ls=Object.defineProperty,mS=Object.getOwnPropertyDescriptor,fS=Object.getOwnPropertyNames,hS=Object.getPrototypeOf,gS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Od=(e,t)=>{let r={};for(var o in e)ls(r,o,{get:e[o],enumerable:!0});return t&&ls(r,Symbol.toStringTag,{value:"Module"}),r},_S=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=fS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!gS.call(e,c)&&c!==r&&ls(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=mS(t,c))||o.enumerable});return e},ds=(e,t,r)=>(r=e!=null?pS(hS(e)):{},_S(t||!e||!e.__esModule?ls(r,"default",{value:e,enumerable:!0}):r,e));var SS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Nd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),yS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),vS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function jd(e){return typeof e=="string"&&Nd.has(e.replace(/#$/,""))}function xd(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(SS.has(r))return"2020-12";if(Nd.has(r))return"2019-09";if(yS.has(r)||vS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ce={};lc(ce,{BIGINT_FORMAT_RANGES:()=>hs,CONSTANT_CATCH:()=>Jd,Class:()=>gc,NUMBER_FORMAT_RANGES:()=>Lo,aborted:()=>ut,allowsEval:()=>zc,assert:()=>wS,assertEqual:()=>bS,assertIs:()=>RS,assertNever:()=>$S,assertNotEqual:()=>zS,assignProp:()=>Ye,attachSchema:()=>Do,base64ToUint8Array:()=>Fd,base64urlToUint8Array:()=>FS,cached:()=>Nr,captureStackTrace:()=>ms,cleanEnum:()=>VS,cleanRegex:()=>Mo,clone:()=>it,cloneDef:()=>TS,codePointLength:()=>Zo,constantCatch:()=>Bd,createTransparentProxy:()=>jS,defineLazy:()=>yc,defineLazyInternal:()=>ge,derived:()=>KS,esc:()=>vc,escapeRegex:()=>vt,explicitlyAborted:()=>wc,extend:()=>qS,finalizeIssue:()=>lt,floatSafeRemainder:()=>Sc,getElementAtPath:()=>CS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Uo,getParsedType:()=>NS,getSizableOrigin:()=>Vd,hexToUint8Array:()=>JS,hide:()=>Ss,installLazyProp:()=>XS,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>xr,joinValues:()=>ps,jsonStringifyReplacer:()=>Or,members:()=>Ec,merge:()=>LS,mergeDefs:()=>yt,normalizeParams:()=>te,nullish:()=>_c,numKeys:()=>OS,objectClone:()=>PS,omit:()=>AS,optionalKeys:()=>$c,own:()=>qt,parsedType:()=>Pc,partial:()=>DS,pick:()=>xS,prefixIssues:()=>bt,primitiveTypes:()=>Zd,promiseAllObject:()=>kS,propertyKeyTypes:()=>Rc,randomString:()=>IS,rawShape:()=>jr,required:()=>ZS,safeExtend:()=>MS,shallowClone:()=>Dd,sizeCaps:()=>_s,slugify:()=>bc,stringifyPrimitive:()=>fs,toZod:()=>qd,uint8ArrayToBase64:()=>Hd,uint8ArrayToBase64url:()=>HS,uint8ArrayToHex:()=>BS,unwrapMessage:()=>kr});function bS(e){return e}function zS(e){return e}function qd(){return e=>e}function RS(e){}function $S(e){throw new Error("Unexpected value in exhaustive check")}function wS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ps(e,t="|"){return e.map(r=>fs(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var hc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new hc(e)}function _c(e){return e==null}function Mo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Sc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Ad=Symbol("evaluating");function yc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ad)return o===void 0&&(o=Ad,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function PS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function St(e){return jr(e._zod.def)??e._zod.def.shape}function Md(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Ld(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=St(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Md(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Ld(e,s,o?o(i.value,s):i.value))}}function ES(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Md(e,r,()=>t[r]):Ld(e,r,o.value))}}function yt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function TS(e){return yt(e._zod.def)}function CS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function kS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function IS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function vc(e){return JSON.stringify(e)}function bc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ms="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zc=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Mt(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Dd(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function OS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var NS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Rc=new Set(["string","number","symbol"]),Zd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jS(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function fs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $c(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Lo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return cr(s,e,gs(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function gs(e,t){let r=St(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function AS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(gs(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function qS(e,t){if(!Mt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=St(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function Ud(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),ES(r,t),r}function MS(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function LS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};cr(r,e,Reflect.ownKeys(St(e))),cr(r,t,Reflect.ownKeys(St(t)));let o=yt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,o)}function DS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(gs(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(St(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),it(t,yt(t._zod.def,{shape:a,checks:[]}))}function ZS(e,t,r){let o=r?new Set(gs(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(St(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),it(t,yt(t._zod.def,{shape:n}))}function ut(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function wc(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function bt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kr(e){return typeof e=="string"?e:e?.message}function _s(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Do(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:kr(e.inst?._zod.def?.error?.(e))??kr(s?.(e))??kr(t?.error?.(e))??kr(r.customError?.(e))??kr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function Vd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var US=/[\uD800-\uDBFF]/;function Zo(e){let t=e.length;if(!US.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Uo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function VS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Fd(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Hd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function FS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Fd(t+r)}function HS(e){return Hd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function BS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gc=class{constructor(...t){}};function Ec(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):GS(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ss(e,t,r){return qt(e,t,r,!1)}function KS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function GS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function WS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var fc,At=!1,YS={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&fc!==e._zod){fc=void 0;return}fc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,YS);let n=At;At=!1;try{let s=r(this);return At?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),At=At||n,s}catch(s){throw delete this[t],At=At||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function XS(e,t,r,o){let n=WS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Jd="~constantCatch";function Bd(e){let t=()=>e;return t[Jd]=!0,t}var Kd,Cc=Object.freeze({status:"aborted"}),Tc={value:void 0,enumerable:!1},Gd="captureStackTrace"in Error?Error:null;function QS(e){let t=Gd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Gd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Tc.value=new s(v);try{Object.defineProperty(g,"_zod",Tc)}finally{Tc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),Ec(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?QS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function ey(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function ty(e){this._zod.message=e}var ry={get:ey,set:ty,enumerable:!0,configurable:!0},Ic={value:void 0,enumerable:!1},Wd=new WeakSet([Object.prototype,Error.prototype]),Yd=(e,t)=>{e.name="$ZodError",Ic.value=t,Object.defineProperty(e,"issues",Ic),Ic.value=void 0,Object.defineProperty(e,"message",ry);let r=Object.getPrototypeOf(e);Wd.has(r)||(Wd.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Xd=q("$ZodError",Yd),vR=q("$ZodError",Yd,void 0,{Parent:Error});function oy(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Oc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?oy(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Nc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function ys(e,t){return{callee:t?.callee??e,Err:t?.Err}}var vs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var bs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var zs=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new dt;return s.issues.length?Qd(e,s.issues,n):{success:!0,data:s.value}};function Qd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Rs=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Qd(e,s.issues,n):{success:!0,data:s.value}};var ny=Symbol.for("zod.compile.invalid"),sy=Symbol.for("zod.compile.fallback"),jc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==ny)return!0;if(o.definite===!0&&r===void 0)return!1}return iy(e,t,r)});function iy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[sy]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var xc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},ep=e=>{let t=vs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,ys(r,i))};return r};var tp=e=>{let t=vs(e),r=(o,n,s,i)=>t(o,n,s,ys(r,i));return r};var rp=e=>{let t=bs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,ys(r,i))};return r};var op=e=>{let t=bs(e),r=async(o,n,s,i)=>await t(o,n,s,ys(r,i));return r};var np=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zs(e)(t,r,n)};var sp=e=>(t,r,o)=>zs(e)(t,r,o);var ip=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rs(e)(t,r,n)};var ap=e=>async(t,r,o)=>Rs(e)(t,r,o);var cp=/^[cC][0-9a-z]{6,}$/,up=/^[0-9a-z]+$/,lp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,dp=/^[0-9a-vA-V]{20}$/,pp=/^[A-Za-z0-9]{27}$/,mp=/^[a-zA-Z0-9_-]{21}$/;function fp(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var _p=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ay="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Sp(){return new RegExp(ay,"u")}var yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var bp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$p=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var wp=/^https?$/,Pp=/^\+[1-9]\d{6,14}$/;var Ep="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function cy(e){return new RegExp(`^${e}$`)}var Tp=cy(Ep);function Ac(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cp(e){return new RegExp(`^${Ac(e)}$`)}function kp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ac({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ac({precision:e.precision})}`:r;return new RegExp(`^${Ep}T(?:${o})$`)}var Ip=/^[\s\S]{0,}$/;var Op=/^-?\d+n?$/,Mc=/^-?\d+$/,Vo=/^-?\d+(?:\.\d+)?$/,Np=/^(?:true|false)$/i,jp=/^null$/i;var xp=/^[^A-Z]*$/,Ap=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Lc=e=>{let t=e.value;return!_c(t)&&t.length!==void 0},$s={number:"number",bigint:"bigint",object:"date"},Dc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:$s[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:$s[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Sc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Mp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Lo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Lp=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Zo(n):s)<=t.maximum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dp=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Zo(n):s)>=t.minimum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Zo(n):s;if(i===t.length)return;let c=Uo(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Fo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Up=q("$ZodCheckRegex",(e,t)=>{Fo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xp),Fo.init(e,t)}),Fp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ap),Fo.init(e,t)}),Hp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=vt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Jp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${vt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Bp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${vt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Kp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ws=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
3
|
+
import{a as Pd,b as Ed,c as Td}from"./chunk-N3X3H4IZ.js";import"./chunk-ZOQA3JAR.js";import"./chunk-TYWGB767.js";import{a as zd,d as kd}from"./chunk-ITJZ7ODJ.js";import{a as yd,b as vd,f as bd}from"./chunk-EURVTBPH.js";import"./chunk-3GHHQNR6.js";import"./chunk-Q6KQWJ4J.js";import{f as Cd}from"./chunk-PBIS2ONZ.js";import"./chunk-6RMRWBMB.js";import"./chunk-IKZTH2RL.js";import"./chunk-ZYIW4MAG.js";import"./chunk-IJRLRAC5.js";import{a as dc}from"./chunk-U5TEGDGH.js";import{b as Id}from"./chunk-7VR6LODN.js";import{d as _d,f as Sd}from"./chunk-5IZBFF6Y.js";import"./chunk-QVACE4IE.js";import{e as us,f as Rd,g as $d,h as wd}from"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import{a as _t}from"./chunk-AFEYLHDD.js";import"./chunk-O7DK3GJT.js";import"./chunk-EPDF4NQI.js";import"./chunk-EEQSUBBL.js";import"./chunk-E2BYNETT.js";import"./chunk-IE6NFN3N.js";import{b as mc}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import{m as gd}from"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import{E as st,a as cs}from"./chunk-CVNYUROW.js";import{d as pc}from"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import{d as lc}from"./chunk-TMUK2DD3.js";var pS=Object.create,ls=Object.defineProperty,mS=Object.getOwnPropertyDescriptor,fS=Object.getOwnPropertyNames,hS=Object.getPrototypeOf,gS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Od=(e,t)=>{let r={};for(var o in e)ls(r,o,{get:e[o],enumerable:!0});return t&&ls(r,Symbol.toStringTag,{value:"Module"}),r},_S=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=fS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!gS.call(e,c)&&c!==r&&ls(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=mS(t,c))||o.enumerable});return e},ds=(e,t,r)=>(r=e!=null?pS(hS(e)):{},_S(t||!e||!e.__esModule?ls(r,"default",{value:e,enumerable:!0}):r,e));var SS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Nd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),yS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),vS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function jd(e){return typeof e=="string"&&Nd.has(e.replace(/#$/,""))}function xd(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(SS.has(r))return"2020-12";if(Nd.has(r))return"2019-09";if(yS.has(r)||vS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ce={};lc(ce,{BIGINT_FORMAT_RANGES:()=>hs,CONSTANT_CATCH:()=>Jd,Class:()=>gc,NUMBER_FORMAT_RANGES:()=>Lo,aborted:()=>ut,allowsEval:()=>zc,assert:()=>wS,assertEqual:()=>bS,assertIs:()=>RS,assertNever:()=>$S,assertNotEqual:()=>zS,assignProp:()=>Ye,attachSchema:()=>Do,base64ToUint8Array:()=>Fd,base64urlToUint8Array:()=>FS,cached:()=>Nr,captureStackTrace:()=>ms,cleanEnum:()=>VS,cleanRegex:()=>Mo,clone:()=>it,cloneDef:()=>TS,codePointLength:()=>Zo,constantCatch:()=>Bd,createTransparentProxy:()=>jS,defineLazy:()=>yc,defineLazyInternal:()=>ge,derived:()=>KS,esc:()=>vc,escapeRegex:()=>vt,explicitlyAborted:()=>wc,extend:()=>qS,finalizeIssue:()=>lt,floatSafeRemainder:()=>Sc,getElementAtPath:()=>CS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Uo,getParsedType:()=>NS,getSizableOrigin:()=>Vd,hexToUint8Array:()=>JS,hide:()=>Ss,installLazyProp:()=>XS,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>xr,joinValues:()=>ps,jsonStringifyReplacer:()=>Or,members:()=>Ec,merge:()=>LS,mergeDefs:()=>yt,normalizeParams:()=>te,nullish:()=>_c,numKeys:()=>OS,objectClone:()=>PS,omit:()=>AS,optionalKeys:()=>$c,own:()=>qt,parsedType:()=>Pc,partial:()=>DS,pick:()=>xS,prefixIssues:()=>bt,primitiveTypes:()=>Zd,promiseAllObject:()=>kS,propertyKeyTypes:()=>Rc,randomString:()=>IS,rawShape:()=>jr,required:()=>ZS,safeExtend:()=>MS,shallowClone:()=>Dd,sizeCaps:()=>_s,slugify:()=>bc,stringifyPrimitive:()=>fs,toZod:()=>qd,uint8ArrayToBase64:()=>Hd,uint8ArrayToBase64url:()=>HS,uint8ArrayToHex:()=>BS,unwrapMessage:()=>kr});function bS(e){return e}function zS(e){return e}function qd(){return e=>e}function RS(e){}function $S(e){throw new Error("Unexpected value in exhaustive check")}function wS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ps(e,t="|"){return e.map(r=>fs(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var hc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new hc(e)}function _c(e){return e==null}function Mo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Sc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Ad=Symbol("evaluating");function yc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ad)return o===void 0&&(o=Ad,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function PS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function St(e){return jr(e._zod.def)??e._zod.def.shape}function Md(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Ld(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=St(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Md(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Ld(e,s,o?o(i.value,s):i.value))}}function ES(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Md(e,r,()=>t[r]):Ld(e,r,o.value))}}function yt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function TS(e){return yt(e._zod.def)}function CS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function kS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function IS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function vc(e){return JSON.stringify(e)}function bc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ms="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zc=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Mt(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Dd(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function OS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var NS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Rc=new Set(["string","number","symbol"]),Zd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jS(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function fs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $c(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Lo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return cr(s,e,gs(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function gs(e,t){let r=St(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function AS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(gs(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function qS(e,t){if(!Mt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=St(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function Ud(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),ES(r,t),r}function MS(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function LS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};cr(r,e,Reflect.ownKeys(St(e))),cr(r,t,Reflect.ownKeys(St(t)));let o=yt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,o)}function DS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(gs(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(St(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),it(t,yt(t._zod.def,{shape:a,checks:[]}))}function ZS(e,t,r){let o=r?new Set(gs(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(St(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),it(t,yt(t._zod.def,{shape:n}))}function ut(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function wc(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function bt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kr(e){return typeof e=="string"?e:e?.message}function _s(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Do(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:kr(e.inst?._zod.def?.error?.(e))??kr(s?.(e))??kr(t?.error?.(e))??kr(r.customError?.(e))??kr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function Vd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var US=/[\uD800-\uDBFF]/;function Zo(e){let t=e.length;if(!US.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Uo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function VS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Fd(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Hd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function FS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Fd(t+r)}function HS(e){return Hd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function BS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gc=class{constructor(...t){}};function Ec(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):GS(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ss(e,t,r){return qt(e,t,r,!1)}function KS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function GS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function WS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var fc,At=!1,YS={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&fc!==e._zod){fc=void 0;return}fc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,YS);let n=At;At=!1;try{let s=r(this);return At?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),At=At||n,s}catch(s){throw delete this[t],At=At||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function XS(e,t,r,o){let n=WS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Jd="~constantCatch";function Bd(e){let t=()=>e;return t[Jd]=!0,t}var Kd,Cc=Object.freeze({status:"aborted"}),Tc={value:void 0,enumerable:!1},Gd="captureStackTrace"in Error?Error:null;function QS(e){let t=Gd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Gd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Tc.value=new s(v);try{Object.defineProperty(g,"_zod",Tc)}finally{Tc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),Ec(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?QS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function ey(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function ty(e){this._zod.message=e}var ry={get:ey,set:ty,enumerable:!0,configurable:!0},Ic={value:void 0,enumerable:!1},Wd=new WeakSet([Object.prototype,Error.prototype]),Yd=(e,t)=>{e.name="$ZodError",Ic.value=t,Object.defineProperty(e,"issues",Ic),Ic.value=void 0,Object.defineProperty(e,"message",ry);let r=Object.getPrototypeOf(e);Wd.has(r)||(Wd.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Xd=q("$ZodError",Yd),vR=q("$ZodError",Yd,void 0,{Parent:Error});function oy(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Oc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?oy(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Nc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function ys(e,t){return{callee:t?.callee??e,Err:t?.Err}}var vs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var bs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var zs=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new dt;return s.issues.length?Qd(e,s.issues,n):{success:!0,data:s.value}};function Qd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Rs=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Qd(e,s.issues,n):{success:!0,data:s.value}};var ny=Symbol.for("zod.compile.invalid"),sy=Symbol.for("zod.compile.fallback"),jc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==ny)return!0;if(o.definite===!0&&r===void 0)return!1}return iy(e,t,r)});function iy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[sy]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var xc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},ep=e=>{let t=vs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,ys(r,i))};return r};var tp=e=>{let t=vs(e),r=(o,n,s,i)=>t(o,n,s,ys(r,i));return r};var rp=e=>{let t=bs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,ys(r,i))};return r};var op=e=>{let t=bs(e),r=async(o,n,s,i)=>await t(o,n,s,ys(r,i));return r};var np=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zs(e)(t,r,n)};var sp=e=>(t,r,o)=>zs(e)(t,r,o);var ip=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rs(e)(t,r,n)};var ap=e=>async(t,r,o)=>Rs(e)(t,r,o);var cp=/^[cC][0-9a-z]{6,}$/,up=/^[0-9a-z]+$/,lp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,dp=/^[0-9a-vA-V]{20}$/,pp=/^[A-Za-z0-9]{27}$/,mp=/^[a-zA-Z0-9_-]{21}$/;function fp(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var _p=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ay="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Sp(){return new RegExp(ay,"u")}var yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var bp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$p=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var wp=/^https?$/,Pp=/^\+[1-9]\d{6,14}$/;var Ep="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function cy(e){return new RegExp(`^${e}$`)}var Tp=cy(Ep);function Ac(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cp(e){return new RegExp(`^${Ac(e)}$`)}function kp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ac({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ac({precision:e.precision})}`:r;return new RegExp(`^${Ep}T(?:${o})$`)}var Ip=/^[\s\S]{0,}$/;var Op=/^-?\d+n?$/,Mc=/^-?\d+$/,Vo=/^-?\d+(?:\.\d+)?$/,Np=/^(?:true|false)$/i,jp=/^null$/i;var xp=/^[^A-Z]*$/,Ap=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Lc=e=>{let t=e.value;return!_c(t)&&t.length!==void 0},$s={number:"number",bigint:"bigint",object:"date"},Dc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:$s[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:$s[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Sc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Mp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Lo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Lp=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Zo(n):s)<=t.maximum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dp=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Zo(n):s)>=t.minimum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Zo(n):s;if(i===t.length)return;let c=Uo(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Fo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Up=q("$ZodCheckRegex",(e,t)=>{Fo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xp),Fo.init(e,t)}),Fp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ap),Fo.init(e,t)}),Hp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=vt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Jp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${vt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Bp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${vt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Kp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ws=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
4
4
|
`).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${r.join(`
|
|
6
6
|
`)}
|
|
@@ -69,6 +69,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
69
69
|
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var co=e=>fd(us(_t,e)),ft=e=>fd(Rd(_t,e));async function oS(e){let t=wd(_t,await zd(e.paths)),r=t.probes.map(o=>{let n=o.pages===void 0?`${o.width}\xD7${o.height}`:`${o.pages} pages`;return`${o.path}: ${o.format}, ${o.bytes} bytes, ${n}${o.encrypted?", password-protected":""}. Can become: ${o.targets.join(", ")}. Actions: ${o.actions.join(", ")}.`});return r.push(...t.failures.map(rS)),{content:[{type:"text",text:r.join(`
|
|
70
70
|
`)}],structuredContent:{...t},isError:!t.ok}}function nS(){let e=$d(_t,Sd());return{content:[{type:"text",text:e.formats.map(r=>{let o=r.read&&r.write?"read and write":r.read?"read only":"write only";return`${r.id} (${r.extensions.join(" ")}): ${o}`}).join(`
|
|
71
71
|
`)}],structuredContent:{...e}}}async function sS(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.crop!==void 0||e.resize!==void 0){let i=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",c=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...r,...e.pages!==void 0?["pages"]:[]][0];if(c!==void 0)return ft(st(`${i} cannot be combined with ${c}.`,"Run them one after the other."));let a;if(e.crop!==void 0)try{a={aspect:gd(e.crop)}}catch(d){if(!cs(d))throw d;return ft(st(d.detail,'Try crop "1:1" or "16:9".'))}let u={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...a===void 0?{}:{crop:a},...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return co(await Hn(u))}if(e.to===void 0)return ft(st("forge_convert needs `to`, the target format.","Only trim, crop and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return ft(st(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return co(await Hn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return co(await Hn(s))}async function iS(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=pc(e.maxSize);if(r===void 0)return ft(st(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),co(await Hn(t))}async function aS(e,t={}){try{if(e.undo)return await pd(()=>Td(t)),{content:[{type:"text",text:"\u2713 The original is back on the clipboard"}],structuredContent:{...us(_t,{results:[],failures:[]}),clipboard:"restored"},isError:!1};let r={kind:"clip",undo:!1,debug:!1};if(e.to!==void 0&&(r.target=e.to),e.quality!==void 0&&(r.quality=e.quality),e.save!==void 0&&(r.save=e.save),e.maxSize!==void 0){let i=pc(e.maxSize);if(i===void 0)return ft(st(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));r.maxBytes=i}let o=await pd(()=>Pd(r,{...dd,clip:t}));if(o.status==="failed")return co(o.report);let n=us(_t,o.report),s=fd(n);return{...s,content:[{type:"text",text:Ed(o).join(`
|
|
72
|
-
`)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!cs(r))throw r;return ft(r)}}async function cS(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return ft(st(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return ft(st("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return ft(st("split needs a split mode: every-page, every-n or points."));t.split=e.split}return co(await Hn(t))}function md(e){return{content:[{type:"text",text:e}],isError:!0}}async function uS(e){let t=e.inside===void 0?void 0:dc(e.inside)?.rgb;if(e.inside!==void 0&&!t)return md(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-
|
|
73
|
-
`)}],structuredContent:{...n}}}catch(r){if(cs(r))return md(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function lS(e){let t=dc(e.colour)?.rgb;if(!t)return md(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:r}=await import("./colour-
|
|
72
|
+
`)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!cs(r))throw r;return ft(r)}}async function cS(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return ft(st(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return ft(st("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return ft(st("split needs a split mode: every-page, every-n or points."));t.split=e.split}return co(await Hn(t))}function md(e){return{content:[{type:"text",text:e}],isError:!0}}async function uS(e){let t=e.inside===void 0?void 0:dc(e.inside)?.rgb;if(e.inside!==void 0&&!t)return md(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-PZOAKNTH.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=Cd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
|
|
73
|
+
`)}],structuredContent:{...n}}}catch(r){if(cs(r))return md(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function lS(e){let t=dc(e.colour)?.rgb;if(!t)return md(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:r}=await import("./colour-PZOAKNTH.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
|
|
74
74
|
`)}],structuredContent:{...n}}}function pR(e=process.platform){return[`Forge converts, compresses and edits files on this ${e==="win32"?"PC":e==="darwin"?"Mac":"computer"}, locally.`,"Every path must be absolute.","Call forge_probe first: it says what a file is, every format it can become, and every action that applies.","Nothing is overwritten unless you pass overwrite: true \u2014 only do that when the user asked to replace a file.","A failure hint that mentions --force means overwrite: true here; --output means the output argument; --password-stdin means the password argument."].join(" ")}var mR=pR(),ac={readOnlyHint:!0,openWorldHint:!1},cc={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function fR(e={}){let t=new sc({name:"forge",version:_t},{instructions:mR});return t.registerTool("forge_probe",{title:"Inspect files",description:"What each file is and what Forge can do with it: format (read from content, not the extension), size, pages or dimensions, whether it is password-protected, every format it can become, and every action that applies. Writes nothing.",inputSchema:D_,outputSchema:B_,annotations:ac},r=>oS(r)),t.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:Z_,outputSchema:K_,annotations:ac},()=>nS()),t.registerTool("forge_convert",{title:"Convert files",description:"Convert files to another format, beside each source unless output is given. A PDF becomes one image per page (choose pages and dpi); Word documents become PDF; images convert between formats; with trim, crop (to a shape such as 1:1, keeping the subject) or resize they keep their format unless `to` is given. Returns every output path and a file:// link to each.",inputSchema:U_,outputSchema:Fn,annotations:cc},(r,o)=>sS(r,o.mcpReq.signal)),t.registerTool("forge_compress",{title:"Compress files",description:'Make files smaller without changing their format: by quality (1-100) or to fit a size such as "500kb". Writes <name>-small.<ext> beside the source unless output is given. PNG and GIF are cut to fewer colours. A result no smaller than the source is never written (error code cannot-compress-more).',inputSchema:V_,outputSchema:Fn,annotations:cc},r=>iS(r)),t.registerTool("forge_clip",{title:"Compress the copied image",description:"The image on the clipboard, made smaller (quality or maxSize) or converted (to), and put back on the clipboard, so the next paste is the result. The result is also kept as a file, linked. A newer copy is never overwritten: if something else was copied meanwhile, the result goes to the default folder instead. A compression that would come out larger is refused. undo: true puts the last original back.",inputSchema:F_,outputSchema:J_,annotations:{...cc,destructiveHint:!0}},r=>aS(r,e.clip)),t.registerTool("forge_pdf",{title:"PDF page operations",description:"merge (two or more PDFs, in order), split, extract, delete or rotate pages. Writes new files beside the source and never edits the original. Password-protected PDFs are refused.",inputSchema:H_,outputSchema:Fn,annotations:cc},r=>cS(r)),t.registerTool("forge_palette",{title:"Colours of an image",description:"An image's main colours, most of the image first, each as hex, rgb and OKLCH with its share. With inside, the shades that one colour is made of. Writes nothing.",inputSchema:W_,outputSchema:X_,annotations:ac},r=>uS(r)),t.registerTool("forge_scale",{title:"Tonal scale",description:"A 50\u2013950 tonal scale built in OKLCH with the given colour at 500, each step with its contrast against white and black text. Writes nothing.",inputSchema:Y_,outputSchema:Q_,annotations:ac},r=>lS(r)),t}async function CT(e){if(e.length>0)throw st(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=eS();await fR().connect(new A_(process.stdin,t))}export{mR as INSTRUCTIONS,fR as createForgeServer,pR as instructionsFor,CT as runMcpServer};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-AFEYLHDD.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,n as dotGradient,o as menuPalette,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m,r as n}from"./chunk-
|
|
3
|
+
import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m,r as n}from"./chunk-Z2H2GT2X.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-HZDYZ5RD.js";import"./chunk-E2BYNETT.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{h as appleDoes,e as chooseHearing,c as helperPaths,d as helpers,b as notesNeed,i as probeSound,l as readRefusal,m as renderPages,n as renderTranscript,k as runRead,j as runTranscribe,a as transcribeNeeds,f as transcribeStatus,g as whisperUseful};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as x,b as W,c as X,d as $,e as Y,g as Z}from"./chunk-
|
|
3
|
+
import{a as x,b as W,c as X,d as $,e as Y,g as Z}from"./chunk-5YUOG3A5.js";import{c as V}from"./chunk-TDYKRRZH.js";import"./chunk-6LMVOQQA.js";import{a as D,b as B,c as H,e as K,f as M,j as S,n as q,o as z,p as G,q as J,r as Q}from"./chunk-Z2H2GT2X.js";import"./chunk-IJRLRAC5.js";import"./chunk-MF3KKEFB.js";import"./chunk-I25E2XDH.js";import"./chunk-5IZBFF6Y.js";import"./chunk-HZDYZ5RD.js";import"./chunk-O7DK3GJT.js";import"./chunk-EPDF4NQI.js";import"./chunk-EEQSUBBL.js";import"./chunk-E2BYNETT.js";import"./chunk-IE6NFN3N.js";import{a as N,d as j}from"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import{a as T,r as P}from"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import{E as U,a as F,b as I,ma as A,oa as L,pa as y,ra as O,sa as R,ta as C,w as g}from"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import{c as v}from"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{existsSync as E}from"node:fs";import{stat as ot}from"node:fs/promises";import{basename as l,dirname as tt,extname as w,join as _,resolve as p}from"node:path";function it(t){if(t.format)return t.format;let e=t.output;if(e===void 0||T(e))return"md";let r=w(e).toLowerCase();return N.find(n=>n.ext===r)?.id??"md"}function h(t,e,r,n){let i=`${t}${j(n)}`;return r===void 0?_(e,i):T(r)?_(p(r),i):p(r)}var et=t=>t.split(/\s+/).filter(Boolean).length,at=t=>t.segments.reduce((e,r)=>e+et(r.text),0);async function st(t){let{probe:e}=await import("./registry-PKOPEG3Z.js"),r=await e(t).catch(()=>{throw A(t)});return Y(r)}async function ct(t,e,r,n){if(e.to!==void 0)throw U("--to is for video and sound: a picture or PDF gives its text as it is.",`Try: forge transcribe ${l(t.path)}`);if(!(await S())?.read)throw await G();let o=h(l(t.path,w(t.path)),tt(t.path),e.output,n);if(E(o)&&!e.force)throw g(o);let c=await z(t.path,{language:e.language,signal:r.signal,onEvent:r.onProgress}),a=D(c);if(!B(a))throw O(t.path);await P(o,await J(a,n,l(t.path),{signal:r.signal,lang:e.language}));let s=t.what==="pdf"?`${t.pages} ${t.pages===1?"page":"pages"}`:w(t.path).slice(1).toUpperCase()||"picture";return r.out(`\u2713 ${v(o)} ${s} \u2192 ${et(H(a)).toLocaleString("en-US")} words`),r.finished?.({made:[{from:[t.path],to:[o]}],failed:[]}),0}async function $t(t,e){try{let r=x(t.input);if(r?.kind==="playlist")throw L("This is a playlist.",void 0,{hint:"Pass one video's link.",shellHint:"Paste one video's link."});let n,i,o,c,a=it(t);if(r===void 0){if(n=p(t.input),!(await ot(n).catch(()=>{}))?.isFile())throw I(n);let d=await V(n);if(d!=="video"&&d!=="audio"){let u=await st(n);if(u)return await ct(u,t,e,a)}}let s=await S(t.language?{locale:t.language}:{});if(s===void 0||!s.speech)throw y(K(process.platform,s?.missing));let k=t.notes&&s.notes==="available";if(t.notes&&!k){if(!t.transcript)throw y(M(process.platform,s.notes));s.notes==="off"&&e.err("\u26A0 Apple Intelligence is off, so this is the transcript only.")}if(r===void 0){if(n=p(t.input),i={title:l(n,w(n)),from:l(n)},o=h(i.title,tt(n),t.output,a),E(o)&&!t.force)throw g(o)}else{let m=new AbortController;e.signal?.addEventListener("abort",()=>m.abort(e.signal?.reason),{once:!0});let d;c=await Z(r.url,{signal:m.signal,onEvent:u=>{u.kind==="facts"&&(d=h($(u.facts.title),process.cwd(),t.output,a),E(d)&&!t.force&&m.abort(g(d)))}}),n=c.path,i={title:c.facts.title,from:r.url},o=d??h($(c.facts.title),process.cwd(),t.output,a)}let f;try{f=await q(n,{notes:k,detail:t.detail,locale:t.language,signal:e.signal,onEvent:e.onProgress})}finally{await c?.dispose()}let rt=X(f,i,{transcript:t.transcript});await P(o,await Q(rt,a,{signal:e.signal,lang:f.locale}));let b=f.notes?.parts.length,nt=b===void 0?"":` \xB7 ${b} ${b===1?"part":"parts"}`;return e.out(`\u2713 ${v(o)} ${W(f.seconds)} \u2192 ${at(f).toLocaleString("en-US")} words${nt}`),e.finished?.({made:[{from:[r===void 0?n:i.title],to:[o]}],failed:[]}),0}catch(r){let n=F(r)?r:R(r);for(let o of C(n,{debug:t.debug}))e.err(o);let i=x(t.input)===void 0?p(t.input):"";return e.finished?.({made:[],failed:[{path:i,message:n.message}]}),1}}export{$t as runTranscribeCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{b as m,c as w,d as h,i as l,j as p,k as b}from"./chunk-SZRSAL64.js";import{c as $,d as g}from"./chunk-
|
|
3
|
+
import{b as m,c as w,d as h,i as l,j as p,k as b}from"./chunk-SZRSAL64.js";import{c as $,d as g}from"./chunk-AFEYLHDD.js";import{e as u}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await u();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?g:$:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as R,d as k}from"./chunk-
|
|
3
|
+
import{c as R,d as k}from"./chunk-MNI6IKIU.js";import{a as W,d as N}from"./chunk-TDYKRRZH.js";import"./chunk-3GHHQNR6.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-ZYIW4MAG.js";import"./chunk-IJRLRAC5.js";import"./chunk-7VR6LODN.js";import"./chunk-5IZBFF6Y.js";import{c as w,d as h}from"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import{a as S}from"./chunk-AFEYLHDD.js";import"./chunk-O7DK3GJT.js";import"./chunk-EPDF4NQI.js";import"./chunk-EEQSUBBL.js";import"./chunk-E2BYNETT.js";import"./chunk-IE6NFN3N.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TFOEI5VF.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import{E as L,a as M,b as I,ta as E}from"./chunk-CVNYUROW.js";import{a as A}from"./chunk-J7FLFHQJ.js";import{c as a}from"./chunk-VLVNA4T3.js";import{a as F}from"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";import{readdir as T,stat as B}from"node:fs/promises";import{join as C,resolve as y}from"node:path";function K(r,t,s,n){return[`\u2713 ${r} converted${n?` to ${n}`:""}`,...t?[`${t} failed`]:[],...s?[`${s} left alone`]:[]].join(" \xB7 ")}var P=r=>{let[t,...s]=r.job.outputs,n=`${a(t??"")}${s.length?` + ${s.length} more`:""}`;return`\u2713 ${a(r.job.sources[0].path)} \u2192 ${n} ${A(r.outputBytes)}`},O=(r,t)=>`\u2715 ${a(r)} ${t.title.toLowerCase()}`,D=r=>`\u2013 ${a(r.path)} ${r.reason}`;async function v(r,t){let s=y(r.folder),n=(e,o)=>t.out(JSON.stringify({forge:S,event:e,...o}));try{let e=await B(s).catch(()=>{});if(!e)throw I(s);if(!e.isDirectory())throw L(`${a(s)} is not a folder.`,`forge watch watches a folder. Try: forge watch ${a(y(s,".."))} --to ${r.target}`)}catch(e){if(!M(e))throw e;if(t.json)n("error",{ok:!1,failures:[h({error:e})]});else for(let o of E(e,{debug:r.debug}))t.out(o);return 2}let m={target:r.target,...r.quality===void 0?{}:{quality:r.quality},dpi:r.dpi??150},$={images:m,pdfs:m,documents:m},c=r.output===void 0?void 0:y(r.output),q=F[r.target].label,p=0,i=[],u=[],b=new Set,g;if(r.newOnly)g=(await T(s,{withFileTypes:!0})).filter(o=>o.isFile()&&!W(o.name)).map(o=>C(s,o.name));else{let e=await N(s);g=e.paths;let o=await R(e,$,{destination:c});b=o.claimed;let f=[...e.failures,...o.outcome.refusals,...o.outcome.failures],j=e.kinds.flatMap(l=>l.why?[{count:l.count,why:l.why}]:[]),J=o.left.length+j.reduce((l,d)=>l+d.count,0);if(p+=o.outcome.results.length,i.push(...f),u.push(...o.left),t.json)n("converted-existing",{ok:f.length===0,results:o.outcome.results.map(w),failures:f.map(h),leftAlone:o.left});else if(e.paths.length>0){t.out(K(o.outcome.results.length,f.length,J,q));for(let l of f)t.out(O(l.path,l.error))}for(let l of j)for(let d=0;d<l.count;d++)u.push({path:"",reason:l.why})}t.json?n("watching",{folder:s,...c?{output:c}:{}}):t.out(`Watching ${a(s)} \xB7 any new files you add will be converted \xB7 ctrl-c to stop`);let x=k({dir:s,answers:$,known:g,claimed:b,destination:c,...t.settleMs===void 0?{}:{settleMs:t.settleMs},...t.pollMs===void 0?{}:{pollMs:t.pollMs},onEvent:e=>{e.type==="converted"?(p++,t.json?n("converted",{result:w(e.result)}):t.out(P(e.result))):e.type==="failed"?(i.push({path:e.path,error:e.error}),t.json?n("failed",{failure:h({path:e.path,error:e.error})}):t.out(O(e.path,e.error))):e.type==="left"&&(u.push({path:e.path,reason:e.reason}),t.json?n("left-alone",{path:e.path,reason:e.reason}):t.out(D({path:e.path,reason:e.reason})))}});return await new Promise(e=>{t.signal.aborted?e():t.signal.addEventListener("abort",()=>e(),{once:!0})}),await x.stop(),t.json?n("stopped",{converted:p,failed:i.length,leftAlone:u.length}):t.out(K(p,i.length,u.length)),i.length>0?1:0}export{v as runWatch};
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
3
3
|
const require = __forgeCreateRequire(import.meta.url);
|
|
4
|
-
import{e as x,f as T}from"./chunks/chunk-
|
|
4
|
+
import{e as x,f as T}from"./chunks/chunk-AIINYKXW.js";import{b as g,d as C}from"./chunks/chunk-IBPGC4N2.js";import"./chunks/chunk-U5TEGDGH.js";import"./chunks/chunk-7VR6LODN.js";import"./chunks/chunk-5IZBFF6Y.js";import"./chunks/chunk-HZDYZ5RD.js";import"./chunks/chunk-QVACE4IE.js";import{f as b}from"./chunks/chunk-57M4J2BR.js";import"./chunks/chunk-63XCSYHM.js";import{a as p}from"./chunks/chunk-AFEYLHDD.js";import{b as S}from"./chunks/chunk-O7DK3GJT.js";import"./chunks/chunk-EPDF4NQI.js";import"./chunks/chunk-EEQSUBBL.js";import"./chunks/chunk-E2BYNETT.js";import"./chunks/chunk-IE6NFN3N.js";import"./chunks/chunk-HWCXNKIN.js";import"./chunks/chunk-N6RCLJE6.js";import"./chunks/chunk-WE6KP4FR.js";import"./chunks/chunk-KH5DHZ2U.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TFOEI5VF.js";import"./chunks/chunk-J6AZTW62.js";import"./chunks/chunk-BIBDLXCG.js";import"./chunks/chunk-7KYO62XK.js";import{E as $,a as m,sa as E,ta as w}from"./chunks/chunk-CVNYUROW.js";import"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-VLVNA4T3.js";import"./chunks/chunk-H3DIRJFE.js";import"./chunks/chunk-KXKQDFHX.js";import"./chunks/chunk-TMUK2DD3.js";import*as j from"node:module";function v(e){return m(e)?e:E(e)}function k(e,n){return w(v(e),{debug:n})}function F(e,n){process.once("beforeExit",()=>{e()||(n(new Error("Forge stopped before it finished: it was waiting for input that never came.")),process.exitCode=1)})}S();j.enableCompileCache?.();function M({completed:e,total:n}){e===0?process.stderr.write(`Converting ${n} files
|
|
5
5
|
`):process.stderr.write(` ${e}/${n}
|
|
6
|
-
`)}async function D(){let e=process.argv.slice(2),n=e.includes("--debug"),d=x(e);try{if(e[0]==="__update-check"){let{checkNow:r}=await import("./chunks/check-B6NP7BEM.js");await r();return}if(e[0]==="menu"){let{openedFor:r,parseMenuArgs:t}=await import("./chunks/command-DMGGGAPS.js"),s=t(e.slice(1));if(s.kind==="open"){let{applyColourPreference:h}=await import("./chunks/theme-
|
|
6
|
+
`)}async function D(){let e=process.argv.slice(2),n=e.includes("--debug"),d=x(e);try{if(e[0]==="__update-check"){let{checkNow:r}=await import("./chunks/check-B6NP7BEM.js");await r();return}if(e[0]==="menu"){let{openedFor:r,parseMenuArgs:t}=await import("./chunks/command-DMGGGAPS.js"),s=t(e.slice(1));if(s.kind==="open"){let{applyColourPreference:h}=await import("./chunks/theme-D4AMWFFW.js");h();let{bootShell:I}=await import("./chunks/boot-E57BKWEC.js");await I(void 0,{opened:r(s.action,s.paths)});return}let{runMenuCommand:c}=await import("./chunks/entry-REXB6JNP.js");process.exitCode=await c(s,p);return}if(e[0]==="mcp"){let{runMcpServer:r}=await import("./chunks/server-AR73FWWG.js");await r(e.slice(1));return}let o=T(e);if(o.kind==="shell"){if(d)throw $("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
|
|
7
7
|
Try: forge photo.jpg --to webp
|
|
8
|
-
`),process.exitCode=2;return}let{applyColourPreference:r}=await import("./chunks/theme-
|
|
9
|
-
`),json:d,signal:t.signal});return}if(o.kind==="uninstall"){let{runUninstall:r}=await import("./chunks/entry-
|
|
10
|
-
`));return}let{execute:l}=await import("./chunks/execute-
|
|
8
|
+
`),process.exitCode=2;return}let{applyColourPreference:r}=await import("./chunks/theme-D4AMWFFW.js");r();let{bootShell:t}=await import("./chunks/boot-E57BKWEC.js");await t(void 0,{menuNote:async()=>(await import("./chunks/entry-REXB6JNP.js")).menuAtStart(p)});return}if(o.kind==="watch"){let{runWatch:r}=await import("./chunks/watch-command-2D7NLDAM.js"),t=new AbortController;process.once("SIGINT",()=>t.abort()),process.exitCode=await r(o,{out:s=>process.stdout.write(`${s}
|
|
9
|
+
`),json:d,signal:t.signal});return}if(o.kind==="uninstall"){let{runUninstall:r}=await import("./chunks/entry-REXB6JNP.js");process.exitCode=await r(p,t=>process.stdout.write(`${t}
|
|
10
|
+
`));return}let{execute:l}=await import("./chunks/execute-GKO4THUK.js"),i,y=0,A=(r,t)=>{let s=Date.now();if(r<t&&s-y<100)return;y=s;let c=h=>(h/1e6).toFixed(1);process.stderr.write(`\r downloading ${c(r)} / ${c(t)} MB${r>=t?`
|
|
11
11
|
`:""}`)},u=!!process.stderr.isTTY&&!d,f=new AbortController;o.kind==="extension-op"&&process.once("SIGINT",()=>f.abort());let B=Date.now(),a=await l(o,{json:d,...u?{onInstalling:r=>{i=g(process.stderr,`installing Forge ${r}`)}}:{},signal:f.signal,...u?{onDownload:A}:{},colour:!!process.stdout.isTTY&&!d&&C(),onProgress:u?r=>{r.completed>0&&i?.stop(),M(r)}:void 0,...u?{onSearch:r=>{i??=g(process.stderr,"finding the smallest that fits"),i.update(r)},onEncode:r=>{i??=g(process.stderr,"encoding"),i.update(r)}}:{}});if(i?.stop(),a.stdout.length>0&&process.stdout.write(`${a.stdout.join(`
|
|
12
12
|
`)}
|
|
13
13
|
`),a.stderr.length>0&&process.stderr.write(`${a.stderr.join(`
|
|
14
14
|
`)}
|
|
15
|
-
`),process.exitCode=f.signal.aborted?130:a.exitCode,u&&a.notice&&!f.signal.aborted){let{postFinishNotice:r}=await import("./chunks/notify-
|
|
15
|
+
`),process.exitCode=f.signal.aborted?130:a.exitCode,u&&a.notice&&!f.signal.aborted){let{postFinishNotice:r}=await import("./chunks/notify-YEBP67MP.js");await r(a.notice,Date.now()-B)}if(u&&process.stdout.isTTY&&o.kind!=="update")try{let{afterCommand:r,spawnRefresh:t}=await import("./chunks/update-note-2YR3TLPK.js"),{runningScript:s}=await import("./chunks/install-C6XNONFF.js"),c=await r(p,{refresh:()=>t(s(process.argv[1])),colour:C()});c.length>0&&process.stderr.write(`
|
|
16
16
|
${c.join(`
|
|
17
17
|
`)}
|
|
18
18
|
`)}catch{}}catch(o){if(m(o)){d?process.stdout.write(`${JSON.stringify(b(p,o))}
|
package/package.json
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-terminal",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "A terminal-native file converter for macOS, Windows and Linux",
|
|
5
5
|
"whatsNew": [
|
|
6
6
|
{
|
|
7
|
-
"title": "
|
|
8
|
-
"text": "
|
|
7
|
+
"title": "Remove banding",
|
|
8
|
+
"text": "Edit smooths stripes out of shading, like a banded sky or a heavily compressed picture. Pick Light, Medium or Strong on the row."
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"title": "
|
|
12
|
-
"text": "
|
|
11
|
+
"title": "Dither",
|
|
12
|
+
"text": "Edit can cut a picture down to 16, 4 or 2 colours, with dots that keep its shading."
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"title": "
|
|
16
|
-
"text": "
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"title": "A note when it ends",
|
|
20
|
-
"text": "A run of 20 seconds or more tells you when it is done, if you have switched to another app."
|
|
15
|
+
"title": "Windows notice",
|
|
16
|
+
"text": "When a batch finishes on Windows, the notice now names the right folder."
|
|
21
17
|
}
|
|
22
18
|
],
|
|
23
19
|
"keywords": [
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as L,b as O,f as T}from"./chunk-JGJU3AW5.js";import{b as K,c as P,m as j,n as z,p as J,q as W,s as $}from"./chunk-ZHNPBRCX.js";import{b as w}from"./chunk-GRWOJKQB.js";import{b as q}from"./chunk-IED6VBE6.js";import{d as R}from"./chunk-R24JCIZ5.js";import{a as M}from"./chunk-XPATZLEH.js";import{f as B}from"./chunk-T37DEXUI.js";import{b as I}from"./chunk-BIBDLXCG.js";import{a as k}from"./chunk-J7FLFHQJ.js";import{a as v}from"./chunk-H3DIRJFE.js";import{existsSync as E}from"node:fs";import{basename as G,dirname as H,extname as Q,join as U}from"node:path";var V={images:"an image",pdfs:"a PDF",documents:"a document",videos:"a video",audio:"audio",other:"a file Forge reads"};function X(e){let t=Object.keys(e).filter(s=>e[s]);if(t.length===0)return"not supported";let n=t.map(s=>V[s]);return`not ${n.length===1?n[0]:`${n.slice(0,-1).join(", ")} or ${n.at(-1)}`}`}function Y(e){return e.kind==="document"?e.format==="pdf"?"no images to shrink":"nothing to compress":`${v[e.format].label} is lossless`}function Z(e,t,n){if(e.kind!=="image")return{left:"images only"};let s=e,r=n===void 0?{}:{output:n};if(t.tool==="sharpen"||t.tool==="boost"){let c=t.tool==="sharpen"?1:t.scale??2;if(B(s.width,s.height,c))return{left:c===1?"too large":`too large for ${c}\xD7`};let[f]=K.plan([s],{scale:String(c),target:R(s),...r});return f?{job:f}:{left:"not supported"}}if(t.tool==="cutout"){let[c]=P.plan([s],{target:"png",...r});return c?{job:c}:{left:"not supported"}}if(t.tool==="rotate"){if(s.frames>1)return{left:"animated"};let[c]=$.plan([s],{turn:t.turn??90,...r});return c?{job:c}:{left:"not supported"}}if(t.tool==="trim"&&s.frames>1)return{left:"animated"};let o=t.tool==="trim"?J:W,[i]=o.plan([s],{target:R(s),...t.resize?{resize:t.resize}:{},...r});return i?{job:i}:{left:"not supported"}}function ee(e,t,n){if(t.op==="edit")return Z(e,t,n);if(e.kind==="media")return{left:"one at a time"};let s=n===void 0?{}:{destination:n};if(t.op==="compress"){if(!j.appliesTo([e]))return{left:Y(e)};if(t.targetBytes!==void 0&&e.bytes<=t.targetBytes)return{left:"already under that size"};let[i]=j.plan([e],{mode:t.targetBytes===void 0?"quality":"size",...t.quality===void 0?{}:{quality:t.quality},...s});return i?{job:i}:{left:"not supported"}}let r=t.answers[O(e)];if(!r)return{left:X(t.answers)};if(e.format===r.target)return{left:`already ${v[r.target].label}`};if(!M(e).includes(r.target))return{left:`can\u2019t become ${v[r.target].label}`};let[o]=z.plan([e],{target:r.target,...r.quality===void 0?{}:{quality:r.quality},...r.dpi===void 0?{}:{dpi:String(r.dpi)},pages:"all",...s});return o?.op==="convert"?{job:o}:{left:"not supported"}}function te(e,t){if(!t(e))return e;let n=Q(e),s=G(e,n);for(let r=1;;r++){let o=U(H(e),I(s,` (${r})${n}`));if(!t(o)&&!E(o))return o}}function ne(e,t,n,s={}){let r=s.existing??"leave",o=ee(e,t,s.destination);if(!("job"in o))return o;let{job:i}=o,c=i.outputs.some(a=>E(a)&&!n.has(a));if(c&&r==="leave")return{left:t.op==="compress"?"already compressed":t.op==="edit"?"already edited":"already converted"};let f=r==="number"?a=>n.has(a)||E(a):a=>n.has(a);i.outputs=i.outputs.map(a=>te(a,f));for(let a of i.outputs)n.add(a);return c&&r==="ask"?{job:i,taken:!0}:{job:i}}function S(e,t,n,s={}){let r=[],o=[],i=[];for(let c of e){let f=ne(c,t,n,s);"job"in f?(r.push(f.job),f.taken&&i.push(f.job)):o.push({path:c.path,reason:f.left})}return{jobs:r,left:o,taken:i}}async function D(e,t,n={}){let s=new Set,r=n.existing??"leave",{jobs:o,left:i}=S(e,t,s,{destination:n.destination,existing:r});return{outcome:await w(o,{force:r==="replace",...t.op==="compress"&&t.targetBytes!==void 0?{targetBytes:t.targetBytes}:{},...n.concurrency===void 0?{}:{concurrency:n.concurrency},...n.onEvent?{onEvent:n.onEvent}:{},...n.signal?{signal:n.signal}:{}}),left:i,claimed:s,jobs:o}}function C(e,t){let{outcome:n,left:s}=t,r=new Map;for(let o of n.results){let i=o.job.sources[0].path;r.set(i,{path:i,state:"done",result:o})}for(let o of[...n.refusals,...n.failures])if(o.error.code==="cannot-compress-more"){let i=o.error.short==="nothing written"?"can\u2019t get smaller":"already under that size";r.set(o.path,{path:o.path,state:"left",reason:i})}else o.error.code==="nothing-to-trim"?r.set(o.path,{path:o.path,state:"left",reason:"no empty edges"}):r.set(o.path,{path:o.path,state:"failed",reason:o.error.title.toLowerCase()});for(let o of n.unreachable){let i=o.job.sources[0].path;r.set(i,{path:i,state:"left",reason:`can\u2019t get below ${k(o.smallest)}`})}for(let o of s)r.set(o.path,{path:o.path,state:"left",reason:o.reason});return e.map(o=>r.get(o.path)??{path:o.path,state:"left",reason:n.cancelled?"stopped":"not run"})}import{watch as oe}from"node:fs";import{readdir as re,stat as se}from"node:fs/promises";import{join as ie,resolve as N}from"node:path";function _(e,t,n){let s=N(e),r=n.settleMs??1e3,o=n.pollMs??500,i=new Set([...t].map(m=>N(m))),c=new Map,f=!1,a=!1,d=!1,p=async()=>{if(!f){if(a){d=!0;return}a=!0;try{let m=await re(s,{withFileTypes:!0}).catch(()=>[]),g=new Set;for(let l of m){if(!l.isFile()||L(l.name))continue;let u=ie(s,l.name);if(g.add(u),i.has(u)||n.ignore?.(u))continue;let y=await se(u).catch(()=>{});if(!y||f)continue;let F=Date.now(),b=c.get(u);if(!b||b.size!==y.size||b.mtimeMs!==y.mtimeMs){c.set(u,{size:y.size,mtimeMs:y.mtimeMs,since:F});continue}F-b.since<r||(c.delete(u),i.add(u),n.onFile(u))}for(let l of[...i,...c.keys()])g.has(l)||(i.delete(l),c.delete(l))}finally{a=!1,d&&!f&&(d=!1,p())}}},x=setInterval(()=>{p()},o),h;try{h=oe(s,{persistent:!1},()=>{p()}),h.on("error",()=>{})}catch{}return p(),{close(){f=!0,clearInterval(x),h?.close()}}}var A=e=>"op"in e&&(e.op==="convert"||e.op==="compress"||e.op==="edit")?e:{op:"convert",answers:e};function ae(e,t,n,s){let{jobs:r,left:o}=S(e,A(t),n,{destination:s});return{jobs:r,left:o}}async function ze(e,t,n={}){return D(e.sources,A(t),n)}var ce=(e,t)=>e==="other"?t==="text"?"a text file":"not supported":"not yet supported";function Je(e){let t=q(e.concurrency),n=A(e.answers),s=[],r=new Set,o=!1,i=async a=>{e.onEvent({type:"arrived",path:a}),e.onEvent({type:"phase",path:a,phase:"reading"});let d=await T(a);if(d.kind==="failed"){e.onEvent({type:"failed",path:a,error:d.failure.error});return}if(d.kind!=="source"){e.onEvent({type:"left",path:a,reason:ce(d.kind,d.sniffed)});return}let{jobs:p,left:x}=ae([d.source],n,e.claimed,e.destination),[h]=x;if(h){e.onEvent({type:"left",path:a,reason:h.reason});return}let m=await w(p,{force:!1,concurrency:1,...n.op==="compress"&&n.targetBytes!==void 0?{targetBytes:n.targetBytes}:{},onEvent:l=>{l.type==="job:phase"&&"phase"in l.progress&&l.progress.phase!=="page"&&l.progress.phase!=="time"&&l.progress.phase!=="tiles"&&e.onEvent({type:"phase",path:a,phase:l.progress.phase,job:l.job})}}),[g]=C([d.source],{outcome:m,left:[],claimed:e.claimed,jobs:p});if(g?.result)e.onEvent({type:"converted",path:a,result:g.result});else if(g?.state==="left")e.onEvent({type:"left",path:a,reason:g.reason??""});else{let l=[...m.refusals,...m.failures][0];l&&e.onEvent({type:"failed",path:a,error:l.error})}},c=()=>{for(;!o&&r.size<t&&s.length>0;){let a=s.shift(),d=i(a).catch(()=>{}).finally(()=>{r.delete(d),c()});r.add(d)}},f=_(e.dir,e.known,{...e.settleMs===void 0?{}:{settleMs:e.settleMs},...e.pollMs===void 0?{}:{pollMs:e.pollMs},ignore:a=>e.claimed.has(a),onFile:a=>{s.push(a),c()}});return{async stop(){o=!0,f.close(),s.length=0,await Promise.all([...r])}}}export{S as a,C as b,ze as c,Je as d};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as a}from"./chunk-VLVNA4T3.js";import{dirname as l,sep as f}from"node:path";var p=2e4,g=t=>t>=p;function u(t,o){return{made:t.map(i=>({from:i.job.sources.map(e=>e.path),to:i.job.outputs})),failed:o.map(i=>({path:i.path,message:i.error.message}))}}var d=t=>t.length===1?a(t[0]):`${t.length} files`;function m(t){let[o,...i]=t.map(s=>l(s).split(f)),e=o??[];for(let s of i){let n=0;for(;n<e.length&&e[n]===s[n];)n++;e=e.slice(0,n)}return e.join(f)||f}function y(t,o){let i=o.made.length+o.failed.length;if(i===0)return;let[e]=o.failed,s=e&&(e.path?`${a(e.path)}: `:"")+e.message;if(i===1){let[r]=o.made;return r?{title:`${t} finished`,body:`${d(r.from)} \u2192 ${d(r.to)}`}:{title:`${t} failed`,body:s??""}}let n=`${t} finished ${o.made.length} of ${i} files`;return s!==void 0?{title:n,body:s}:{title:n,body:`Saved to ${a(m(o.made.flatMap(r=>r.to)))}`}}export{g as a,u as b,y as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{d as E,k as F}from"./chunk-J6AZTW62.js";import{n as te,o as A,q as re}from"./chunk-BIBDLXCG.js";import{a as ie,b as oe,c as ne,d as ae,e as se,f as he,g as I}from"./chunk-7KYO62XK.js";import{B as j,E as O,J as X,X as G,a as b,aa as H,b as L,c as P,ca as K,d as z,da as Q,e as _,ea as Y,f as N,fa as Z,g as $,ga as ee,h as D,i as q,ka as x,l as U,m as W,n as V,t as J,u as S}from"./chunk-CVNYUROW.js";import{c as y}from"./chunk-VLVNA4T3.js";import{a as f}from"./chunk-H3DIRJFE.js";import{b as w}from"./chunk-KXKQDFHX.js";import{constants as be}from"node:fs";import{access as Se,readFile as xe,rm as Ee,stat as Ie,writeFile as ve}from"node:fs/promises";import{dirname as ze}from"node:path";function Ue(e){if(f[e].hasAlpha)return;let r=Object.keys(f).filter(t=>f[t].hasAlpha&&t!=="heic").join(", ");return O(`${f[e].label} cannot hold transparency, so a cutout cannot be saved as one.`,`Choose a format that can: ${r}.`)}var ce="1.1.0";function fe(e,r){let t=e.split(".").map(i=>Number.parseInt(i,10)||0),o=r.split(".").map(i=>Number.parseInt(i,10)||0);for(let i=0;i<Math.max(t.length,o.length);i++){let a=(t[i]??0)-(o[i]??0);if(a!==0)return a>0}return!0}var ge="1.4.0";function We(e){return e!==void 0&&fe(e,ge)}function M(e){return e!==void 0&&fe(e,ce)?[2,3,4]:[2,4]}function Ve(e,r,t){if(e===1||M(r).some(i=>i===e))return;if(t!==void 0&&M(t).some(i=>i===e))return X("boost",`boost ${e}\xD7`,r,ce);let o=M(r).map(i=>`--boost ${i}`);return O(`No released boost makes ${e}\xD7 yet.`,`Try ${o.slice(0,-1).join(", ")} or ${o.at(-1)}.`)}var le=16384,ye=1e8;function de(e,r,t){let o=Math.max(e,r)*t;if(o>le)return{side:o};let i=e*t*r*t;if(i>ye)return{megapixels:Math.round(i/1e6)}}var u=e=>Math.max(1,Math.round(e));function T(e,r){return"percent"in r?{width:u(e.width*r.percent/100),height:u(e.height*r.percent/100)}:"width"in r?{width:u(r.width),height:u(e.height*r.width/e.width)}:{width:u(e.width*r.height/e.height),height:u(r.height)}}function pe(e){return de(e.width,e.height,1)}var Oe=new Set(["jpeg","png","webp","avif","heic","raw","gif","tiff"]),Fe=new Set(["jpeg","png","webp","avif","gif","tiff"]),Ae={jpeg:"jpeg",png:"png",webp:"webp",gif:"gif",tiff:"tiff"};function Me(e,r){if(r.format==="heif")return r.compression==="av1"?"avif":"heic";let t=Ae[r.format??""];if(!t)throw q(e,r.format??"an unknown format");return t}async function Te(e){let r;try{r=await Ie(e)}catch(a){let s=a.code;throw s==="ENOENT"?L(e):s==="EACCES"||s==="EPERM"?z(e):s==="ENOTDIR"?_(e):s==="ELOOP"?N(e):s==="ENAMETOOLONG"?$(e):D(e,a)}if(!r.isFile())throw P(e);try{await Se(e,be.R_OK)}catch{throw z(e)}if(await oe(e)){if(!await ie())throw U(e);let a;try{a=await ne(e)}catch(s){throw S(e,"heic",s)}if(a.width===0||a.height===0)throw S(e,"heic",void 0);return{kind:"image",path:e,format:"heic",width:a.width,height:a.height,bytes:r.size,hasAlpha:a.hasAlpha,frames:1}}let t=await ae(e);if(t){if(!await se())throw W(e);let a;try{a=await he(e,t)}catch(s){throw S(e,"raw",s)}if(!a)throw V(e);return{kind:"image",path:e,format:"raw",width:a.width,height:a.height,bytes:r.size,hasAlpha:!1,frames:1}}let o=await w(),i;try{i=await o(e).metadata()}catch(a){throw J(e,a)}return{kind:"image",path:e,format:Me(e,i),width:i.autoOrient?.width??i.width??0,height:i.autoOrient?.height??i.height??0,bytes:r.size,hasAlpha:i.hasAlpha??!1,frames:i.pages??1}}function k(e,r,t,o){let i=t??f[r].defaultQuality;if(o&&f[r].quantisable)return ke(e,r,t,o);switch(r){case"jpeg":return e.jpeg({quality:i,mozjpeg:!0});case"webp":return e.webp({quality:i});case"avif":return e.avif({quality:i});case"png":return e.png({compressionLevel:9});case"gif":return e.gif();case"tiff":return e.tiff({compression:"deflate"});case"heic":throw new Error("heic is not writable; the capability graph should have prevented this");case"raw":throw new Error("raw is not writable; the capability graph should have prevented this");case"pdf":throw new Error("pdf is not an image target; the capability graph should have prevented this");case"docx":throw new Error("docx is not an image target; the capability graph should have prevented this");case"doc":throw new Error("doc is not an image target; the capability graph should have prevented this");default:throw new Error(`${r} is not an image target; the capability graph should have prevented this`)}}function ke(e,r,t,{dither:o}){let i=t??100,a=o?1:0;return r==="gif"?e.gif({interFrameMaxError:Math.round(32*(100-i)/100),dither:a}):e.png({palette:!0,quality:i,dither:a,compressionLevel:9,effort:10})}var R=(e,r)=>e.kind==="image"&&e.frames>1&&f[r].animatable;async function Re(e,r){let t=ze(r);await A(r);let o=te(r);try{return await ve(o,e),await re(o,r),e.length}catch(i){throw await Ee(o,{force:!0}).catch(()=>{}),j(r,i)}}async function g(e,r,t,o,i,a){if(e.kind!=="image")throw new Error("pipelineFor received a non-image source");let s=i??await I(e.path,e.format),n=(await w())(s,o?{animated:!0}:{});if(n=n.rotate(),t.trim&&(n=n.trim()),t.crop){if(!t.crop.box)throw new Error("pipelineFor needs the crop placed (run does it)");n=n.extract(t.crop.box)}if(t.resize){if(!a&&(t.trim||t.crop))throw new Error("pipelineFor needs the resolved size to resize a cut image");let c=a??T(e,t.resize);n=n.resize(c.width,c.height,{fit:"fill"})}return t.rotate&&(n=n.rotate(t.rotate)),e.hasAlpha&&!f[r].hasAlpha&&(n=n.flatten({background:t.background})),n=t.keepMetadata?n.keepMetadata():n.keepIccProfile(),{pipeline:n}}async function st(e,r){let t={background:"#ffffff",keepMetadata:!1},{pipeline:o}=await g(e,"png",t,!1);await o.png({compressionLevel:1}).toFile(r)}async function ht(e,r,t){let{pipeline:o}=await g(e,r,t,R(e,r));return await k(o,r,t.quality,t.compress).toBuffer()}async function Be(e){let r={width:e.width,height:e.height};if(e.frames>1)return{upright:r,trimmed:"animated"};let t=await I(e.path,e.format);try{let o=await w(),{info:i}=await o(t).rotate().trim().jpeg({quality:1}).toBuffer({resolveWithObject:!0});return i.width===r.width&&i.height===r.height?{upright:r,trimmed:"nothing"}:{upright:r,trimmed:{width:i.width,height:i.height}}}catch(o){throw b(o)?o:x(e.path,o)}}var me=1024;async function Ce(e){let r={background:"#ffffff",keepMetadata:!1},{pipeline:t}=await g(e,"png",r,!1);try{let{data:o,info:i}=await t.resize(me,me,{fit:"inside",withoutEnlargement:!0}).ensureAlpha().raw().toBuffer({resolveWithObject:!0}),a=i.width*i.height,s=i.channels,p=new Uint8Array(a*3),n=new Uint8Array(a),c=!1;for(let m=0;m<a;m++){for(let h=0;h<3;h++)p[m*3+h]=o[m*s+(s>=4?h:0)]??0;n[m]=o[m*s+s-1]??255,n[m]!==255&&(c=!0)}return{size:{width:e.width,height:e.height},thumb:{width:i.width,height:i.height,rgb:p,...c?{alpha:n}:{}}}}catch(o){throw b(o)?o:x(e.path,o)}}var ue=128;async function Le(e,r){let{thumb:t,size:o}=e,i=E(t,r),a=await w(),{info:s}=await a(Pe(t),{raw:{width:t.width,height:t.height,channels:3}}).resize(i.width,i.height,{fit:"cover",position:a.strategy.attention}).raw().toBuffer({resolveWithObject:!0}),p=E(o,r),n=Math.round(-(s.cropOffsetLeft??0)*o.width/t.width),c=Math.round(-(s.cropOffsetTop??0)*o.height/t.height);return{...p,left:Math.min(Math.max(n,0),o.width-p.width),top:Math.min(Math.max(c,0),o.height-p.height)}}function Pe(e){let{alpha:r}=e;if(!r)return e.rgb;let t=new Uint8Array(e.rgb.length);for(let o=0;o<t.length;o++){let i=(r[Math.floor(o/3)]??255)/255;t[o]=Math.round(ue+((e.rgb[o]??0)-ue)*i)}return t}async function _e(e,r){if(e.op!=="convert")throw new Error(`image engine cannot ${e.op}`);let t=e.sources[0],o=e.outputs[0];if(t.kind!=="image")throw new Error("the image engine cannot convert a document source");let i=f[e.target],a=[];r({phase:"reading"});let s=t.frames>1,p=R(t,e.target);s&&!i.animatable&&a.push({code:"animation-flattened",message:`${y(t.path)} has ${t.frames} frames, and ${i.label} cannot animate. Only the first frame was converted.`});let n=e.options,c;if(n.rotate&&s)throw ee(t.path);if(n.trim||n.crop||n.resize){let h={width:t.width,height:t.height};if(n.trim&&n.crop)throw new Error("a job cannot both trim and crop");if(n.crop){if(s)throw Z(t.path);let{aspect:d}=n.crop,B=v=>v.width===t.width&&v.height===t.height,C=E(h,d),l=n.crop.box??(B(C)?C:await Le(await Ce(t),d));if(B(l)){if(!n.resize)throw Y(t.path,F(d));a.push({code:"nothing-cropped",message:`${y(t.path)} is already ${F(d)}; resized only.`});let{crop:v,...we}=n;n=we}else n={...n,crop:{aspect:d,box:l}},h={width:l.width,height:l.height}}if(n.trim){if(s)throw Q(t.path);let{trimmed:d}=await Be(t);if(d==="nothing"){if(!n.resize)throw K(t.path);a.push({code:"nothing-trimmed",message:`${y(t.path)} has no empty edges; resized only.`})}else d!=="animated"&&(h=d)}if(n.resize&&(c=T(h,n.resize),pe(c)))throw G(t.path,c)}r({phase:"decoding"});let{pipeline:m}=await g(t,e.target,n,p,void 0,c);try{await A(o),r({phase:"encoding"});let h=await k(m,e.target,n.quality,n.compress).toBuffer();if(n.compress&&h.length>=t.bytes)throw H(t.path,t.bytes,h.length);r({phase:"writing"});let d=await Re(h,o);return{job:e,outputBytes:d,warnings:a}}catch(h){throw b(h)?h:x(t.path,h)}}async function Ne(e){let r=await I(e.path,e.format);return typeof r=="string"?await xe(r):r}async function $e(e){if(e.op!=="convert")return;let r=f[e.target];if(!r.lossy&&!(r.quantisable&&e.options.compress))return;let t=e.sources[0];if(t.kind!=="image")return;let o=await Ne(t);return{ladder:[{}],measure:async i=>{let{pipeline:a}=await g(t,e.target,i,R(t,e.target),o);return(await k(a,e.target,i.quality,i.compress).toBuffer()).length}}}var ct={id:"image",reads:Oe,writes:Fe,ops:new Set(["convert"]),probe:Te,run:_e,measurer:$e};export{Ue as a,We as b,M as c,Ve as d,le as e,de as f,T as g,pe as h,k as i,Re as j,st as k,ht as l,Be as m,Ce as n,Le as o,ct as p};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as h,c as Q}from"./chunk-Q6KQWJ4J.js";import{d as L,f as b,g as X}from"./chunk-R24JCIZ5.js";import{a as J,b as _,e as R}from"./chunk-XPATZLEH.js";import{a as U,b as w}from"./chunk-DYIATUFE.js";import{a as g,d as A}from"./chunk-N6RCLJE6.js";import{g as l}from"./chunk-T37DEXUI.js";import{d as x,l as I}from"./chunk-J6AZTW62.js";import{b as $,c as N,d as D,e as d,i as B,m as z}from"./chunk-BIBDLXCG.js";import{E as k,s as C}from"./chunk-CVNYUROW.js";import{a as p,b as E,c as j}from"./chunk-H3DIRJFE.js";var O=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0;function Bt(t,e){let n=J(t);return n.includes(e)?void 0:C(t,e,n)}function G(t){return{target:t.target??"png",background:typeof t.background=="string"?t.background:"#ffffff",keepMetadata:t.keepMetadata===!0,...typeof t.output=="string"?{output:t.output}:{},...t.roots instanceof Map?{roots:t.roots}:{},...typeof t.quality=="number"?{quality:t.quality}:{}}}var W=()=>({kind:"select",id:"target",label:"Save as",default:"png",choices:[{value:"png",label:"PNG",hint:p.png.hint}]}),ot=t=>t===1?"sharp":`${t}x`,it=t=>t===1||t===3||t===4?t:2,Jt={id:"boost",label:"Boost resolution",verb:"Boosting",hint:"sharper, at its size or at 2\xD7, 3\xD7 or 4\xD7",requires:"boost",appliesTo:t=>O(t)!==void 0,unavailable:()=>"images only",options:()=>[{kind:"select",id:"scale",label:"Scale",default:"2",choices:[{value:"1",label:"Sharpen",hint:"the same size, sharper"},{value:"2",label:"2\xD7",hint:"twice the width and height"},{value:"3",label:"3\xD7",hint:"three times the width and height"},{value:"4",label:"4\xD7",hint:"four times the width and height"}]},W()],plan(t,e){let n=O(t);if(!n)return[];let o=G(e),i=it(Number(e.scale??2));return n.map(r=>({op:"boost",sources:[r],outputs:[d({sourcePath:r.path,target:o.target,suffix:ot(i),...o.output===void 0?{}:{output:o.output},...o.roots?.get(r.path)===void 0?{}:{sourceRoot:o.roots.get(r.path)}})],scale:i,target:o.target,options:{background:o.background,keepMetadata:o.keepMetadata,...o.quality===void 0?{}:{quality:o.quality}}}))}},_t={id:"remove-background",label:"Remove background",verb:"Removing",hint:"cut out the subject",requires:"remove-background",appliesTo:t=>O(t)!==void 0,unavailable:()=>"images only",options:()=>[W()],plan(t,e){let n=O(t);if(!n)return[];let o=G(e);return n.map(i=>({op:"remove-background",sources:[i],outputs:[d({sourcePath:i.path,target:o.target,suffix:"cutout",...o.output===void 0?{}:{output:o.output},...o.roots?.get(i.path)===void 0?{}:{sourceRoot:o.roots.get(i.path)}})],target:o.target,options:{background:o.background,keepMetadata:o.keepMetadata,...o.quality===void 0?{}:{quality:o.quality}}}))}};var rt=[{degrees:90,label:"90\xB0 right",suffix:"rotated-right"},{degrees:180,label:"180\xB0",suffix:"rotated-180"},{degrees:270,label:"90\xB0 left",suffix:"rotated-left"}],y=t=>t===90||t===180||t===270,Ut=(t,e)=>e===180?{...t}:{width:t.height,height:t.width},M=t=>rt.find(e=>e.degrees===t).suffix;import{dirname as at,join as H}from"node:path";var K="Same location",V="New subfolder";function st(t,e,n){return t===e?K:t===g("Desktop")?"Desktop":t===g("Downloads")?"Downloads":e!==void 0&&n!==void 0&&t===H(e,n)?V:h(t)||t}function T(t,e,n={}){return pt(at(t.path),e,n)}function pt(t,e,{subfolder:n}={}){let o=A(e.defaultOutput),i=e.lastOutput?A(e.lastOutput):void 0,r=f=>({label:st(f,t,n),path:f}),a=[r(o),...i?[r(i)]:[],r(g("Desktop")),...t===void 0?[]:[{label:K,path:t}],r(g("Downloads")),...n!==void 0&&t!==void 0?[{label:V,path:H(t,n)}]:[]],u=new Set,s=a.filter(f=>u.has(f.path)?!1:(u.add(f.path),!0));return{kind:"path",id:"destination",label:"Save to",default:o,presets:s,...i&&i!==o?{last:i}:{}}}var c=t=>typeof t=="string"&&t!==""?t:void 0;var ee=[2,1.5,1.25,.75,.5],ut=.25,dt=4,Y=-16;function q(t){return{wav:"m4a",aiff:"m4a",flac:"m4a",avi:"mp4",ogg:"opus"}[t]??t}var Z=t=>t.length===1&&t[0]?.kind==="media"?t[0]:void 0,ft=t=>t==="cut"||t==="mute"||t==="speed"||t==="resize"||t==="crop"||t==="rotate"||t==="loudness"||t==="extract"||t==="cleanup";function ct(t,e){let n=e.media??{},o=t.facts?.video,i=[];return e.extract&&i.push("audio"),n.cut&&i.push("trimmed"),n.mute&&i.push("muted"),n.cleanup?i.push("cleaned"):n.loudness!==void 0&&i.push("levelled"),n.speed!==void 0&&i.push(`${n.speed}x`),n.fps!==void 0&&i.push(`${n.fps}fps`),n.bitrate!==void 0&&i.push(`${n.bitrate}k`),e.crop&&i.push(I(e.crop.aspect)),e.resize&&i.push(o?b(l(o,e.resize)):"resized"),e.rotate&&i.push(M(e.rotate)),i.length===1?i[0]:"edited"}function mt(t,e){return t.map(n=>{let o=e.target??n.format,i={background:"#ffffff",keepMetadata:!1};e.media&&Object.keys(e.media).length&&(i.media=e.media),e.resize&&(i.resize=e.resize),e.rotate&&(i.rotate=e.rotate);let r=n.facts?.video;e.crop&&r&&(i.crop={aspect:e.crop.aspect,box:e.crop.box??x(r,e.crop.aspect)});let a=e.roots?.get(n.path),u=d({sourcePath:n.path,target:o,suffix:ct(n,e),...e.output===void 0?{}:{output:e.output},...a===void 0?{}:{sourceRoot:a}});return{op:"convert",sources:[n],outputs:[z(u,c(e.destination),c(e.name))],target:o,options:i}})}function S(t){let e={},n=t.cut;return n&&typeof n.start=="number"&&(e.cut={start:n.start,...typeof n.end=="number"?{end:n.end}:{}}),t.mute===!0&&(e.mute=!0),typeof t.speed=="number"&&(e.speed=t.speed),typeof t.fps=="number"&&(e.fps=t.fps),typeof t.bitrate=="number"&&(e.bitrate=t.bitrate),typeof t.loudness=="number"&&(e.loudness=t.loudness),t.cleanup===!0&&(e.cleanup=!0),Object.keys(e).length?e:void 0}var ne={id:"media-edit",label:"Edit",verb:"Editing",hint:"trim, mute, speed, resize, rotate, crop",appliesTo:t=>Z(t)!==void 0,unavailable:()=>"one video or audio file",options:()=>[],plan(t,e){let n=Z(t);if(!n||!ft(e.tool))return[];let o=e.tool,i={...typeof e.output=="string"?{output:e.output}:{},destination:e.destination,name:e.name};if(o==="cut"){let r=S(e)?.cut;if(!r)return[];i.media={cut:r}}if(o==="mute"&&(i.media={mute:!0}),o==="speed"){let r=e.speed;if(typeof r!="number"||r===1||r<ut||r>dt)return[];i.media={speed:r}}if(o==="loudness"&&(i.media={loudness:typeof e.loudness=="number"?e.loudness:Y}),o==="cleanup"){if(!n.facts?.audio)return[];i.media={cleanup:!0,loudness:Y}}if(o==="extract"){let r=n.facts?.audio;if(!r||!n.facts?.video)return[];i.extract=!0,i.target=Q(r.codec)}if(o==="resize"){if(typeof e.resize!="object"||e.resize===null)return[];i.resize=e.resize}if(o==="rotate"){if(!n.facts?.video||!y(e.turn))return[];i.rotate=e.turn}if(o==="crop"){let r=e.crop;if(!r?.aspect||!n.facts?.video)return[];i.crop=r}return mt([n],i)}};import{dirname as lt,join as gt}from"node:path";var ht=t=>p[t.format].media==="video",bt=t=>t.length===1&&t[0]?.kind==="image"?t[0]:void 0,yt=t=>t.length===1&&t[0]?.kind==="document"?t[0]:void 0,St="-small",m={min:30,max:100,step:35},kt=t=>{let e=Math.ceil((t-m.min)/m.step);return Math.min(m.max,m.min+Math.max(0,e)*m.step)},fe={id:"compress",label:"Compress",verb:"Compressing",hint:"make it smaller",appliesTo:t=>{if(t.length===1&&t[0]?.kind==="media")return!0;let e=bt(t);if(e!==void 0){let o=p[e.format];return o.lossy||o.quantisable===!0}return(yt(t)?.images?.compressible??0)>0},options(t,e,n){let o=t[0];if(!o)return[];let i=[{kind:"select",id:"mode",label:`Compress ${h(o.path)??"this file"}`,choices:[o.kind==="media"?{value:"quality",label:"By quality"}:{value:"quality",label:"By quality",hint:"pick a level, see the result"},{value:"size",label:"To a target size",hint:"smallest quality that fits"}],default:"quality"}];if(e.mode==="quality"&&o.kind==="media"&&!ht(o))i.push({kind:"slider",id:"bitrate",label:"Quality",min:32,max:320,step:32,default:96});else if(e.mode==="quality"){let r=o.kind==="image"&&p[o.format].quantisable===!0;i.push(r?{kind:"slider",id:"quality",label:"Quality",...m,default:kt(n.quality),points:!0}:{kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality})}else if(e.mode==="size")i.push({kind:"text",id:"size",label:"Target size",placeholder:"e.g. 500kb or 2mb"});else return i;return i.push(T(o,n)),i},plan(t,e){let n=e.mode;if(n!=="quality"&&n!=="size")throw k(`compressAction.plan() needs a mode of "quality" or "size", got ${JSON.stringify(n)}.`,"This is a caller bug, not a user-facing condition: walk options() before calling plan().");let o=t[0];if(!o)return[];let i=(h(o.path)??"file").replace(/\.[^.]+$/,""),r=typeof e.destination=="string"?e.destination:lt(o.path),a=o.kind==="media"?q(o.format):o.format,u=gt(r,$(i,`${St}${j(a)}`)),s=o.kind==="media"?S(e):void 0;return[{op:"convert",sources:[o],target:a,outputs:[u],options:{background:"#ffffff",keepMetadata:!1,...n==="quality"&&typeof e.quality=="number"?{quality:e.quality}:{},compress:{dither:e.dither===!0},...s?{media:s}:{}}}]}};function xt(t){return{kind:"select",id:"pages",label:"Pages",default:"all",choices:[{value:"all",label:"All pages",hint:`${t.pages} pages`},{value:"first",label:"First page only"},{value:"choose",label:"Choose pages",hint:"pick which ones"}]}}function It(){return{kind:"select",id:"dpi",label:"Resolution",default:"150",choices:[{value:"72",label:"72 dpi",hint:"screen"},{value:"150",label:"150 dpi",badge:"default"},{value:"300",label:"300 dpi",hint:"print"}]}}function zt(t,e){return Array.isArray(e)?w(e):e==="first"?[0]:typeof e=="string"&&e!=="all"&&e!==""?w(U(e,t.pages)):Array.from({length:t.pages},(n,o)=>o)}function Ot(t,e){let n=p[t.format].lossy,o=p[e].lossy;if(n&&!o)return{hint:"likely bigger",tone:"warn"};if(!n&&o)return{hint:"likely smaller",tone:"ok"}}function Mt(t){let e=_(t).filter(o=>o.id!==t.format),n=e[0];return{kind:"select",id:"target",label:`Convert ${p[t.format].label} to`,choices:e.map(o=>{let i=Ot(t,o.id);return{value:o.id,label:o.label,hint:i?.hint??o.hint,...i===void 0?{}:{tone:i.tone}}}),default:n?n.id:""}}function Tt(t){return{kind:"slider",id:"bitrate",label:"Quality",min:64,max:320,step:32,default:t==="opus"?96:128}}var Ft=t=>typeof t=="object"&&t!==null&&("percent"in t||"width"in t||"height"in t);function At(t){let e=t.target,n=typeof e=="string"?E(e):void 0;if(!n)throw k(`convertAction.plan() requires a valid target format, got ${JSON.stringify(e)}.`,"This is a caller bug, not a user-facing condition: call options() and pass one of the target select choices before calling plan().");return n}var ke={id:"convert",label:"Convert",verb:"Converting",hint:"to another format",appliesTo:t=>t.length>=1,options(t,e,n){let o=t[0];if(!o)return[];let i=[Mt(o)],r=e.target;if(typeof r!="string")return i;o.kind==="document"&&R(r)&&i.push(xt(o),It());let a=p[r];return o.kind==="media"?a?.media==="sound"&&a.lossy&&i.push(Tt(r)):a?.lossy&&a.media===void 0&&i.push({kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality}),i.push(T(o,n)),i},plan(t,e){let n=t[0];if(!n)return[];let o=At(e),i=o.id,r={background:typeof e.background=="string"?e.background:"#ffffff",keepMetadata:e.keepMetadata===!0};if(o.lossy&&typeof e.quality=="number"&&(r.quality=e.quality),n.kind==="media"){let s=S(e);s&&(r.media=s),Ft(e.resize)&&(r.resize=e.resize)}let a=typeof e.destination=="string"?e.destination:void 0;if(n.kind==="document"&&R(i)){let s=Number(e.dpi);r.dpi=Number.isFinite(s)&&s>0?s:150;let f=zt(n,e.pages);r.pages=f;let et=typeof e.sourceRoot=="string"?e.sourceRoot:void 0,nt=B(n.path,f,i,a,et);return[{op:"convert",sources:[n],outputs:nt,target:i,options:r}]}let u=D({sourcePath:n.path,target:i,...a===void 0?{}:{output:`${a}/`}});return N(u,n.path)&&(u=d({sourcePath:n.path,target:i,suffix:i,...a===void 0?{}:{output:`${a}/`}})),[{op:"convert",sources:[n],outputs:[u],target:i,options:r}]}};function Rt(t,e){if(!e.rotate)return v(t,e);let n=M(e.rotate);return e.trim||e.crop||e.resize?`${v(t,e)}-${n}`:n}function v(t,e){if(e.crop){let n=I(e.crop.aspect);if(!e.resize)return n;let o=e.crop.box??x(t,e.crop.aspect);return`${n}-${b(l(o,e.resize))}`}return e.trim&&e.resize?`trimmed-${X(e.resize)}`:e.resize?b(l(t,e.resize)):"trimmed"}function wt(t,e){if(e.trim&&e.crop)throw new Error("planEdit cannot trim and crop the same image");return t.map(n=>{let o=e.target??L(n),i={background:e.background,keepMetadata:e.keepMetadata,...e.quality===void 0?{}:{quality:e.quality},...e.trim?{trim:!0}:{},...e.resize?{resize:e.resize}:{},...e.crop?{crop:e.crop}:{},...e.rotate?{rotate:e.rotate}:{}},r=e.roots?.get(n.path),a=d({sourcePath:n.path,target:o,suffix:Rt(n,e),...e.output===void 0?{}:{output:e.output},...r===void 0?{}:{sourceRoot:r}});return{op:"convert",sources:[n],outputs:[z(a,c(e.destination),c(e.name))],target:o,options:i}})}var P=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0,Pt=t=>typeof t=="object"&&t!==null&&("percent"in t||"width"in t||"height"in t),tt=t=>typeof t=="object"&&t!==null&&"aspect"in t&&typeof t.aspect=="object"&&t.aspect!==null&&"w"in t.aspect&&"h"in t.aspect;function F(t,e,n,o){return{id:t,label:e,verb:n,hint:o,appliesTo:i=>P(i)?.every(r=>t==="resize"||r.frames<=1)===!0,unavailable:i=>P(i)?"animated":"images only",options:()=>[],plan(i,r){let a=P(i);return a?t==="crop"&&!tt(r.crop)?[]:t==="turn"&&!y(r.turn)?[]:wt(a,{trim:t==="trim"||r.trim===!0,...y(r.turn)?{rotate:r.turn}:{},...Pt(r.resize)?{resize:r.resize}:{},...tt(r.crop)?{crop:r.crop}:{},...typeof r.target=="string"?{target:r.target}:{},...typeof r.output=="string"?{output:r.output}:{},...r.roots instanceof Map?{roots:r.roots}:{},destination:r.destination,name:r.name,background:typeof r.background=="string"?r.background:"#ffffff",keepMetadata:r.keepMetadata===!0,...typeof r.quality=="number"?{quality:r.quality}:{}}):[]}}}var Fe=F("trim","Trim edges","Trimming edges","cut empty borders"),Ae=F("resize","Resize","Resizing","smaller or larger"),Re=F("crop","Crop to shape","Cropping","change the shape"),we=F("turn","Rotate","Rotating","turn it");export{Bt as a,Jt as b,_t as c,V as d,T as e,pt as f,c as g,rt as h,Ut as i,ee as j,mt as k,ne as l,fe as m,ke as n,wt as o,Fe as p,Ae as q,Re as r,we as s};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
-
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d}from"./chunk-CW2Y2KDQ.js";import"./chunk-ZOQA3JAR.js";import"./chunk-TYWGB767.js";import"./chunk-J2UQI544.js";import"./chunk-W2QJA73Q.js";import"./chunk-ZHNPBRCX.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-SNFUGJ3M.js";import"./chunk-XUKYIVJC.js";import"./chunk-GRWOJKQB.js";import"./chunk-IED6VBE6.js";import"./chunk-R24JCIZ5.js";import"./chunk-XPATZLEH.js";import"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import"./chunk-RK3WGALB.js";import"./chunk-O7DK3GJT.js";import"./chunk-DYIATUFE.js";import"./chunk-EEQSUBBL.js";import"./chunk-LA5JVBFP.js";import"./chunk-K6ERQTUQ.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-T37DEXUI.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{b as clipLines,a as runClip,d as runClipCommand,c as runUndo};
|