conformtools 0.6.8 → 0.6.9
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/dist/{account-NJSA4N67.js → account-M53GEV7P.js} +1 -1
- package/dist/{bridge-UIDAF74E.js → bridge-SX5TW4LC.js} +1 -1
- package/dist/{chunk-LGUO7PL5.js → chunk-5BSXYKLN.js} +1 -1
- package/dist/{chunk-7SENYEIV.js → chunk-623EA3TK.js} +1 -1
- package/dist/{chunk-BW4LRTHG.js → chunk-DQGINJDV.js} +1 -1
- package/dist/{chunk-SYX6W5TS.js → chunk-GRQJGEGV.js} +4 -4
- package/dist/{chunk-F74QMWXE.js → chunk-GTJ3EM6H.js} +1 -1
- package/dist/{chunk-IPFPZBSC.js → chunk-HNBA43BF.js} +1 -1
- package/dist/{chunk-MS3AWOSG.js → chunk-MWDF2R26.js} +2 -2
- package/dist/{chunk-H6WZ43NS.js → chunk-QVH44I66.js} +2 -2
- package/dist/chunk-XCKQHL4G.js +9 -0
- package/dist/cli.js +1 -1
- package/dist/{framing-7LAOPOED.js → framing-3XIVHSUZ.js} +1 -1
- package/dist/{host-relink-UOS3P5SL.js → host-relink-UWML4C7W.js} +1 -1
- package/dist/{hosts-66KSLCFJ.js → hosts-SRS5TEM6.js} +1 -1
- package/dist/http.js +2 -2
- package/dist/mcp.js +1 -1
- package/dist/{store-EXUE5XX5.js → store-53BBZBND.js} +1 -1
- package/dist/{timeline-GVVL2CBI.js → timeline-C3OZJBCZ.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-JZY2BHQB.js +0 -9
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m}from"./chunk-
|
|
3
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m}from"./chunk-XCKQHL4G.js";import"./chunk-PHAMF4JF.js";import"./chunk-PLRB2YXJ.js";import"./chunk-PSANHDZM.js";export{b as NET_TIMEOUT_MS,c as _forgetOffline,d as accessToken,e as accountStatus,a as config,g as includesOf,l as login,m as logout,k as requireApp,i as requireEntitled,j as requireMcp,h as setAccountGate,f as statusText};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i}from"./chunk-
|
|
3
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i}from"./chunk-5BSXYKLN.js";import"./chunk-PLRB2YXJ.js";import"./chunk-PSANHDZM.js";export{c as BridgeError,g as HostBridge,e as PANEL_PREFIX,b as PORTS,a as PROTOCOL,h as hostBridge,d as pairingPath,f as panelOrigins,i as resetHostBridge};
|
|
@@ -17,4 +17,4 @@ Sec-WebSocket-Version: 13\r
|
|
|
17
17
|
`));let p=m.alloc(0),u=f=>{p=m.concat([p,f]);let l=p.indexOf(`\r
|
|
18
18
|
\r
|
|
19
19
|
`);if(l<0)return;c.off("data",u);let d=p.subarray(0,l).toString("latin1").split(`\r
|
|
20
|
-
`),h=d.find(y=>/^sec-websocket-accept:/i.test(y))?.split(":")[1]?.trim();if(!/^HTTP\/1\.1 101/.test(d[0])||h!==t)return i(new Error(`${a.host} refused the WebSocket upgrade: ${d[0]}`));c.setTimeout(0),c.off("error",i);let g=p.subarray(l+4),v=J(c,null,e.maxBytes,!0);g.length&&c.emit("data",g),s(v)};c.on("data",u)})}import{existsSync as te,readFileSync as ne}from"node:fs";var $="0.6.
|
|
20
|
+
`),h=d.find(y=>/^sec-websocket-accept:/i.test(y))?.split(":")[1]?.trim();if(!/^HTTP\/1\.1 101/.test(d[0])||h!==t)return i(new Error(`${a.host} refused the WebSocket upgrade: ${d[0]}`));c.setTimeout(0),c.off("error",i);let g=p.subarray(l+4),v=J(c,null,e.maxBytes,!0);g.length&&c.emit("data",g),s(v)};c.on("data",u)})}import{existsSync as te,readFileSync as ne}from"node:fs";var $="0.6.9";function Q(o,e){let a=o.split("-")[0].split(".").map(Number),n=e.split("-")[0].split(".").map(Number);for(let t=0;t<Math.max(a.length,n.length);t++){let s=(a[t]||0)-(n[t]||0);if(s)return s>0}return!1}var Z=null;function q(){return N("CONFORM_UPDATE_CHECK")==="off"?Promise.resolve(null):Z??=fetch("https://registry.npmjs.org/conformtools/latest",{signal:AbortSignal.timeout(2e3)}).then(o=>o.ok?o.json():null).then(o=>typeof o?.version=="string"?o.version:null).catch(()=>null)}var ee="run npx -y --prefer-online conformtools@latest mcp (in the MCP client config too; --prefer-online makes npx re-check npm instead of reusing its cached copy), then restart the MCP client; if an old global install is shadowing it: npm rm -g conformtools";async function ve(){let o=await q();return`conformtools ${$}`+(o&&Q(o,$)?` \u2014 update available: ${o} \u2192 ${ee}`:"")}var k=1,re=[48127,48128,48129,48130,48131,48132,48133,48134],oe=5e3,V=4,se=8*1024*1024,b=class extends Error{constructor(a,n){super(n);this.code=a}},_=()=>P(A(),"host-bridge","pairing.json"),B="/avid-panel/",ie="/avid-panel/pairing",G="avid",z={"index.html":"text/html; charset=utf-8","panel.js":"text/javascript; charset=utf-8","panel.css":"text/css; charset=utf-8","icon.svg":"image/svg+xml"},ae="default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self' ws://localhost:{port} ws://127.0.0.1:{port} http://localhost:* http://127.0.0.1:* https://localhost:* https://127.0.0.1:*; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",X=o=>[`http://localhost:${o}`,`http://127.0.0.1:${o}`];function ce(){for(let o of["./avid/panel/web-dist/","./avid-panel/"]){let e=O(new URL(o,import.meta.url));if(te(P(e,"index.html")))return e}return null}function le(){let o=new Uint8Array(32);return crypto.getRandomValues(o),Array.from(o,e=>e.toString(16).padStart(2,"0")).join("")}var H=class{constructor(){this.token=le();this.port=0;this.live=new Map;this.waiters=[];this.seq=0;this.events=[]}async start(e=re){let a;for(let n of e)try{this.server=await F({hostname:"127.0.0.1",port:n,path:"/host-bridge",maxBytes:se,onHttp:(t,s,r)=>this.servePanel(t,s,r)},t=>this.accept(t)),this.port=this.server.port;break}catch(t){a=t}if(!this.server)throw new b("no_port",`every host-bridge port (${e.join(", ")}) is taken: ${a}`);await W(P(A(),"host-bridge")),await M(_(),JSON.stringify({protocol:k,url:`ws://127.0.0.1:${this.port}/host-bridge`,port:this.port,token:this.token})),await L(_(),384)}async stop(){for(let e of this.live.values())e.conn.close(1001,"engine stopping");this.live.clear(),await this.server?.close();try{JSON.parse(await R(_())).token===this.token&&await I(_())}catch{}}peers(){return[...this.live.values()].map(e=>e.peer)}peer(e){return this.live.get(e)?.peer}async waitFor(e,a){return this.live.has(e)?this.peer(e):(await Promise.race([new Promise(n=>this.waiters.push({host:e,resolve:n})),new Promise(n=>setTimeout(n,a))]),this.peer(e))}request(e,a,n={},t=3e4){let s=this.live.get(e);if(!s)return Promise.reject(new b("not_connected",`${e}: its panel is not connected`));let r=`r${++this.seq}`;return new Promise((c,i)=>{let p=setTimeout(()=>{s.pending.delete(r),i(new b("timeout",`${e}: no answer to ${a} within ${Math.round(t/1e3)} s`))},t);s.pending.set(r,{resolve:c,reject:i,timer:p}),s.conn.send(JSON.stringify({type:"request",id:r,method:a,params:n}))})}servePanel(e,a,n){let t=(e.url??"").split("?")[0];if(!t.startsWith(B)&&t!==B.slice(0,-1))return!1;let s=(f,l,d,h=!1)=>{let g=typeof d=="string"?new TextEncoder().encode(d):d;return a.writeHead(f,{"content-type":l,"content-length":String(g.length),"cache-control":"no-store","x-content-type-options":"nosniff","referrer-policy":"no-referrer","cross-origin-resource-policy":"same-origin","x-frame-options":"DENY","content-security-policy":ae.replaceAll("{port}",String(n))}),a.end(h?void 0:g),!0},r=(f,l)=>s(f,"text/plain; charset=utf-8",l),c=f=>{let l=e.headers[f];return typeof l=="string"?l:void 0},i=(c("host")??"").toLowerCase();if(i!==`localhost:${n}`&&i!==`127.0.0.1:${n}`)return r(421,"misdirected request");if(t===ie)return e.method==="POST"&&X(n).includes(c("origin")??"")&&(c("sec-fetch-site")??"same-origin")==="same-origin"&&c("x-ct-panel")==="1"&&(c("content-length")??"0").trim()==="0"?s(200,"application/json",JSON.stringify({protocol:k,url:`ws://localhost:${n}/host-bridge`,port:n,token:this.token})):r(403,"forbidden");if(e.method!=="GET"&&e.method!=="HEAD")return r(405,"method not allowed");let p=t.slice(B.length)||"index.html",u=ce();return!z[p]||!u?r(404,"not found"):s(200,z[p],ne(P(u,p)),e.method==="HEAD")}accept(e){let a=!!e.origin&&X(this.port).includes(e.origin);if(e.origin&&/^https?:/i.test(e.origin)&&!a){e.send(JSON.stringify({type:"error",code:"origin_refused",message:"web pages may not use the host bridge"})),e.close(1008,"origin");return}let n=null,t=setTimeout(()=>{n||(e.send(JSON.stringify({type:"error",code:"hello_timeout",message:"no hello"})),e.close(1008,"hello"))},oe);e.onMessage(s=>{let r;try{r=JSON.parse(s)}catch{return}if(!n){let i=(l,d)=>{clearTimeout(t),e.send(JSON.stringify({type:"error",code:l,message:d})),e.close(1008,l)};if(r.type!=="hello")return i("hello_expected","the first frame must be hello");if(r.protocol!==k)return i("protocol_mismatch",`this engine speaks protocol ${k}`);if(r.token!==this.token)return i("bad_token","the pairing token does not match: re-read the pairing file");let p=r.host??{},u=String(p.id??"");if(!/^[a-z][a-z0-9_-]{1,31}$/.test(u))return i("bad_host","host.id is missing or malformed");if(a&&u!==G)return i("origin_mismatch",`a connection from the panel page may only be host ${G}`);if(!this.live.has(u)&&this.live.size>=V)return i("too_many_peers",`at most ${V} panels`);clearTimeout(t),this.live.get(u)?.conn.close(1e3,"replaced by a newer connection"),n=u;let f={id:u,name:String(p.name??u),version:String(p.version??""),platform:String(p.platform??""),capabilities:Array.isArray(r.capabilities)?r.capabilities.map(String):[],optional_verbs:Array.isArray(r.optional_verbs)?r.optional_verbs.map(String):[]};this.live.set(u,{peer:f,conn:e,pending:new Map}),e.send(JSON.stringify({type:"welcome",protocol:k,app:{name:"conformtools",version:$}})),this.waiters=this.waiters.filter(l=>l.host===u?(l.resolve(),!1):!0);return}let c=this.live.get(n);if(!(!c||c.conn!==e))if(r.type==="response"){let i=c.pending.get(String(r.id));if(!i)return;if(c.pending.delete(String(r.id)),clearTimeout(i.timer),r.ok)i.resolve(r.result??null);else{let p=r.error??{};i.reject(new b(p.code??"peer_error",`${n}: ${p.message??p.code??"error"}`))}}else r.type==="event"&&(this.events.push({host:n,name:String(r.name),data:r.data}),this.events.length>200&&this.events.shift())}),e.onClose(()=>{if(clearTimeout(t),!n)return;let s=this.live.get(n);if(s?.conn===e){for(let r of s.pending.values())clearTimeout(r.timer),r.reject(new b("disconnected",`${n}: the panel disconnected`));this.live.delete(n)}})}},E=null;function Pe(){return E??=(async()=>{let o=new H;return await o.start(),o})(),E.catch(()=>{E=null}),E}function ke(){E=null}export{$ as a,Q as b,q as c,ee as d,ve as e,de as f,k as g,re as h,b as i,_ as j,B as k,X as l,H as m,Pe as n,ke as o};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{M as D,N as F,O as N}from"./chunk-H6WZ43NS.js";import{n as P}from"./chunk-LGUO7PL5.js";import{B as C,D as M,E as T,H as q,I,L as w,V as b,X as k,Y as _,_ as L,g as v,k as O,p as S,q as A,r as y,s as x,v as H,x as E,y as R}from"./chunk-PLRB2YXJ.js";var B=16e3,h=class extends Error{constructor(t,i){super(i);this.code=t}},j=class d{constructor(e,t=P,i=B){this.spec=e;this.bridge=t;this.waitMs=i;this.renders=new Map;this.host=e.host,e.items&&(this.items=n=>this.modelItems(n??{}))}async peer(){let e=await(await this.bridge()).waitFor(this.host,this.waitMs);if(!e)throw new h("not_connected",`${this.host}: the conform.tools plugin in ${this.spec.label} is not connected. ${this.spec.setup}`);return e}async needs(e){let t=await this.peer();if(!t.capabilities.includes(e))throw new h("panel_old",`${this.host}: the conform.tools plugin open in ${this.spec.label} ${t.version||""} has no ${e} (an older plugin); update it (${this.spec.setup})`);return t}async ask(e,t={},i){return await this.peer(),await(await this.bridge()).request(this.host,e,t,i)}static{this.announced=(e,t)=>e.optional_verbs.includes(t)}async support(){let e={ok:!1,reason:"the renderplugin is a DaVinci Resolve plugin"},t;try{t=await(await this.bridge()).waitFor(this.host,Math.min(3e3,this.waitMs))}catch(s){let a={ok:!1,reason:s instanceof Error?s.message:String(s)};return{export:a,open:a,render:a,markers:a,renderplugin:e}}if(!t){let s={ok:!1,reason:`the conform.tools plugin in ${this.spec.label} is not connected`,setup:this.spec.setup};return{export:s,open:s,render:s,markers:s,renderplugin:e}}let i=(s,a)=>s?{ok:!0}:{ok:!1,reason:`this plugin version has no ${a}`},n=t.capabilities;return{export:i(n.includes("timeline_read")||n.includes("timeline_write"),"timeline_read"),open:i(d.announced(t,"timeline_write.import_file"),"timeline_write.import_file"),render:i(n.includes("render"),"render"),markers:i(n.includes("markers"),"markers"),renderplugin:e}}async current(){let e=await this.ask("session.current_project");if(!e)return{project:"",timelines:[],timeline:""};let t=await this.ask("session.timeline_count",{project:e}),i=[];for(let s=1;s<=t;s++){let a=await this.ask("session.timeline_by_index",{project:e,index:s});a&&i.push(await this.ask("session.name",{handle:a}))}let n=await this.ask("session.current_timeline",{project:e});return{project:await this.ask("session.name",{handle:e}),timelines:i,timeline:n?await this.ask("session.name",{handle:n}):""}}async project(e={}){let t=await this.current();return{project:t.project,timeline:e.timeline??t.timeline,timelines:t.timelines,tracks:[],jobs:[],found:{},pool:{path:"",clips:0,folders:[]}}}async sequence(e){let t=await this.ask("session.current_project");if(!t)throw new h("no_project",`${this.host}: no project is open`);if(!e){let s=await this.ask("session.current_timeline",{project:t});if(!s)throw new h("no_timeline",`${this.host}: no timeline is active`);return{project:t,seq:s,name:await this.ask("session.name",{handle:s})}}let i=await this.ask("session.timeline_count",{project:t}),n=[];for(let s=1;s<=i;s++){let a=await this.ask("session.timeline_by_index",{project:t,index:s});if(!a)continue;let p=await this.ask("session.name",{handle:a});if(p===e)return{project:t,seq:a,name:p};n.push(p)}throw new h("not_found",`${this.host}: no timeline named "${e}" (have: ${n.join(", ")})`)}async model(e){let{project:t,seq:i}=await this.sequence(e);return await this.ask("timeline_read.model",{timeline:i,project:t},12e4)}async export(e){if(!e.out_path)throw new h("usage",`${this.host}: export needs out_path`);let t=await this.peer(),{project:i,seq:n,name:s}=await this.sequence(e.timeline),a=await this.ask("session.name",{handle:i}),p=r=>d.announced(t,r),m=e.out_path,l,c=[];if(p("timeline_write.export_otio")||p("timeline_write.export_xml")){let r=p("timeline_write.export_otio"),o=await this.ask(r?"timeline_write.export_otio":"timeline_write.export_xml",{project:i,timeline:n,path:e.out_path},12e4);if(l=o.format??(r?"otio":"xmeml"),o.ok===!1)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${e.out_path}${o.errors?.length?` (${o.errors.join("; ")})`:""}`);o.path&&o.path!==e.out_path&&(m=await this.adopt(o.path,e.out_path)),c=o.warnings??[]}else if(p("timeline_read.export_file")){let r=await this.ask("timeline_read.export_file",{timeline:n,fmt:"otio",path:e.out_path},12e4);if(!r)throw new h("export_failed",`${this.host}: ${this.spec.label} exported no OTIO`);l="otio",r!==e.out_path&&(m=await this.adopt(r,e.out_path))}else{await this.needs("timeline_read");let r=await this.ask("timeline_read.model",{timeline:n,project:i},12e4),o=J(r);await E(e.out_path,JSON.stringify(o.otio)),l="otio",c=o.notes}if(!D.includes(l))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${l}, which the engine does not read (${m})`);if(!await x(m)||(await A(m)).size===0)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${m}`);return{path:m,format:l,project:a,timeline:s,...c.length?{notes:c}:{}}}async adopt(e,t){let i=k(e)&&k(e)!==k(t)?t.slice(0,t.length-k(t).length)+k(e):t;if(await C(e,i),!F(i))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${b(e)}, which the engine does not read`);return i}async open(e){if(e.into==="scratch")throw new h("unsupported",`${this.host}: opening into a scratch project is not supported; the import lands in the open project`);let t=await this.peer();if(!d.announced(t,"timeline_write.import_file"))throw new h("unsupported",`${this.host}: this conform.tools plugin cannot import timelines (${this.spec.setup})`);let i=await this.ask("session.current_project");if(!i)throw new h("no_project",`${this.host}: no project is open`);let n=await this.ask("timeline_write.import_file",{project:i,path:e.path,sequences:null},3e5);if(!n.ok)throw new h("import_failed",`${this.host}: ${this.spec.label} did not import ${e.path}${n.issues?.length?` (${n.issues.join("; ")})`:""}`);let s=[...n.issues??[]];return n.imported.length>1&&s.push(`imported ${n.imported.length} timelines: ${n.imported.map(a=>a.name).join(", ")}`),e.name&&s.push(`${this.spec.label} names imported timelines after the file's own; name was not applied`),e.media_dirs?.length&&s.push(`${this.spec.label} links media from the paths in the file; media_dirs was not used (relink with timeline_relink before writing)`),{project:await this.ask("session.name",{handle:i}),timeline:n.imported[0]?.name??b(e.path),notes:s,restored:!e.stay,...n.bin?{folder:n.bin}:{}}}async modelItems(e){let t=await this.model(e.timeline),i=[...e.kind==="audio"?[]:t.items.map(n=>({kind:"video",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:n.handle?.$h??n.clip_id??"",name:n.name??"",color:n.color??"",flags:n.flags??[],enabled:n.enabled??!0,file:n.file_path})),...e.kind==="video"?[]:(t.audio_items??[]).map(n=>({kind:"audio",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:"",name:n.name??"",file:n.file_path??""}))].filter(n=>e.track===void 0||n.track===e.track);return{project:(await this.current()).project,timeline:t.timeline,start_frame:t.start_frame,fps:t.fps,items:i,color_groups:[],layers:1}}async apply(e){let{project:t,seq:i,name:n}=await this.sequence(e.timeline),s=[],a=[],p=l=>l.op.startsWith("marker_")&&!l.item;for(let l=0;l<e.ops.length;){let c=l;for(;c<e.ops.length&&p(e.ops[c])===p(e.ops[l]);)c++;let r=e.ops.slice(l,c),o=p(r[0])?await this.markerOps(i,r):await this.clipOps(i,r,e.timeline);s.push(...o.results),a.unshift(...o.undo),l=c}let m=s.filter(l=>l.ok).length;return{project:await this.ask("session.name",{handle:t}),timeline:n,results:s,undo:a,applied:m,failed:s.length-m}}async clipOps(e,t,i){let n=await this.peer();if(n.capabilities.includes("edit"))return await this.ask("edit.apply",{timeline:e,ops:t},6e4+t.length*500);let s=(c,r)=>({op:c.op,ok:!1,detail:r});if(!n.capabilities.includes("item_meta"))return{results:t.map(c=>s(c,`${this.host}: clip edits are not reachable over this plugin`)),undo:[]};let a=await this.model(i),p=c=>c?"id"in c?{$h:c.id}:(c.kind??"video")!=="video"?null:a.items.find(r=>r.track===c.track&&r.start-a.start_frame===c.start)?.handle??null:null,m=[],l=[];for(let c of t){let r=p(c.item);try{if(!r)m.push(s(c,`no video item at ${JSON.stringify(c.item??null)}`));else if(c.op==="clip_color"){let o=await this.ask("item_meta.color",{handle:r}),u=c.color?await this.ask("item_meta.set_color",{handle:r,color:c.color}):await this.ask("item_meta.clear_color",{handle:r});m.push({op:c.op,ok:u}),u&&l.unshift({op:"clip_color",item:c.item,color:o})}else if(c.op==="enabled"&&d.announced(n,"item_meta.set_enabled")){let o=a.items.find(f=>f.handle?.$h===r.$h)?.enabled??!0,u=await this.ask("item_meta.set_enabled",{item:r,enabled:!!c.on});m.push({op:c.op,ok:u}),u&&l.unshift({op:"enabled",item:c.item,on:o})}else m.push(s(c,`${this.host}: '${c.op}' is not reachable over this plugin`))}catch(o){m.push(s(c,o instanceof Error?o.message:String(o)))}}return{results:m,undo:l}}async markerOps(e,t){let i=await this.peer(),n=r=>d.announced(i,r),s=new Map((await this.ask("markers.list",{target:e})).map(r=>[r.frame,r])),a=[],p=[],m=async r=>{let o=await this.ask("markers.add",{target:e,frame:r.frame,color:r.color??"",name:r.name??"",note:r.note??"",duration:r.duration??1,custom_data:r.custom_data??""});return o&&s.set(r.frame,{color:"",name:"",note:"",duration:1,...r}),o},l=async r=>{let o=await this.ask("markers.delete_at",{target:e,frame:r});return o&&s.delete(r),o},c=r=>({op:"marker_add",frame:r.frame,color:r.color,name:r.name,note:r.note,duration:r.duration,...r.custom_data?{data:r.custom_data}:{}});for(let r of t){let o=Number(r.frame);try{if(r.op==="marker_add"){let u=s.get(o);u&&await l(o);let f=await m({frame:o,color:r.color,name:r.name,note:r.note,duration:Number(r.duration??1),custom_data:r.data});a.push({op:r.op,ok:f}),f&&p.unshift(...u?[c(u)]:[],{op:"marker_delete",frame:o})}else if(r.op==="marker_update"){let u=s.get(o);if(!u){a.push({op:r.op,ok:!1,detail:`no marker at frame ${o}`});continue}let f=r.to_frame!==void 0?Number(r.to_frame):o,$={...u,frame:f,...r.color!==void 0?{color:String(r.color)}:{},...r.name!==void 0?{name:String(r.name)}:{},...r.note!==void 0?{note:String(r.note)}:{}},g=!0;n("markers.set_color")&&n("markers.set_text")&&n("markers.move")?(r.color!==void 0&&(g=await this.ask("markers.set_color",{target:e,frame:o,color:r.color})&&g),(r.name!==void 0||r.note!==void 0)&&(g=await this.ask("markers.set_text",{target:e,frame:o,name:r.name,note:r.note})&&g),f!==o&&(g=await this.ask("markers.move",{target:e,frame:o,to_frame:f})&&g),s.delete(o),s.set(f,$)):g=await l(o)&&await m($),a.push({op:r.op,ok:g}),p.unshift({op:"marker_update",frame:f,color:u.color,name:u.name,note:u.note,...f!==o?{to_frame:o}:{}})}else if(r.op==="marker_delete"){let u=s.get(o),f=!!u&&await l(o);a.push({op:r.op,ok:f,...u?{}:{detail:`no marker at frame ${o}`}}),f&&u&&p.unshift(c(u))}else a.push({op:r.op,ok:!1,detail:`${this.host}: '${r.op}' is not reachable over this plugin`})}catch(u){a.push({op:r.op,ok:!1,detail:u instanceof Error?u.message:String(u)})}}return{results:a,undo:p}}async renderStart(e){if(await this.needs("render"),e.renderplugin)throw new h("unsupported","the renderplugin is a DaVinci Resolve plugin");if(e.disable_tracks?.length||e.audio_tracks?.length)throw new h("unsupported",`${this.host}: disable_tracks / audio_tracks are DaVinci Resolve's; pick a preset that renders what you need`);if(!e.preset)throw new h("usage",`${this.host}: preset is required: one of ${this.spec.label}'s export presets by name`);let{seq:t,name:i}=await this.sequence(e.timeline),n=e.name??i,s={purpose:"deliver",format:"preset",preset:e.preset,target_dir:e.target_dir,name:n,...e.range?{range:[e.range.in,e.range.out]}:{}},a=await this.ask("render.submit",{timeline:t,job:s});if(!a?.id)throw new h("render_refused",`${this.host}: ${a?.error??`${this.spec.label} refused the render`}`);if(!await this.ask("render.start",{job_ids:[a.id]}))throw new h("render_refused",`${this.host}: ${this.spec.label} did not start job ${a.id}`);return this.renders.set(a.id,{dir:e.target_dir,name:n}),{job_id:a.id,state:"queued",percent:0}}async renderStatus(e){let t=await this.ask("render.status",{job_id:e});if(!t)return{job_id:e,state:"failed",percent:0,error:`${this.host}: no render job ${e}`};let i={done:"complete",rendering:"rendering",queued:"queued",failed:"failed",cancelled:"cancelled"}[t.state]??"rendering",n={job_id:e,state:i,percent:Math.round(t.progress??(i==="complete"?100:0)),...t.error?{error:t.error}:{}};if(i==="complete"||i==="failed"||i==="cancelled"){let s=this.renders.get(e);i==="complete"&&s&&(n.outputs=await W(s.dir,s.name)),await this.ask("render.remove",{job_id:e}).catch(()=>!1),this.renders.delete(e)}return n}async renderCancel(e){return await this.ask("render.cancel",{job_id:e})?{job_id:e,state:"cancelled",percent:0}:{...await this.renderStatus(e),error:`${this.spec.label}'s running export cannot be cancelled from here; stop it in ${this.spec.label}`}}};async function W(d,e){let t=[];try{for await(let i of I(d))i.isFile&&i.name.startsWith(`${e}.`)&&t.push(_(d,i.name))}catch{}return t.sort()}function J(d){let e=(l,c)=>({OTIO_SCHEMA:"RationalTime.1",value:l,rate:c}),t=(l,c,r,o=r)=>({OTIO_SCHEMA:"TimeRange.1",start_time:e(l,r),duration:e(c,o)}),i=d.fps,n=d.tracks?.length?d.tracks:[...new Set(d.items.map(l=>l.track))].sort((l,c)=>l-c).map(l=>({index:l,enabled:!0,name:"",items:d.items.filter(c=>c.track===l)})),s=l=>(l.reversed?-1:1)*(l.speed||1)/(l.fps_factor||1),a=new Map;for(let l of d.items)if(l.file_path&&l.start_tc!=null&&l.src_abs_in!=null){let c=l.src_abs_in-l.start_tc+Math.ceil((l.end-l.start)*Math.abs(s(l))*(l.fps_factor||1));a.set(l.file_path,Math.max(a.get(l.file_path)??0,c))}let p=n.map(l=>{let c=d.start_frame,r=[];for(let o of[...l.items].sort((u,f)=>u.start-f.start)){if(o.start<c)continue;o.start>c&&r.push({OTIO_SCHEMA:"Gap.1",name:"",source_range:t(0,o.start-c,i)});let u=o.src_fps||i,f=o.start_tc!=null&&a.has(o.file_path)?o.start_tc:null,$=f!=null?o.src_abs_in:o.src_in??o.src_abs_in??0,g=s(o);r.push({OTIO_SCHEMA:"Clip.2",name:o.name??b(o.file_path||""),enabled:o.enabled!==!1,source_range:t($,o.end-o.start,u,i),media_references:{DEFAULT_MEDIA:{OTIO_SCHEMA:"ExternalReference.1",name:b(o.file_path||""),target_url:o.file_path?`file://${o.file_path}`:"",...f!=null?{available_range:t(f,a.get(o.file_path),u)}:{},metadata:{}}},active_media_reference_key:"DEFAULT_MEDIA",effects:Math.abs(g-1)>1e-6?[{OTIO_SCHEMA:"LinearTimeWarp.1",name:"",effect_name:"LinearTimeWarp",time_scalar:g}]:[],markers:[],metadata:o.reel?{cmx_3600:{reel:o.reel}}:{}}),c=o.end}return{OTIO_SCHEMA:"Track.1",name:l.name||`V${l.index}`,kind:"Video",enabled:l.enabled!==!1,children:r,effects:[],markers:[],metadata:{}}}),m=[];return d.audio_items?.length&&m.push(`${d.audio_items.length} audio clip(s) not carried: the host's plugin reports no audio source times`),d.transitions?.length&&m.push(`${d.transitions.length} transition(s) not carried (cuts in their place)`),{otio:{OTIO_SCHEMA:"Timeline.1",name:d.timeline,global_start_time:e(d.start_frame,i),metadata:{},tracks:{OTIO_SCHEMA:"Stack.1",name:"tracks",children:p,effects:[],markers:[],metadata:{}}},notes:m}}var X=16e3;var G="Install the conform.tools panel (host_setup host=premiere action=install_panel), then in Premiere open Window > UXP Plugins > conform.tools. It connects by itself from then on.";var U=class extends j{constructor(t=P,i=X){super({host:"premiere",label:"Premiere Pro",setup:G},t,i);this.items=async(t={})=>{await this.needs("edit");let{seq:i}=await this.sequence(t.timeline),n=await this.ask("edit.items",{timeline:i,kind:t.kind,track:t.track},12e4),s=n.project_path?await K(n.project_path,n.timeline).catch(p=>({error:p instanceof Error?p.message:String(p)})):{error:"the project has never been saved"},a=0;if(!("error"in s))for(let p of n.items){let m=s.get(`${p.kind}:${p.track}:${p.start}:${Number(p.end)-Number(p.start)}`);m?Object.assign(p,m,{saved:!0}):(p.saved=!1,a++)}return{...n,color_groups:[],layers:1,..."error"in s?{saved_note:`saved project not read: ${s.error}`}:{unsaved_items:a}}};this.premiereRenders=new Map}async current(){let t=await this.ask("session.describe");return{project:t.project,timelines:t.timelines,timeline:t.current}}async model(t){return await super.model(t)}async projectClips(){return await this.needs("edit"),await this.ask("edit.project_clips",{},12e4)}async relinkClips(t){return await this.needs("edit"),await this.ask("edit.relink_clips",{items:t},6e4+t.length*2e3)}async cutIn(t,i){await this.needs("edit");let{seq:n}=await this.sequence(t);return await this.ask("edit.cut_in",{timeline:n,cuts:i},12e4+i.length*3e3)}async renderStart(t){if(t.range)throw new h("unsupported","premiere: a frame range is not supported yet; set in/out on the sequence in Premiere");if(!t.preset||!/\.epr$/i.test(t.preset))throw new h("usage","premiere: preset must be the path of a Media Encoder preset (.epr)");let{seq:i,name:n}=await this.sequence(t.timeline);await R(t.target_dir);let s=_(t.target_dir,`${t.name??n}.mov`),a=await this.ask("render.export_sequence",{timeline:i,output_path:s,preset_path:t.preset,queue:!1},6e4);if(!a.ok)throw new h("render_refused","premiere: Premiere refused the export");let p=a.job||`ppro-${Date.now()}`;return this.premiereRenders.set(p,s),{job_id:p,state:"rendering",percent:0}}async renderStatus(t){let i=await this.ask("render.progress"),n=i[t]??i.last,s=this.premiereRenders.get(t);return n?.event==="error"||n?.event==="onEncodeError"?{job_id:t,state:"failed",percent:0,error:String(n.data??"encode error")}:n?.event==="complete"||n?.event==="onEncodeComplete"||s&&await y(s)&&!n?{job_id:t,state:"complete",percent:100,...s?{outputs:[s]}:{}}:{job_id:t,state:"rendering",percent:typeof n?.data=="number"?Math.round(Number(n.data)*100):0}}async renderCancel(t){return{job_id:t,state:"cancelled",percent:0,error:"Premiere's export cannot be cancelled from here; cancel it in Premiere / Media Encoder"}}};async function K(d,e){let{session:t}=await N(d,"prproj"),i=t.timelines.find(s=>s.name===e),n=new Map;if(!i)throw new Error(`the saved project has no sequence "${e}" (saved before it was made?)`);for(let s of i.tracks)if(!(s.kind!=="Video"&&s.kind!=="Audio"))for(let a of s.items){if(a.kind==="gap"||a.kind==="transition")continue;let p=a;n.set(`${s.kind==="Video"?"video":"audio"}:${s.track_index}:${a.timeline_range.start.value}:${a.timeline_range.duration.value}`,{saved_id:a.id,...p.speed_factor!=null&&p.speed_factor!==1?{retime:p.speed_factor}:{},...p.speed_ramped?{ramped:!0}:{},...p.speed_reverse?{reversed:!0}:{},...a.kind==="nested"?{nested:!0}:{},...p.is_multicam?{multicam:!0}:{},...p.effects?.some(m=>/stabiliz/i.test(m.kind??""))?{stabilized:!0}:{},...p.effects?.length?{saved_effects:p.effects.map(m=>m.name??m.kind??"")}:{}})}return n}function z(d=v()){return d==="darwin"?"/Library/Application Support/Adobe/Adobe Desktop Common/RemoteComponents/UPI/UnifiedPluginInstallerAgent/UnifiedPluginInstallerAgent.app/Contents/MacOS/UnifiedPluginInstallerAgent":d==="win32"?"C:\\Program Files\\Common Files\\Adobe\\Adobe Desktop Common\\RemoteComponents\\UPI\\UnifiedPluginInstallerAgent\\UnifiedPluginInstallerAgent.exe":null}async function V(){for(let d of["./uxp-plugin/","./premiere-uxp/"]){let e=S(new URL(d,import.meta.url));if(await x(_(e,"manifest.json")))return e}throw new Error("premiere: the conform.tools panel is missing from this install")}async function Q(){return JSON.parse(await H(_(await V(),"manifest.json"))).version}async function oe(d=v()){let e=z(d);if(!e||!await y(e))return{installed:!1,listing:"Creative Cloud's plugin installer is not on this machine"};let t=await w(e,d==="win32"?["/list","all"]:["--list","all"],{timeoutMs:6e4}),i=t.stdout.split(`
|
|
3
|
+
import{M as D,N as F,O as N}from"./chunk-QVH44I66.js";import{n as P}from"./chunk-5BSXYKLN.js";import{B as C,D as M,E as T,H as q,I,L as w,V as b,X as k,Y as _,_ as L,g as v,k as O,p as S,q as A,r as y,s as x,v as H,x as E,y as R}from"./chunk-PLRB2YXJ.js";var B=16e3,h=class extends Error{constructor(t,i){super(i);this.code=t}},j=class d{constructor(e,t=P,i=B){this.spec=e;this.bridge=t;this.waitMs=i;this.renders=new Map;this.host=e.host,e.items&&(this.items=n=>this.modelItems(n??{}))}async peer(){let e=await(await this.bridge()).waitFor(this.host,this.waitMs);if(!e)throw new h("not_connected",`${this.host}: the conform.tools plugin in ${this.spec.label} is not connected. ${this.spec.setup}`);return e}async needs(e){let t=await this.peer();if(!t.capabilities.includes(e))throw new h("panel_old",`${this.host}: the conform.tools plugin open in ${this.spec.label} ${t.version||""} has no ${e} (an older plugin); update it (${this.spec.setup})`);return t}async ask(e,t={},i){return await this.peer(),await(await this.bridge()).request(this.host,e,t,i)}static{this.announced=(e,t)=>e.optional_verbs.includes(t)}async support(){let e={ok:!1,reason:"the renderplugin is a DaVinci Resolve plugin"},t;try{t=await(await this.bridge()).waitFor(this.host,Math.min(3e3,this.waitMs))}catch(s){let a={ok:!1,reason:s instanceof Error?s.message:String(s)};return{export:a,open:a,render:a,markers:a,renderplugin:e}}if(!t){let s={ok:!1,reason:`the conform.tools plugin in ${this.spec.label} is not connected`,setup:this.spec.setup};return{export:s,open:s,render:s,markers:s,renderplugin:e}}let i=(s,a)=>s?{ok:!0}:{ok:!1,reason:`this plugin version has no ${a}`},n=t.capabilities;return{export:i(n.includes("timeline_read")||n.includes("timeline_write"),"timeline_read"),open:i(d.announced(t,"timeline_write.import_file"),"timeline_write.import_file"),render:i(n.includes("render"),"render"),markers:i(n.includes("markers"),"markers"),renderplugin:e}}async current(){let e=await this.ask("session.current_project");if(!e)return{project:"",timelines:[],timeline:""};let t=await this.ask("session.timeline_count",{project:e}),i=[];for(let s=1;s<=t;s++){let a=await this.ask("session.timeline_by_index",{project:e,index:s});a&&i.push(await this.ask("session.name",{handle:a}))}let n=await this.ask("session.current_timeline",{project:e});return{project:await this.ask("session.name",{handle:e}),timelines:i,timeline:n?await this.ask("session.name",{handle:n}):""}}async project(e={}){let t=await this.current();return{project:t.project,timeline:e.timeline??t.timeline,timelines:t.timelines,tracks:[],jobs:[],found:{},pool:{path:"",clips:0,folders:[]}}}async sequence(e){let t=await this.ask("session.current_project");if(!t)throw new h("no_project",`${this.host}: no project is open`);if(!e){let s=await this.ask("session.current_timeline",{project:t});if(!s)throw new h("no_timeline",`${this.host}: no timeline is active`);return{project:t,seq:s,name:await this.ask("session.name",{handle:s})}}let i=await this.ask("session.timeline_count",{project:t}),n=[];for(let s=1;s<=i;s++){let a=await this.ask("session.timeline_by_index",{project:t,index:s});if(!a)continue;let p=await this.ask("session.name",{handle:a});if(p===e)return{project:t,seq:a,name:p};n.push(p)}throw new h("not_found",`${this.host}: no timeline named "${e}" (have: ${n.join(", ")})`)}async model(e){let{project:t,seq:i}=await this.sequence(e);return await this.ask("timeline_read.model",{timeline:i,project:t},12e4)}async export(e){if(!e.out_path)throw new h("usage",`${this.host}: export needs out_path`);let t=await this.peer(),{project:i,seq:n,name:s}=await this.sequence(e.timeline),a=await this.ask("session.name",{handle:i}),p=r=>d.announced(t,r),m=e.out_path,l,c=[];if(p("timeline_write.export_otio")||p("timeline_write.export_xml")){let r=p("timeline_write.export_otio"),o=await this.ask(r?"timeline_write.export_otio":"timeline_write.export_xml",{project:i,timeline:n,path:e.out_path},12e4);if(l=o.format??(r?"otio":"xmeml"),o.ok===!1)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${e.out_path}${o.errors?.length?` (${o.errors.join("; ")})`:""}`);o.path&&o.path!==e.out_path&&(m=await this.adopt(o.path,e.out_path)),c=o.warnings??[]}else if(p("timeline_read.export_file")){let r=await this.ask("timeline_read.export_file",{timeline:n,fmt:"otio",path:e.out_path},12e4);if(!r)throw new h("export_failed",`${this.host}: ${this.spec.label} exported no OTIO`);l="otio",r!==e.out_path&&(m=await this.adopt(r,e.out_path))}else{await this.needs("timeline_read");let r=await this.ask("timeline_read.model",{timeline:n,project:i},12e4),o=J(r);await E(e.out_path,JSON.stringify(o.otio)),l="otio",c=o.notes}if(!D.includes(l))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${l}, which the engine does not read (${m})`);if(!await x(m)||(await A(m)).size===0)throw new h("export_failed",`${this.host}: ${this.spec.label} did not write ${m}`);return{path:m,format:l,project:a,timeline:s,...c.length?{notes:c}:{}}}async adopt(e,t){let i=k(e)&&k(e)!==k(t)?t.slice(0,t.length-k(t).length)+k(e):t;if(await C(e,i),!F(i))throw new h("export_failed",`${this.host}: ${this.spec.label} exported ${b(e)}, which the engine does not read`);return i}async open(e){if(e.into==="scratch")throw new h("unsupported",`${this.host}: opening into a scratch project is not supported; the import lands in the open project`);let t=await this.peer();if(!d.announced(t,"timeline_write.import_file"))throw new h("unsupported",`${this.host}: this conform.tools plugin cannot import timelines (${this.spec.setup})`);let i=await this.ask("session.current_project");if(!i)throw new h("no_project",`${this.host}: no project is open`);let n=await this.ask("timeline_write.import_file",{project:i,path:e.path,sequences:null},3e5);if(!n.ok)throw new h("import_failed",`${this.host}: ${this.spec.label} did not import ${e.path}${n.issues?.length?` (${n.issues.join("; ")})`:""}`);let s=[...n.issues??[]];return n.imported.length>1&&s.push(`imported ${n.imported.length} timelines: ${n.imported.map(a=>a.name).join(", ")}`),e.name&&s.push(`${this.spec.label} names imported timelines after the file's own; name was not applied`),e.media_dirs?.length&&s.push(`${this.spec.label} links media from the paths in the file; media_dirs was not used (relink with timeline_relink before writing)`),{project:await this.ask("session.name",{handle:i}),timeline:n.imported[0]?.name??b(e.path),notes:s,restored:!e.stay,...n.bin?{folder:n.bin}:{}}}async modelItems(e){let t=await this.model(e.timeline),i=[...e.kind==="audio"?[]:t.items.map(n=>({kind:"video",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:n.handle?.$h??n.clip_id??"",name:n.name??"",color:n.color??"",flags:n.flags??[],enabled:n.enabled??!0,file:n.file_path})),...e.kind==="video"?[]:(t.audio_items??[]).map(n=>({kind:"audio",track:n.track,start:n.start-t.start_frame,end:n.end-t.start_frame,id:"",name:n.name??"",file:n.file_path??""}))].filter(n=>e.track===void 0||n.track===e.track);return{project:(await this.current()).project,timeline:t.timeline,start_frame:t.start_frame,fps:t.fps,items:i,color_groups:[],layers:1}}async apply(e){let{project:t,seq:i,name:n}=await this.sequence(e.timeline),s=[],a=[],p=l=>l.op.startsWith("marker_")&&!l.item;for(let l=0;l<e.ops.length;){let c=l;for(;c<e.ops.length&&p(e.ops[c])===p(e.ops[l]);)c++;let r=e.ops.slice(l,c),o=p(r[0])?await this.markerOps(i,r):await this.clipOps(i,r,e.timeline);s.push(...o.results),a.unshift(...o.undo),l=c}let m=s.filter(l=>l.ok).length;return{project:await this.ask("session.name",{handle:t}),timeline:n,results:s,undo:a,applied:m,failed:s.length-m}}async clipOps(e,t,i){let n=await this.peer();if(n.capabilities.includes("edit"))return await this.ask("edit.apply",{timeline:e,ops:t},6e4+t.length*500);let s=(c,r)=>({op:c.op,ok:!1,detail:r});if(!n.capabilities.includes("item_meta"))return{results:t.map(c=>s(c,`${this.host}: clip edits are not reachable over this plugin`)),undo:[]};let a=await this.model(i),p=c=>c?"id"in c?{$h:c.id}:(c.kind??"video")!=="video"?null:a.items.find(r=>r.track===c.track&&r.start-a.start_frame===c.start)?.handle??null:null,m=[],l=[];for(let c of t){let r=p(c.item);try{if(!r)m.push(s(c,`no video item at ${JSON.stringify(c.item??null)}`));else if(c.op==="clip_color"){let o=await this.ask("item_meta.color",{handle:r}),u=c.color?await this.ask("item_meta.set_color",{handle:r,color:c.color}):await this.ask("item_meta.clear_color",{handle:r});m.push({op:c.op,ok:u}),u&&l.unshift({op:"clip_color",item:c.item,color:o})}else if(c.op==="enabled"&&d.announced(n,"item_meta.set_enabled")){let o=a.items.find(f=>f.handle?.$h===r.$h)?.enabled??!0,u=await this.ask("item_meta.set_enabled",{item:r,enabled:!!c.on});m.push({op:c.op,ok:u}),u&&l.unshift({op:"enabled",item:c.item,on:o})}else m.push(s(c,`${this.host}: '${c.op}' is not reachable over this plugin`))}catch(o){m.push(s(c,o instanceof Error?o.message:String(o)))}}return{results:m,undo:l}}async markerOps(e,t){let i=await this.peer(),n=r=>d.announced(i,r),s=new Map((await this.ask("markers.list",{target:e})).map(r=>[r.frame,r])),a=[],p=[],m=async r=>{let o=await this.ask("markers.add",{target:e,frame:r.frame,color:r.color??"",name:r.name??"",note:r.note??"",duration:r.duration??1,custom_data:r.custom_data??""});return o&&s.set(r.frame,{color:"",name:"",note:"",duration:1,...r}),o},l=async r=>{let o=await this.ask("markers.delete_at",{target:e,frame:r});return o&&s.delete(r),o},c=r=>({op:"marker_add",frame:r.frame,color:r.color,name:r.name,note:r.note,duration:r.duration,...r.custom_data?{data:r.custom_data}:{}});for(let r of t){let o=Number(r.frame);try{if(r.op==="marker_add"){let u=s.get(o);u&&await l(o);let f=await m({frame:o,color:r.color,name:r.name,note:r.note,duration:Number(r.duration??1),custom_data:r.data});a.push({op:r.op,ok:f}),f&&p.unshift(...u?[c(u)]:[],{op:"marker_delete",frame:o})}else if(r.op==="marker_update"){let u=s.get(o);if(!u){a.push({op:r.op,ok:!1,detail:`no marker at frame ${o}`});continue}let f=r.to_frame!==void 0?Number(r.to_frame):o,$={...u,frame:f,...r.color!==void 0?{color:String(r.color)}:{},...r.name!==void 0?{name:String(r.name)}:{},...r.note!==void 0?{note:String(r.note)}:{}},g=!0;n("markers.set_color")&&n("markers.set_text")&&n("markers.move")?(r.color!==void 0&&(g=await this.ask("markers.set_color",{target:e,frame:o,color:r.color})&&g),(r.name!==void 0||r.note!==void 0)&&(g=await this.ask("markers.set_text",{target:e,frame:o,name:r.name,note:r.note})&&g),f!==o&&(g=await this.ask("markers.move",{target:e,frame:o,to_frame:f})&&g),s.delete(o),s.set(f,$)):g=await l(o)&&await m($),a.push({op:r.op,ok:g}),p.unshift({op:"marker_update",frame:f,color:u.color,name:u.name,note:u.note,...f!==o?{to_frame:o}:{}})}else if(r.op==="marker_delete"){let u=s.get(o),f=!!u&&await l(o);a.push({op:r.op,ok:f,...u?{}:{detail:`no marker at frame ${o}`}}),f&&u&&p.unshift(c(u))}else a.push({op:r.op,ok:!1,detail:`${this.host}: '${r.op}' is not reachable over this plugin`})}catch(u){a.push({op:r.op,ok:!1,detail:u instanceof Error?u.message:String(u)})}}return{results:a,undo:p}}async renderStart(e){if(await this.needs("render"),e.renderplugin)throw new h("unsupported","the renderplugin is a DaVinci Resolve plugin");if(e.disable_tracks?.length||e.audio_tracks?.length)throw new h("unsupported",`${this.host}: disable_tracks / audio_tracks are DaVinci Resolve's; pick a preset that renders what you need`);if(!e.preset)throw new h("usage",`${this.host}: preset is required: one of ${this.spec.label}'s export presets by name`);let{seq:t,name:i}=await this.sequence(e.timeline),n=e.name??i,s={purpose:"deliver",format:"preset",preset:e.preset,target_dir:e.target_dir,name:n,...e.range?{range:[e.range.in,e.range.out]}:{}},a=await this.ask("render.submit",{timeline:t,job:s});if(!a?.id)throw new h("render_refused",`${this.host}: ${a?.error??`${this.spec.label} refused the render`}`);if(!await this.ask("render.start",{job_ids:[a.id]}))throw new h("render_refused",`${this.host}: ${this.spec.label} did not start job ${a.id}`);return this.renders.set(a.id,{dir:e.target_dir,name:n}),{job_id:a.id,state:"queued",percent:0}}async renderStatus(e){let t=await this.ask("render.status",{job_id:e});if(!t)return{job_id:e,state:"failed",percent:0,error:`${this.host}: no render job ${e}`};let i={done:"complete",rendering:"rendering",queued:"queued",failed:"failed",cancelled:"cancelled"}[t.state]??"rendering",n={job_id:e,state:i,percent:Math.round(t.progress??(i==="complete"?100:0)),...t.error?{error:t.error}:{}};if(i==="complete"||i==="failed"||i==="cancelled"){let s=this.renders.get(e);i==="complete"&&s&&(n.outputs=await W(s.dir,s.name)),await this.ask("render.remove",{job_id:e}).catch(()=>!1),this.renders.delete(e)}return n}async renderCancel(e){return await this.ask("render.cancel",{job_id:e})?{job_id:e,state:"cancelled",percent:0}:{...await this.renderStatus(e),error:`${this.spec.label}'s running export cannot be cancelled from here; stop it in ${this.spec.label}`}}};async function W(d,e){let t=[];try{for await(let i of I(d))i.isFile&&i.name.startsWith(`${e}.`)&&t.push(_(d,i.name))}catch{}return t.sort()}function J(d){let e=(l,c)=>({OTIO_SCHEMA:"RationalTime.1",value:l,rate:c}),t=(l,c,r,o=r)=>({OTIO_SCHEMA:"TimeRange.1",start_time:e(l,r),duration:e(c,o)}),i=d.fps,n=d.tracks?.length?d.tracks:[...new Set(d.items.map(l=>l.track))].sort((l,c)=>l-c).map(l=>({index:l,enabled:!0,name:"",items:d.items.filter(c=>c.track===l)})),s=l=>(l.reversed?-1:1)*(l.speed||1)/(l.fps_factor||1),a=new Map;for(let l of d.items)if(l.file_path&&l.start_tc!=null&&l.src_abs_in!=null){let c=l.src_abs_in-l.start_tc+Math.ceil((l.end-l.start)*Math.abs(s(l))*(l.fps_factor||1));a.set(l.file_path,Math.max(a.get(l.file_path)??0,c))}let p=n.map(l=>{let c=d.start_frame,r=[];for(let o of[...l.items].sort((u,f)=>u.start-f.start)){if(o.start<c)continue;o.start>c&&r.push({OTIO_SCHEMA:"Gap.1",name:"",source_range:t(0,o.start-c,i)});let u=o.src_fps||i,f=o.start_tc!=null&&a.has(o.file_path)?o.start_tc:null,$=f!=null?o.src_abs_in:o.src_in??o.src_abs_in??0,g=s(o);r.push({OTIO_SCHEMA:"Clip.2",name:o.name??b(o.file_path||""),enabled:o.enabled!==!1,source_range:t($,o.end-o.start,u,i),media_references:{DEFAULT_MEDIA:{OTIO_SCHEMA:"ExternalReference.1",name:b(o.file_path||""),target_url:o.file_path?`file://${o.file_path}`:"",...f!=null?{available_range:t(f,a.get(o.file_path),u)}:{},metadata:{}}},active_media_reference_key:"DEFAULT_MEDIA",effects:Math.abs(g-1)>1e-6?[{OTIO_SCHEMA:"LinearTimeWarp.1",name:"",effect_name:"LinearTimeWarp",time_scalar:g}]:[],markers:[],metadata:o.reel?{cmx_3600:{reel:o.reel}}:{}}),c=o.end}return{OTIO_SCHEMA:"Track.1",name:l.name||`V${l.index}`,kind:"Video",enabled:l.enabled!==!1,children:r,effects:[],markers:[],metadata:{}}}),m=[];return d.audio_items?.length&&m.push(`${d.audio_items.length} audio clip(s) not carried: the host's plugin reports no audio source times`),d.transitions?.length&&m.push(`${d.transitions.length} transition(s) not carried (cuts in their place)`),{otio:{OTIO_SCHEMA:"Timeline.1",name:d.timeline,global_start_time:e(d.start_frame,i),metadata:{},tracks:{OTIO_SCHEMA:"Stack.1",name:"tracks",children:p,effects:[],markers:[],metadata:{}}},notes:m}}var X=16e3;var G="Install the conform.tools panel (host_setup host=premiere action=install_panel), then in Premiere open Window > UXP Plugins > conform.tools. It connects by itself from then on.";var U=class extends j{constructor(t=P,i=X){super({host:"premiere",label:"Premiere Pro",setup:G},t,i);this.items=async(t={})=>{await this.needs("edit");let{seq:i}=await this.sequence(t.timeline),n=await this.ask("edit.items",{timeline:i,kind:t.kind,track:t.track},12e4),s=n.project_path?await K(n.project_path,n.timeline).catch(p=>({error:p instanceof Error?p.message:String(p)})):{error:"the project has never been saved"},a=0;if(!("error"in s))for(let p of n.items){let m=s.get(`${p.kind}:${p.track}:${p.start}:${Number(p.end)-Number(p.start)}`);m?Object.assign(p,m,{saved:!0}):(p.saved=!1,a++)}return{...n,color_groups:[],layers:1,..."error"in s?{saved_note:`saved project not read: ${s.error}`}:{unsaved_items:a}}};this.premiereRenders=new Map}async current(){let t=await this.ask("session.describe");return{project:t.project,timelines:t.timelines,timeline:t.current}}async model(t){return await super.model(t)}async projectClips(){return await this.needs("edit"),await this.ask("edit.project_clips",{},12e4)}async relinkClips(t){return await this.needs("edit"),await this.ask("edit.relink_clips",{items:t},6e4+t.length*2e3)}async cutIn(t,i){await this.needs("edit");let{seq:n}=await this.sequence(t);return await this.ask("edit.cut_in",{timeline:n,cuts:i},12e4+i.length*3e3)}async renderStart(t){if(t.range)throw new h("unsupported","premiere: a frame range is not supported yet; set in/out on the sequence in Premiere");if(!t.preset||!/\.epr$/i.test(t.preset))throw new h("usage","premiere: preset must be the path of a Media Encoder preset (.epr)");let{seq:i,name:n}=await this.sequence(t.timeline);await R(t.target_dir);let s=_(t.target_dir,`${t.name??n}.mov`),a=await this.ask("render.export_sequence",{timeline:i,output_path:s,preset_path:t.preset,queue:!1},6e4);if(!a.ok)throw new h("render_refused","premiere: Premiere refused the export");let p=a.job||`ppro-${Date.now()}`;return this.premiereRenders.set(p,s),{job_id:p,state:"rendering",percent:0}}async renderStatus(t){let i=await this.ask("render.progress"),n=i[t]??i.last,s=this.premiereRenders.get(t);return n?.event==="error"||n?.event==="onEncodeError"?{job_id:t,state:"failed",percent:0,error:String(n.data??"encode error")}:n?.event==="complete"||n?.event==="onEncodeComplete"||s&&await y(s)&&!n?{job_id:t,state:"complete",percent:100,...s?{outputs:[s]}:{}}:{job_id:t,state:"rendering",percent:typeof n?.data=="number"?Math.round(Number(n.data)*100):0}}async renderCancel(t){return{job_id:t,state:"cancelled",percent:0,error:"Premiere's export cannot be cancelled from here; cancel it in Premiere / Media Encoder"}}};async function K(d,e){let{session:t}=await N(d,"prproj"),i=t.timelines.find(s=>s.name===e),n=new Map;if(!i)throw new Error(`the saved project has no sequence "${e}" (saved before it was made?)`);for(let s of i.tracks)if(!(s.kind!=="Video"&&s.kind!=="Audio"))for(let a of s.items){if(a.kind==="gap"||a.kind==="transition")continue;let p=a;n.set(`${s.kind==="Video"?"video":"audio"}:${s.track_index}:${a.timeline_range.start.value}:${a.timeline_range.duration.value}`,{saved_id:a.id,...p.speed_factor!=null&&p.speed_factor!==1?{retime:p.speed_factor}:{},...p.speed_ramped?{ramped:!0}:{},...p.speed_reverse?{reversed:!0}:{},...a.kind==="nested"?{nested:!0}:{},...p.is_multicam?{multicam:!0}:{},...p.effects?.some(m=>/stabiliz/i.test(m.kind??""))?{stabilized:!0}:{},...p.effects?.length?{saved_effects:p.effects.map(m=>m.name??m.kind??"")}:{}})}return n}function z(d=v()){return d==="darwin"?"/Library/Application Support/Adobe/Adobe Desktop Common/RemoteComponents/UPI/UnifiedPluginInstallerAgent/UnifiedPluginInstallerAgent.app/Contents/MacOS/UnifiedPluginInstallerAgent":d==="win32"?"C:\\Program Files\\Common Files\\Adobe\\Adobe Desktop Common\\RemoteComponents\\UPI\\UnifiedPluginInstallerAgent\\UnifiedPluginInstallerAgent.exe":null}async function V(){for(let d of["./uxp-plugin/","./premiere-uxp/"]){let e=S(new URL(d,import.meta.url));if(await x(_(e,"manifest.json")))return e}throw new Error("premiere: the conform.tools panel is missing from this install")}async function Q(){return JSON.parse(await H(_(await V(),"manifest.json"))).version}async function oe(d=v()){let e=z(d);if(!e||!await y(e))return{installed:!1,listing:"Creative Cloud's plugin installer is not on this machine"};let t=await w(e,d==="win32"?["/list","all"]:["--list","all"],{timeoutMs:6e4}),i=t.stdout.split(`
|
|
4
4
|
`).find(n=>/CONFORM\.TOOLS|conformtools/i.test(n));return{installed:!!i&&/enabled|installed/i.test(i),version:i?.match(/(\d+\.\d+\.\d+)\s*$/)?.[1],listing:t.stdout.trim()}}async function ae(d=v()){let e=z(d);if(!e||!await y(e))throw new Error("premiere: Creative Cloud's plugin installer (UnifiedPluginInstallerAgent) is not on this machine; install Creative Cloud");let t=await V(),i=await Q(),n=await q("conform-ccx-");for(let c of["manifest.json","index.html","index.js","lib","icons"])await T(_(t,c),_(n,c));let s=_(O(),"premiere");await R(s);let a=L(_(s,`conformtools-premiere-${i}.ccx`));await M(a);let p=d==="darwin"?await w("sh",["-c",`cd '${n.replace(/'/g,"'\\''")}' && zip -r -q -X '${a.replace(/'/g,"'\\''")}' manifest.json index.html index.js lib icons`]):await w("powershell",["-NoProfile","-Command",`Compress-Archive -Path '${n}\\*' -DestinationPath '${a.replace(/\.ccx$/,".zip")}' -Force; Move-Item -Force '${a.replace(/\.ccx$/,".zip")}' '${a}'`]);if(await M(n),!p.success)throw new Error(`premiere: could not package the panel: ${p.stderr.trim()}`);await w(e,d==="win32"?["/remove","conform.tools"]:["--remove","conform.tools"],{timeoutMs:12e4});let m=await w(e,d==="win32"?["/install",a]:["--install",a],{timeoutMs:18e4}),l=`${m.stdout}
|
|
5
5
|
${m.stderr}`.trim();if(!m.success||!/Installation Successful/i.test(l))throw new Error(`premiere: Adobe's installer refused the panel: ${l.split(`
|
|
6
6
|
`).pop()}`);return{version:i,ccx:a,output:l}}export{j as a,U as b,K as c,Q as d,oe as e,ae as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A as L,B as P,C as S,D as T,E as A,F as D,v as x,w as C,x as j,y as R,z as E}from"./chunk-
|
|
3
|
+
import{A as L,B as P,C as S,D as T,E as A,F as D,v as x,w as C,x as j,y as R,z as E}from"./chunk-QVH44I66.js";import{V as f,q as v}from"./chunk-PLRB2YXJ.js";async function q(i,t){let c=t.media_root?[t.media_root]:await T();if(!c.length)throw new Error("no media_root given and no remembered locations \u2014 pass the folder to link from");for(let e of c)try{if(!(await v(e)).isDirectory)throw 0}catch{throw new Error(`media_root is not a folder on this machine: ${e}`)}let r=C(i,{ref_ids:t.ref_ids,lane:t.lane,reset:t.reset});if(!r.length)return{session:i,changed:!1,note:"",text:"nothing in scope: every reference in scope is already linked (use reset=true to re-point) or the ids/lane matched nothing"};if(t.reset)for(let e of r)e.binding_state="unbound",delete e.coverage_reason;let h=[],_=!1,u=[];for(let e of c)if(t.gather==="path")for(let n of r){let p=n.local_path??n.target_url??"",s=p?await R(e,p):null;s?h.push(s):u.push(`${n.id} ${f(p)}: not at its recorded path under ${e}`)}else{let n=await j(e,r,t.cap);h.push(...n.paths),_||=n.capped}let{refs:$,failed:g}=await E([...new Set(h)]);t.remember&&t.media_root&&await A(t.media_root);let o=x(t.criteria),a=L(i,r,$,o,t.tolerances),M=t.criteria?.picture?await P(i,a):[],w=[`scope: ${r.length} reference(s)${t.lane!=="both"?` (${t.lane} lane)`:""}${t.ref_ids?` (zone of ${t.ref_ids.length})`:""}; gather=${t.gather} under ${c.join(", ")}: ${$.length} candidate clip(s)${_?` (CAPPED at ${t.cap} \u2014 narrow the folder)`:""}`,`criteria: ${[...Object.entries(o).filter(([,e])=>e===!0).map(([e])=>e),...t.criteria?.picture?["picture"]:[]].join(", ")}${o.fileName?` (${o.fileNameMode})`:""}${o.fileExtensions?`; ext ${o.fileExtensions}`:""}; timecode containment + fps always on`,...g.length?[`could not probe ${g.length}: ${g.slice(0,5).join("; ")}`]:[],...u.slice(0,20),...M.slice(0,40)];if(t.dry_run)return{session:i,changed:!1,note:"",text:[...w,D(i,a,{compare:t.compare}),"(dry run \u2014 nothing changed; pass accept=[{ref_id,candidate_id}] to commit chosen rows, or run again without dry_run to apply every matched row)"].join(`
|
|
4
4
|
`)};let d,l=[];if(t.accept?.length){d=[];for(let e of t.accept){let n=a.rows.find(s=>s.ref_id===e.ref_id);n&&(n.candidate?.id===e.candidate_id||n.alternatives.some(s=>s.id===e.candidate_id))?d.push(e):l.push(`${e.ref_id} \u2192 ${e.candidate_id}: not a proposed match or alternative for that reference`)}}else d=a.rows.filter(e=>e.status==="matched"&&e.candidate).map(e=>({ref_id:e.ref_id,candidate_id:e.candidate.id}));let m=S(i,a,d),b=m.session.media_references??[],k=b.filter(e=>r.some(n=>n.id===e.id)&&e.binding_state==="linked").length,N=m.applied,y=b.filter(e=>r.some(n=>n.id===e.id)&&e.binding_state!=="linked").map(e=>` - ${e.id} ${f(e.target_url??"")}: ${e.coverage_reason??(a.rows.find(n=>n.ref_id===e.id)?.status==="ambiguous"?"ambiguous \u2014 pick one with accept":"no file matched")}`),z=[...w,`Linked ${k} of ${r.length}${l.length?`; ${l.length} pick(s) vetoed`:""}`,...N.map(e=>`- ${e.ref_id}: ${f(e.before.path??"?")} \u2192 ${e.after.path}${e.warning?` \u26A0 ${e.warning}`:""}`),...l.map(e=>` \u2717 ${e}`),...y.length?["unresolved:",...y]:[]].join(`
|
|
5
5
|
`);return{session:m.session,changed:!0,note:`relink ${t.gather} ${c[0]} (${k}/${r.length})`,text:z}}export{q as a};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as ok}from"./chunk-BW4LRTHG.js";import{a as ma,b as xw,c as Sw,d as Rw,e as Iw,f as Nm,j as z0,l as U0,m as B0,n as Ol,p as V0,q as Z0}from"./chunk-IPFPZBSC.js";import{a as K0,b as q0,c as ga,d as Q0,e as ek,j as wt}from"./chunk-MS3AWOSG.js";import{d as tk,e as nk,f as rk}from"./chunk-7SENYEIV.js";import{a as Ml,b as X0,c as Y0}from"./chunk-TXQR2HI2.js";import{$ as N0,G as $0,H as x0,I as S0,J as Al,K as R0,L as I0,M as T0,O as Mo,P as Un,Q as P0,R as A0,T as E0,U as O0,V as El,W as M0,X as C0,Y as jm,Z as D0,_ as j0,a as vw,aa as F0,b as Am,ba as L0,c as Ze,d as kw,e as $w,f as Pw,g as Aw,h as Ew,i as Yt,j as p0,k as h0,l as g0,m as b0,n as y0,o as _0,p as ha,q as Dm,r as Pl,s as v0,t as w0}from"./chunk-H6WZ43NS.js";import{a as Nn,c as Qv,e as ew}from"./chunk-LGUO7PL5.js";import{f as k0}from"./chunk-PFISREY4.js";import{c as Tw}from"./chunk-JV7TZDKJ.js";import{a as Fr,b as Lr,c as fa,d as Cm,f as Sl,g as pa,i as Rl,k as Pe,l as c0,m as u0,p as Il,s as d0,t as Tl,u as m0,v as f0}from"./chunk-VIBEEWPC.js";import{a as lr,b as ln,c as l0}from"./chunk-PFZVET7S.js";import{b as o0,e as i0,f as xl}from"./chunk-6V4OEOOX.js";import{b as n0,c as r0}from"./chunk-RGMTLNMF.js";import{a as Qw,b as e0,d as t0,e as $l}from"./chunk-AMRJXYL4.js";import{d as a0,e as s0,f as jr,i as Nr}from"./chunk-2BPR6LK6.js";import{a as G0,b as H0,c as W0,d as J0,g as ik,h as Fm,i as Lm,j as zm,k as ak,l as sk,m as lk,o as ck,q as uk,r as dk}from"./chunk-GK4YYKJ6.js";import{a as _l,b as ce,d as qe,e as ww,f as $n}from"./chunk-NU3X7P4N.js";import{D as zw,Da as qw,E as Uw,Ea as Xw,F as Om,Ga as Yw,Ha as sr,K as Bw,M as Vw,O as Zw,P as Gw,R as Hw,S as Ww,U as Mm,c as wl,d as Mw,f as Cw,h as Dw,i as kl,k as jw,l as Nw,la as Jw,u as Em,y as Fw,ya as Kw,z as Lw}from"./chunk-RJ6JA2LZ.js";import{A as Xt,B as Fe,C as ht,D as yw,E as yl,F as _w,a as ua,b as iw,c as aw,d as sw,e as Sm,f as Fn,g as lw,h as Ln,i as cw,j as uw,k as dw,l as Rm,m as mw,n as Im,o as fw,p as rt,q as da,r as Tm,s as pw,t as hw,u as Pm,v as gw,w as zn,x as bw}from"./chunk-F74QMWXE.js";import{a as gl,b as pt,c as tw,d as qt,g as Dr,h as bl,i as xm,m as nw,o as rw,p as ow}from"./chunk-JZY2BHQB.js";import{a as P,b as z,c as Ae,d as D}from"./chunk-PHAMF4JF.js";import{B as pl,C as Jv,D as et,F as hl,H as nt,I as je,J as km,L as wn,M as Kv,N as kn,O as qv,T as $m,U as Xv,V as B,W as ft,X as Kt,Y as M,Z as Yv,b as Ke,c as vm,g as vt,i as wm,j as Hv,k as he,l as ir,m as Oo,o as Wv,p as jn,q as ct,r as Ge,s as Zt,t as ar,u as ut,v as _e,w as Nt,x as ge,y as be,z as sn}from"./chunk-PLRB2YXJ.js";import{M as Ow,S as vl}from"./chunk-C2ESM27Z.js";import{d as Dn}from"./chunk-PSANHDZM.js";var h={};Dn(h,{$brand:()=>ef,$input:()=>Rh,$output:()=>Sh,INVALID:()=>Et,NEVER:()=>Qm,TimePrecision:()=>Nh,ZodAny:()=>xb,ZodArray:()=>Tb,ZodBase64:()=>Au,ZodBase64URL:()=>Eu,ZodBigInt:()=>gi,ZodBigIntFormat:()=>Cu,ZodBoolean:()=>hi,ZodCIDRv4:()=>Tu,ZodCIDRv6:()=>Pu,ZodCUID:()=>wu,ZodCUID2:()=>ku,ZodCatch:()=>Kb,ZodCodec:()=>us,ZodCompileAsyncError:()=>un,ZodCompileUnsupportedError:()=>Se,ZodCreditCard:()=>gb,ZodCustom:()=>ds,ZodCustomStringFormat:()=>ro,ZodDate:()=>os,ZodDefault:()=>Vb,ZodDiscriminatedUnion:()=>Ab,ZodE164:()=>Ou,ZodEmail:()=>bu,ZodEmoji:()=>_u,ZodEnum:()=>mi,ZodError:()=>d2,ZodExactOptional:()=>Fu,ZodFile:()=>Lb,ZodFirstPartyTypeKind:()=>cy,ZodFunction:()=>iy,ZodGUID:()=>yu,ZodIBAN:()=>bb,ZodIPv4:()=>Ru,ZodIPv6:()=>Iu,ZodISODate:()=>yr,ZodISODateTime:()=>br,ZodISODuration:()=>vr,ZodISOTime:()=>_r,ZodInstanceOf:()=>ly,ZodIntersection:()=>Eb,ZodIssueCode:()=>p2,ZodJWT:()=>Mu,ZodKSUID:()=>Su,ZodLazy:()=>ny,ZodLiteral:()=>Fb,ZodMAC:()=>hb,ZodMap:()=>jb,ZodNaN:()=>Xb,ZodNanoID:()=>vu,ZodNever:()=>Rb,ZodNonOptional:()=>Lu,ZodNull:()=>kb,ZodNullable:()=>Bb,ZodNumber:()=>pi,ZodNumberFormat:()=>oo,ZodObject:()=>as,ZodOptional:()=>ls,ZodPipe:()=>cs,ZodPrefault:()=>Gb,ZodPreprocess:()=>Yb,ZodPromise:()=>oy,ZodReadonly:()=>Qb,ZodRealError:()=>Bt,ZodRecord:()=>di,ZodSet:()=>Nb,ZodString:()=>fi,ZodStringFormat:()=>Ne,ZodSuccess:()=>Jb,ZodSymbol:()=>vb,ZodTemplateLiteral:()=>ty,ZodTransform:()=>zb,ZodTuple:()=>Mb,ZodType:()=>ve,ZodULID:()=>$u,ZodURL:()=>rs,ZodUUID:()=>In,ZodUndefined:()=>wb,ZodUnion:()=>ss,ZodUnknown:()=>Sb,ZodVoid:()=>Ib,ZodXID:()=>xu,ZodXor:()=>Pb,_ZodString:()=>gu,_default:()=>Zb,_function:()=>GS,any:()=>kS,array:()=>is,base64:()=>nS,base64url:()=>rS,bigint:()=>bS,boolean:()=>_b,catch:()=>qb,check:()=>HS,cidrv4:()=>eS,cidrv6:()=>tS,clone:()=>Oe,codec:()=>US,coerce:()=>dy,compile:()=>Ah,config:()=>Xe,core:()=>Hn,creditCard:()=>iS,cuid:()=>Hx,cuid2:()=>Wx,currencyCode:()=>dS,custom:()=>WS,date:()=>xS,decode:()=>lb,decodeAsync:()=>ub,deepPartial:()=>a1,describe:()=>JS,discriminatedUnion:()=>AS,e164:()=>oS,email:()=>jx,emoji:()=>Zx,encode:()=>sb,encodeAsync:()=>cb,endsWith:()=>ei,enum:()=>ju,exactOptional:()=>Ub,file:()=>NS,flattenError:()=>Ra,float32:()=>fS,float64:()=>pS,formatError:()=>Ia,fromJSONSchema:()=>o1,function:()=>GS,getDiscriminatedOption:()=>Qp,getErrorMap:()=>g2,globalRegistry:()=>bt,gt:()=>Sn,gte:()=>Ht,guid:()=>Nx,hash:()=>mS,hex:()=>uS,hostname:()=>cS,httpUrl:()=>Vx,iban:()=>aS,includes:()=>Yo,input:()=>l1,instanceof:()=>qS,int:()=>pu,int32:()=>hS,int64:()=>yS,intersection:()=>Ob,invertCodec:()=>BS,ipv4:()=>Xx,ipv6:()=>Qx,iso:()=>ms,json:()=>YS,jwt:()=>sS,keyof:()=>SS,ksuid:()=>qx,lazy:()=>ry,length:()=>Yr,literal:()=>jS,locales:()=>Wa,looseObject:()=>TS,looseRecord:()=>OS,lowercase:()=>qo,lt:()=>xn,lte:()=>Gt,mac:()=>Yx,map:()=>MS,maxLength:()=>Xr,maxSize:()=>fr,memoizer:()=>Ga,meta:()=>KS,mime:()=>ni,minLength:()=>Gn,minSize:()=>Rn,multipleOf:()=>mr,nan:()=>zS,nanoid:()=>Gx,nativeEnum:()=>DS,negative:()=>ru,never:()=>Du,nonnegative:()=>iu,nonoptional:()=>Wb,nonpositive:()=>ou,normalize:()=>ri,null:()=>$b,nullable:()=>ns,nullish:()=>FS,number:()=>yb,object:()=>RS,optional:()=>to,output:()=>c1,overwrite:()=>dn,parse:()=>rb,parseAsync:()=>ob,partialRecord:()=>ES,pipe:()=>hu,positive:()=>nu,prefault:()=>Hb,preprocess:()=>QS,prettifyError:()=>af,promise:()=>ZS,properties:()=>ti,property:()=>au,readonly:()=>ey,record:()=>Db,refine:()=>ay,regex:()=>Ko,regexes:()=>tn,registry:()=>Ec,safeDecode:()=>mb,safeDecodeAsync:()=>pb,safeEncode:()=>db,safeEncodeAsync:()=>fb,safeParse:()=>ib,safeParseAsync:()=>ab,set:()=>CS,setErrorMap:()=>h2,size:()=>qr,slugify:()=>si,startsWith:()=>Qo,strictObject:()=>IS,string:()=>ts,stringFormat:()=>lS,stringbool:()=>XS,success:()=>LS,superRefine:()=>sy,symbol:()=>vS,templateLiteral:()=>VS,toJSONSchema:()=>uu,toLowerCase:()=>ii,toUpperCase:()=>ai,toZod:()=>ba,transform:()=>Nu,treeifyError:()=>of,trim:()=>oi,tuple:()=>Cb,uint32:()=>gS,uint64:()=>_S,ulid:()=>Jx,undefined:()=>wS,union:()=>bi,unknown:()=>eo,uppercase:()=>Xo,url:()=>Bx,util:()=>N,uuid:()=>Fx,uuidv4:()=>Lx,uuidv6:()=>zx,uuidv7:()=>Ux,validate:()=>Ta,validateAsync:()=>Pa,void:()=>$S,withParser:()=>Oc,xid:()=>Kx,xor:()=>PS});var Hn={};Dn(Hn,{$ZodAny:()=>Gp,$ZodArray:()=>qp,$ZodAsyncError:()=>zt,$ZodBase64:()=>Mp,$ZodBase64URL:()=>Cp,$ZodBigInt:()=>bc,$ZodBigIntFormat:()=>Up,$ZodBoolean:()=>La,$ZodCIDRv4:()=>Ep,$ZodCIDRv6:()=>Op,$ZodCUID:()=>_p,$ZodCUID2:()=>vp,$ZodCatch:()=>hh,$ZodCheck:()=>Le,$ZodCheckBigIntFormat:()=>Hf,$ZodCheckEndsWith:()=>op,$ZodCheckGreaterThan:()=>tc,$ZodCheckIncludes:()=>np,$ZodCheckLengthEquals:()=>Yf,$ZodCheckLessThan:()=>ec,$ZodCheckLowerCase:()=>ep,$ZodCheckMaxLength:()=>qf,$ZodCheckMaxSize:()=>Wf,$ZodCheckMimeType:()=>sp,$ZodCheckMinLength:()=>Xf,$ZodCheckMinSize:()=>Jf,$ZodCheckMultipleOf:()=>Zf,$ZodCheckNumberFormat:()=>Gf,$ZodCheckOverwrite:()=>lp,$ZodCheckProperties:()=>ap,$ZodCheckProperty:()=>ip,$ZodCheckRegex:()=>Qf,$ZodCheckSizeEquals:()=>Kf,$ZodCheckStartsWith:()=>rp,$ZodCheckStringFormat:()=>Zo,$ZodCheckUpperCase:()=>tp,$ZodCodec:()=>Ua,$ZodCreditCard:()=>jp,$ZodCustom:()=>kh,$ZodCustomStringFormat:()=>Lp,$ZodCyclicError:()=>xc,$ZodDate:()=>Kp,$ZodDefault:()=>dh,$ZodDiscriminatedUnion:()=>eh,$ZodE164:()=>Dp,$ZodEmail:()=>fp,$ZodEmoji:()=>bp,$ZodEncodeError:()=>dr,$ZodEnum:()=>ih,$ZodError:()=>rf,$ZodExactOptional:()=>ch,$ZodFile:()=>sh,$ZodFunction:()=>vh,$ZodGUID:()=>dp,$ZodIBAN:()=>Np,$ZodIPv4:()=>Tp,$ZodIPv6:()=>Pp,$ZodISODate:()=>Sp,$ZodISODateTime:()=>xp,$ZodISODuration:()=>Ip,$ZodISOTime:()=>Rp,$ZodIntersection:()=>th,$ZodJWT:()=>Fp,$ZodKSUID:()=>$p,$ZodLazy:()=>Ba,$ZodLiteral:()=>ah,$ZodMAC:()=>Ap,$ZodMap:()=>rh,$ZodNaN:()=>gh,$ZodNanoID:()=>yp,$ZodNever:()=>Wp,$ZodNonOptional:()=>fh,$ZodNull:()=>Zp,$ZodNullable:()=>uh,$ZodNumber:()=>gc,$ZodNumberFormat:()=>zp,$ZodObject:()=>Hk,$ZodObjectJIT:()=>Xp,$ZodOptional:()=>_c,$ZodPipe:()=>vc,$ZodPrefault:()=>mh,$ZodPreprocess:()=>bh,$ZodPromise:()=>wh,$ZodReadonly:()=>yh,$ZodRealError:()=>Ut,$ZodRecord:()=>nh,$ZodRegistry:()=>Ac,$ZodSet:()=>oh,$ZodString:()=>Gr,$ZodStringFormat:()=>Me,$ZodSuccess:()=>ph,$ZodSymbol:()=>Bp,$ZodTemplateLiteral:()=>_h,$ZodTransform:()=>lh,$ZodTuple:()=>yc,$ZodType:()=>pe,$ZodULID:()=>wp,$ZodURL:()=>gp,$ZodUUID:()=>mp,$ZodUndefined:()=>Vp,$ZodUnion:()=>za,$ZodUnknown:()=>Hp,$ZodVoid:()=>Jp,$ZodXID:()=>kp,$ZodXor:()=>Yp,$brand:()=>ef,$constructor:()=>T,$input:()=>Rh,$output:()=>Sh,Doc:()=>Zr,INVALID:()=>Et,JSONSchema:()=>Mx,JSONSchemaGenerator:()=>du,NEVER:()=>Qm,TimePrecision:()=>Nh,URL_BAD_FORMAT:()=>pp,URL_UNPARSEABLE:()=>Ca,ZodCompileAsyncError:()=>un,ZodCompileUnsupportedError:()=>Se,_any:()=>eg,_array:()=>sg,_base64:()=>Yc,_base64url:()=>Qc,_bigint:()=>Wh,_boolean:()=>Gh,_catch:()=>QD,_check:()=>bx,_cidrv4:()=>qc,_cidrv6:()=>Xc,_coercedBigint:()=>Jh,_coercedBoolean:()=>Hh,_coercedDate:()=>ig,_coercedNumber:()=>Lh,_coercedString:()=>Mh,_creditCard:()=>Dh,_cuid:()=>Vc,_cuid2:()=>Zc,_custom:()=>cg,_date:()=>og,_decode:()=>Vl,_decodeAsync:()=>Gl,_default:()=>qD,_discriminatedUnion:()=>FD,_e164:()=>eu,_email:()=>Dc,_emoji:()=>Uc,_encode:()=>Bl,_encodeAsync:()=>Zl,_endsWith:()=>ei,_enum:()=>ZD,_file:()=>lg,_float32:()=>Uh,_float64:()=>Bh,_gt:()=>Sn,_gte:()=>Ht,_guid:()=>jc,_iban:()=>jh,_includes:()=>Yo,_int:()=>zh,_int32:()=>Vh,_int64:()=>Kh,_intersection:()=>LD,_ipv4:()=>Jc,_ipv6:()=>Kc,_isoDate:()=>qa,_isoDateTime:()=>Ka,_isoDuration:()=>Ya,_isoTime:()=>Xa,_jwt:()=>tu,_ksuid:()=>Wc,_lazy:()=>r2,_length:()=>Yr,_literal:()=>HD,_lowercase:()=>qo,_lt:()=>xn,_lte:()=>Gt,_mac:()=>Ch,_map:()=>BD,_max:()=>Gt,_maxLength:()=>Xr,_maxSize:()=>fr,_mime:()=>ni,_min:()=>Ht,_minLength:()=>Gn,_minSize:()=>Rn,_multipleOf:()=>mr,_nan:()=>ag,_nanoid:()=>Bc,_nativeEnum:()=>GD,_negative:()=>ru,_never:()=>ng,_nonnegative:()=>iu,_nonoptional:()=>XD,_nonpositive:()=>ou,_normalize:()=>ri,_null:()=>Qh,_nullable:()=>KD,_number:()=>Fh,_optional:()=>JD,_overwrite:()=>dn,_parse:()=>zo,_parseAsync:()=>Uo,_pipe:()=>e2,_positive:()=>nu,_promise:()=>o2,_properties:()=>ti,_property:()=>au,_readonly:()=>t2,_record:()=>UD,_refine:()=>ug,_regex:()=>Ko,_safeDecode:()=>Wl,_safeDecodeAsync:()=>Kl,_safeEncode:()=>Hl,_safeEncodeAsync:()=>Jl,_safeParse:()=>Bo,_safeParseAsync:()=>Vo,_set:()=>VD,_size:()=>qr,_slugify:()=>si,_startsWith:()=>Qo,_string:()=>Oh,_stringFormat:()=>Qr,_stringbool:()=>pg,_success:()=>YD,_superRefine:()=>dg,_symbol:()=>Xh,_templateLiteral:()=>n2,_toLowerCase:()=>ii,_toUpperCase:()=>ai,_transform:()=>WD,_trim:()=>oi,_tuple:()=>zD,_uint32:()=>Zh,_uint64:()=>qh,_ulid:()=>Gc,_undefined:()=>Yh,_union:()=>jD,_unknown:()=>tg,_uppercase:()=>Xo,_url:()=>Ja,_uuid:()=>Nc,_uuidv4:()=>Fc,_uuidv6:()=>Lc,_uuidv7:()=>zc,_void:()=>rg,_xid:()=>Hc,_xor:()=>ND,base64Charset:()=>dc,base64urlCharset:()=>Fa,canParseURL:()=>hp,clone:()=>Oe,compile:()=>Ah,compileFn:()=>Mc,config:()=>Xe,createStandardJSONSchemaMethod:()=>li,createToJSONSchemaMethod:()=>gg,decode:()=>zM,decodeAsync:()=>BM,describe:()=>mg,encode:()=>LM,encodeAsync:()=>UM,extractDefs:()=>hr,finalize:()=>gr,flattenError:()=>Ra,formatError:()=>Ia,getDiscriminatedOption:()=>Qp,globalConfig:()=>dt,globalRegistry:()=>bt,handleUnrepresentable:()=>ot,initializeContext:()=>pr,isBackEdge:()=>Rc,isRecursiveSchema:()=>Sc,isValidBase64:()=>Na,isValidBase64URL:()=>mc,isValidCIDRv6:()=>uc,isValidCreditCard:()=>fc,isValidIBAN:()=>pc,isValidIPv6:()=>ja,isValidJWT:()=>hc,locales:()=>Wa,memoizer:()=>Ga,mergeValues:()=>Go,meta:()=>fg,parse:()=>zl,parseAsync:()=>Ul,parseURLObject:()=>Vk,prettifyError:()=>af,process:()=>Ce,processSchema:()=>Ce,regexes:()=>tn,registry:()=>Ec,safeDecode:()=>ZM,safeDecodeAsync:()=>HM,safeEncode:()=>VM,safeEncodeAsync:()=>GM,safeParse:()=>CM,safeParseAsync:()=>DM,standardProps:()=>ac,stripTabAndNewline:()=>Da,toDotPath:()=>kk,toJSONSchema:()=>uu,toZod:()=>ba,treeifyError:()=>of,urlHostnameOk:()=>lc,urlProtocolOk:()=>cc,util:()=>N,validate:()=>Ta,validateAsync:()=>Pa,validateURL:()=>sc,version:()=>cp,withParser:()=>Oc});var N={};Dn(N,{BIGINT_FORMAT_RANGES:()=>ka,CONSTANT_CATCH:()=>Fl,Class:()=>Vm,NUMBER_FORMAT_RANGES:()=>wa,aborted:()=>At,allowsEval:()=>Hm,assert:()=>eM,assertEqual:()=>qO,assertIs:()=>YO,assertNever:()=>QO,assertNotEqual:()=>XO,assignProp:()=>gt,attachSchema:()=>Nl,base64ToUint8Array:()=>gk,base64urlToUint8Array:()=>_M,cached:()=>No,captureStackTrace:()=>Dl,cleanEnum:()=>yM,cleanRegex:()=>Vn,clone:()=>Oe,cloneDef:()=>rM,codePointLength:()=>Br,constantCatch:()=>Xm,createTransparentProxy:()=>cM,defineLazy:()=>Zm,defineLazyInternal:()=>ke,derived:()=>$M,esc:()=>Pt,escapeRegex:()=>en,explicitlyAborted:()=>Km,extend:()=>mM,finalizeIssue:()=>Lt,floatSafeRemainder:()=>ya,getElementAtPath:()=>oM,getEnumValues:()=>Do,getLengthableOrigin:()=>xa,getParsedType:()=>lM,getSizableOrigin:()=>$a,hexToUint8Array:()=>wM,hide:()=>Sa,installLazyProp:()=>IM,isObject:()=>Ur,isPlainObject:()=>Qt,issue:()=>Lo,joinValues:()=>A,jsonStringifyReplacer:()=>jo,members:()=>qm,merge:()=>pM,mergeDefs:()=>cn,normalizeParams:()=>J,nullish:()=>Cl,numKeys:()=>sM,objectClone:()=>tM,omit:()=>dM,optionalKeys:()=>Jm,own:()=>ur,parsedType:()=>U,partial:()=>hM,pick:()=>uM,prefixIssues:()=>Ft,primitiveTypes:()=>Wm,promiseAllObject:()=>iM,propertyKeyTypes:()=>va,randomString:()=>aM,rawShape:()=>Fo,required:()=>gM,safeExtend:()=>fM,shallowClone:()=>_a,slugify:()=>Gm,stringifyPrimitive:()=>F,toZod:()=>ba,uint8ArrayToBase64:()=>bk,uint8ArrayToBase64url:()=>vM,uint8ArrayToHex:()=>kM,unwrapMessage:()=>Co});function qO(e){return e}function XO(e){return e}function ba(){return e=>e}function YO(e){}function QO(e){throw new Error("Unexpected value in exhaustive check")}function eM(e){}function Do(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 A(e,t="|"){return e.map(r=>F(r)).join(t)}function jo(e,t){return typeof t=="bigint"?t.toString():t}var Bm=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 No(e){return new Bm(e)}function Cl(e){return e==null}function Vn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ya(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 mk=Symbol("evaluating");function Zm(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==mk)return o===void 0&&(o=mk,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tM(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function gt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Fo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Bn(e){return Fo(e._zod.def)??e._zod.def.shape}function fk(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return gt(this,t,o),o},enumerable:!0,configurable:!0})}function pk(e,t,r){t in e?gt(e,t,r):e[t]=r}function zr(e,t,r,o){let n=Bn(t);for(let i of r){let a=Object.getOwnPropertyDescriptor(n,i);a.enumerable&&(a.get?fk(e,i,()=>{let s=t._zod.def.shape[i];return o?o(s,i):s}):pk(e,i,o?o(a.value,i):a.value))}}function nM(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?fk(e,r,()=>t[r]):pk(e,r,o.value))}}function cn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function rM(e){return cn(e._zod.def)}function oM(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function iM(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function aM(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Pt(e){return JSON.stringify(e)}function Gm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hm=No(()=>{if(dt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Qt(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 _a(e){return Qt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sM(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var lM=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}`)}},va=new Set(["string","number","symbol"]),Wm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function en(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function J(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 cM(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},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 F(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Jm(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var wa={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]},ka={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uM(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 i={};return zr(i,e,jl(e,t)),Oe(e,cn(r,{shape:i,checks:[]}))}function jl(e,t){let r=Bn(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 dM(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 i=new Set(jl(e,t)),a={};return zr(a,e,Reflect.ownKeys(Bn(e)).filter(s=>!i.has(s))),Oe(e,cn(r,{shape:a,checks:[]}))}function mM(e,t){if(!Qt(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=Bn(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Oe(e,cn(e._zod.def,{shape:hk(e,t)}))}function hk(e,t){let r={};return zr(r,e,Reflect.ownKeys(Bn(e))),nM(r,t),r}function fM(e,t){if(!Qt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Oe(e,cn(e._zod.def,{shape:hk(e,t)}))}function pM(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={};zr(r,e,Reflect.ownKeys(Bn(e))),zr(r,t,Reflect.ownKeys(Bn(t)));let o=cn(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Oe(e,o)}function hM(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let s=r?new Set(jl(t,r)):void 0,l={};return zr(l,t,Reflect.ownKeys(Bn(t)),e&&((c,u)=>s&&!s.has(u)?c:new e({type:"optional",innerType:c}))),Oe(t,cn(t._zod.def,{shape:l,checks:[]}))}function gM(e,t,r){let o=r?new Set(jl(t,r)):void 0,n={};return zr(n,t,Reflect.ownKeys(Bn(t)),(i,a)=>o&&!o.has(a)?i:new e({type:"nonoptional",innerType:i})),Oe(t,cn(t._zod.def,{shape:n}))}function At(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 Km(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 Ft(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Co(e){return typeof e=="string"?e:e?.message}function Nl(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 i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Co(e.inst?._zod.def?.error?.(e))??Co(i?.(e))??Co(t?.error?.(e))??Co(r.customError?.(e))??Co(r.localeError?.(e))??"Invalid input",s={};for(let l of Object.keys(e))l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__"||(s[l]=e[l]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function $a(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var bM=/[\uD800-\uDBFF]/;function Br(e){let t=e.length;if(!bM.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 xa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function U(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 Lo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function yM(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gk(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 bk(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function _M(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return gk(t+r)}function vM(e){return bk(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wM(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 kM(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Vm=class{constructor(...t){}};function qm(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):xM(e,r,o.value)}}function ur(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Sa(e,t,r){return ur(e,t,r,!1)}function $M(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return ur(this,r,o(this))},set(n){ur(this,r,n)}})}return t}function xM(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:ur(this,t,r.bind(this))},set(o){ur(this,t,o)}})}function SM(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Um,cr=!1,RM={configurable:!0,get(){cr=!0}};function ke(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Um!==e._zod){Um=void 0;return}Um=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,RM);let n=cr;cr=!1;try{let i=r(this);return cr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),cr=cr||n,i}catch(i){throw delete this[t],cr=cr||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function IM(e,t,r,o){let n=SM(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Fl="~constantCatch";function Xm(e){let t=()=>e;return t[Fl]=!0,t}var yk,Qm=Object.freeze({status:"aborted"}),Ym={value:void 0,enumerable:!1},_k="captureStackTrace"in Error?Error:null;function TM(e){let t=_k;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return _k=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function T(e,t,r,o){let n={};function i(f){this.def=f,this.constr=d,this.traits=new Set}i.prototype=n;let a=r,s=a&&new WeakSet;function l(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{Ym.value=new i(m);try{Object.defineProperty(f,"_zod",Ym)}finally{Ym.value=void 0}}if(f._zod.traits.add(e),t(f,m),s){let g=Object.getPrototypeOf(f),_=f._zod.constr.prototype,v=g;for(;v&&v!==_;)v=Object.getPrototypeOf(v);let y=v??g;s.has(y)||(s.add(y),qm(y,a))}let p=d.prototype;for(let g in p)Object.prototype.hasOwnProperty.call(p,g)&&(g in f||(f[g]=p[g].bind(f)))}let c=o?.Parent??Object;class u extends c{}Object.defineProperty(u,"name",{value:e});function d(f){let m=o?.Parent?TM(u):this;l(m,f);let p=m._zod.deferred;if(p){for(let _ of p)_();m._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(m),m}return Object.defineProperty(d,"init",{value:l}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>o?.Parent&&f instanceof o.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ef=Symbol("zod_brand"),zt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(yk=globalThis).__zod_globalConfig??(yk.__zod_globalConfig={});var dt=globalThis.__zod_globalConfig;function Xe(e){return e&&Object.assign(dt,e),dt}function PM(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,jo,2)),e.message}function AM(e){this._zod.message=e}var EM={get:PM,set:AM,enumerable:!0,configurable:!0},nf={value:void 0,enumerable:!1},vk=new WeakSet([Object.prototype,Error.prototype]),wk=(e,t)=>{e.name="$ZodError",nf.value=t,Object.defineProperty(e,"issues",nf),nf.value=void 0,Object.defineProperty(e,"message",EM);let r=Object.getPrototypeOf(e);vk.has(r)||(vk.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})}}))},rf=T("$ZodError",wk),Ut=T("$ZodError",wk,void 0,{Parent:Error});function OM(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 Ra(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?OM(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ia(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,c=0;for(;c<s.length;){let u=s[c],d=c===s.length-1;if(u==="_errors"){d&&l._errors.push(t(a)),c++;continue}Object.prototype.hasOwnProperty.call(l,u)||Object.defineProperty(l,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=l[u];d&&f._errors.push(t(a)),l=f,c++}}}};return o(e),r}function of(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>o({issues:l},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let l=[...i,...s.path];if(l.length===0){r.errors.push(t(s));continue}let c=r,u=0;for(;u<l.length;){let d=l[u],f=u===l.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(a=c.items)[d]??(a[d]={errors:[]}),c=c.items[d]),f&&c.errors.push(t(s)),u++}}};return o(e),r}function kk(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function af(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${kk(o.path)}`);return t.join(`
|
|
3
|
+
import{a as ok}from"./chunk-DQGINJDV.js";import{a as ma,b as xw,c as Sw,d as Rw,e as Iw,f as Nm,j as z0,l as U0,m as B0,n as Ol,p as V0,q as Z0}from"./chunk-HNBA43BF.js";import{a as K0,b as q0,c as ga,d as Q0,e as ek,j as wt}from"./chunk-MWDF2R26.js";import{d as tk,e as nk,f as rk}from"./chunk-623EA3TK.js";import{a as Ml,b as X0,c as Y0}from"./chunk-TXQR2HI2.js";import{$ as N0,G as $0,H as x0,I as S0,J as Al,K as R0,L as I0,M as T0,O as Mo,P as Un,Q as P0,R as A0,T as E0,U as O0,V as El,W as M0,X as C0,Y as jm,Z as D0,_ as j0,a as vw,aa as F0,b as Am,ba as L0,c as Ze,d as kw,e as $w,f as Pw,g as Aw,h as Ew,i as Yt,j as p0,k as h0,l as g0,m as b0,n as y0,o as _0,p as ha,q as Dm,r as Pl,s as v0,t as w0}from"./chunk-QVH44I66.js";import{a as Nn,c as Qv,e as ew}from"./chunk-5BSXYKLN.js";import{f as k0}from"./chunk-PFISREY4.js";import{c as Tw}from"./chunk-JV7TZDKJ.js";import{a as Fr,b as Lr,c as fa,d as Cm,f as Sl,g as pa,i as Rl,k as Pe,l as c0,m as u0,p as Il,s as d0,t as Tl,u as m0,v as f0}from"./chunk-VIBEEWPC.js";import{a as lr,b as ln,c as l0}from"./chunk-PFZVET7S.js";import{b as o0,e as i0,f as xl}from"./chunk-6V4OEOOX.js";import{b as n0,c as r0}from"./chunk-RGMTLNMF.js";import{a as Qw,b as e0,d as t0,e as $l}from"./chunk-AMRJXYL4.js";import{d as a0,e as s0,f as jr,i as Nr}from"./chunk-2BPR6LK6.js";import{a as G0,b as H0,c as W0,d as J0,g as ik,h as Fm,i as Lm,j as zm,k as ak,l as sk,m as lk,o as ck,q as uk,r as dk}from"./chunk-GK4YYKJ6.js";import{a as _l,b as ce,d as qe,e as ww,f as $n}from"./chunk-NU3X7P4N.js";import{D as zw,Da as qw,E as Uw,Ea as Xw,F as Om,Ga as Yw,Ha as sr,K as Bw,M as Vw,O as Zw,P as Gw,R as Hw,S as Ww,U as Mm,c as wl,d as Mw,f as Cw,h as Dw,i as kl,k as jw,l as Nw,la as Jw,u as Em,y as Fw,ya as Kw,z as Lw}from"./chunk-RJ6JA2LZ.js";import{A as Xt,B as Fe,C as ht,D as yw,E as yl,F as _w,a as ua,b as iw,c as aw,d as sw,e as Sm,f as Fn,g as lw,h as Ln,i as cw,j as uw,k as dw,l as Rm,m as mw,n as Im,o as fw,p as rt,q as da,r as Tm,s as pw,t as hw,u as Pm,v as gw,w as zn,x as bw}from"./chunk-GTJ3EM6H.js";import{a as gl,b as pt,c as tw,d as qt,g as Dr,h as bl,i as xm,m as nw,o as rw,p as ow}from"./chunk-XCKQHL4G.js";import{a as P,b as z,c as Ae,d as D}from"./chunk-PHAMF4JF.js";import{B as pl,C as Jv,D as et,F as hl,H as nt,I as je,J as km,L as wn,M as Kv,N as kn,O as qv,T as $m,U as Xv,V as B,W as ft,X as Kt,Y as M,Z as Yv,b as Ke,c as vm,g as vt,i as wm,j as Hv,k as he,l as ir,m as Oo,o as Wv,p as jn,q as ct,r as Ge,s as Zt,t as ar,u as ut,v as _e,w as Nt,x as ge,y as be,z as sn}from"./chunk-PLRB2YXJ.js";import{M as Ow,S as vl}from"./chunk-C2ESM27Z.js";import{d as Dn}from"./chunk-PSANHDZM.js";var h={};Dn(h,{$brand:()=>ef,$input:()=>Rh,$output:()=>Sh,INVALID:()=>Et,NEVER:()=>Qm,TimePrecision:()=>Nh,ZodAny:()=>xb,ZodArray:()=>Tb,ZodBase64:()=>Au,ZodBase64URL:()=>Eu,ZodBigInt:()=>gi,ZodBigIntFormat:()=>Cu,ZodBoolean:()=>hi,ZodCIDRv4:()=>Tu,ZodCIDRv6:()=>Pu,ZodCUID:()=>wu,ZodCUID2:()=>ku,ZodCatch:()=>Kb,ZodCodec:()=>us,ZodCompileAsyncError:()=>un,ZodCompileUnsupportedError:()=>Se,ZodCreditCard:()=>gb,ZodCustom:()=>ds,ZodCustomStringFormat:()=>ro,ZodDate:()=>os,ZodDefault:()=>Vb,ZodDiscriminatedUnion:()=>Ab,ZodE164:()=>Ou,ZodEmail:()=>bu,ZodEmoji:()=>_u,ZodEnum:()=>mi,ZodError:()=>d2,ZodExactOptional:()=>Fu,ZodFile:()=>Lb,ZodFirstPartyTypeKind:()=>cy,ZodFunction:()=>iy,ZodGUID:()=>yu,ZodIBAN:()=>bb,ZodIPv4:()=>Ru,ZodIPv6:()=>Iu,ZodISODate:()=>yr,ZodISODateTime:()=>br,ZodISODuration:()=>vr,ZodISOTime:()=>_r,ZodInstanceOf:()=>ly,ZodIntersection:()=>Eb,ZodIssueCode:()=>p2,ZodJWT:()=>Mu,ZodKSUID:()=>Su,ZodLazy:()=>ny,ZodLiteral:()=>Fb,ZodMAC:()=>hb,ZodMap:()=>jb,ZodNaN:()=>Xb,ZodNanoID:()=>vu,ZodNever:()=>Rb,ZodNonOptional:()=>Lu,ZodNull:()=>kb,ZodNullable:()=>Bb,ZodNumber:()=>pi,ZodNumberFormat:()=>oo,ZodObject:()=>as,ZodOptional:()=>ls,ZodPipe:()=>cs,ZodPrefault:()=>Gb,ZodPreprocess:()=>Yb,ZodPromise:()=>oy,ZodReadonly:()=>Qb,ZodRealError:()=>Bt,ZodRecord:()=>di,ZodSet:()=>Nb,ZodString:()=>fi,ZodStringFormat:()=>Ne,ZodSuccess:()=>Jb,ZodSymbol:()=>vb,ZodTemplateLiteral:()=>ty,ZodTransform:()=>zb,ZodTuple:()=>Mb,ZodType:()=>ve,ZodULID:()=>$u,ZodURL:()=>rs,ZodUUID:()=>In,ZodUndefined:()=>wb,ZodUnion:()=>ss,ZodUnknown:()=>Sb,ZodVoid:()=>Ib,ZodXID:()=>xu,ZodXor:()=>Pb,_ZodString:()=>gu,_default:()=>Zb,_function:()=>GS,any:()=>kS,array:()=>is,base64:()=>nS,base64url:()=>rS,bigint:()=>bS,boolean:()=>_b,catch:()=>qb,check:()=>HS,cidrv4:()=>eS,cidrv6:()=>tS,clone:()=>Oe,codec:()=>US,coerce:()=>dy,compile:()=>Ah,config:()=>Xe,core:()=>Hn,creditCard:()=>iS,cuid:()=>Hx,cuid2:()=>Wx,currencyCode:()=>dS,custom:()=>WS,date:()=>xS,decode:()=>lb,decodeAsync:()=>ub,deepPartial:()=>a1,describe:()=>JS,discriminatedUnion:()=>AS,e164:()=>oS,email:()=>jx,emoji:()=>Zx,encode:()=>sb,encodeAsync:()=>cb,endsWith:()=>ei,enum:()=>ju,exactOptional:()=>Ub,file:()=>NS,flattenError:()=>Ra,float32:()=>fS,float64:()=>pS,formatError:()=>Ia,fromJSONSchema:()=>o1,function:()=>GS,getDiscriminatedOption:()=>Qp,getErrorMap:()=>g2,globalRegistry:()=>bt,gt:()=>Sn,gte:()=>Ht,guid:()=>Nx,hash:()=>mS,hex:()=>uS,hostname:()=>cS,httpUrl:()=>Vx,iban:()=>aS,includes:()=>Yo,input:()=>l1,instanceof:()=>qS,int:()=>pu,int32:()=>hS,int64:()=>yS,intersection:()=>Ob,invertCodec:()=>BS,ipv4:()=>Xx,ipv6:()=>Qx,iso:()=>ms,json:()=>YS,jwt:()=>sS,keyof:()=>SS,ksuid:()=>qx,lazy:()=>ry,length:()=>Yr,literal:()=>jS,locales:()=>Wa,looseObject:()=>TS,looseRecord:()=>OS,lowercase:()=>qo,lt:()=>xn,lte:()=>Gt,mac:()=>Yx,map:()=>MS,maxLength:()=>Xr,maxSize:()=>fr,memoizer:()=>Ga,meta:()=>KS,mime:()=>ni,minLength:()=>Gn,minSize:()=>Rn,multipleOf:()=>mr,nan:()=>zS,nanoid:()=>Gx,nativeEnum:()=>DS,negative:()=>ru,never:()=>Du,nonnegative:()=>iu,nonoptional:()=>Wb,nonpositive:()=>ou,normalize:()=>ri,null:()=>$b,nullable:()=>ns,nullish:()=>FS,number:()=>yb,object:()=>RS,optional:()=>to,output:()=>c1,overwrite:()=>dn,parse:()=>rb,parseAsync:()=>ob,partialRecord:()=>ES,pipe:()=>hu,positive:()=>nu,prefault:()=>Hb,preprocess:()=>QS,prettifyError:()=>af,promise:()=>ZS,properties:()=>ti,property:()=>au,readonly:()=>ey,record:()=>Db,refine:()=>ay,regex:()=>Ko,regexes:()=>tn,registry:()=>Ec,safeDecode:()=>mb,safeDecodeAsync:()=>pb,safeEncode:()=>db,safeEncodeAsync:()=>fb,safeParse:()=>ib,safeParseAsync:()=>ab,set:()=>CS,setErrorMap:()=>h2,size:()=>qr,slugify:()=>si,startsWith:()=>Qo,strictObject:()=>IS,string:()=>ts,stringFormat:()=>lS,stringbool:()=>XS,success:()=>LS,superRefine:()=>sy,symbol:()=>vS,templateLiteral:()=>VS,toJSONSchema:()=>uu,toLowerCase:()=>ii,toUpperCase:()=>ai,toZod:()=>ba,transform:()=>Nu,treeifyError:()=>of,trim:()=>oi,tuple:()=>Cb,uint32:()=>gS,uint64:()=>_S,ulid:()=>Jx,undefined:()=>wS,union:()=>bi,unknown:()=>eo,uppercase:()=>Xo,url:()=>Bx,util:()=>N,uuid:()=>Fx,uuidv4:()=>Lx,uuidv6:()=>zx,uuidv7:()=>Ux,validate:()=>Ta,validateAsync:()=>Pa,void:()=>$S,withParser:()=>Oc,xid:()=>Kx,xor:()=>PS});var Hn={};Dn(Hn,{$ZodAny:()=>Gp,$ZodArray:()=>qp,$ZodAsyncError:()=>zt,$ZodBase64:()=>Mp,$ZodBase64URL:()=>Cp,$ZodBigInt:()=>bc,$ZodBigIntFormat:()=>Up,$ZodBoolean:()=>La,$ZodCIDRv4:()=>Ep,$ZodCIDRv6:()=>Op,$ZodCUID:()=>_p,$ZodCUID2:()=>vp,$ZodCatch:()=>hh,$ZodCheck:()=>Le,$ZodCheckBigIntFormat:()=>Hf,$ZodCheckEndsWith:()=>op,$ZodCheckGreaterThan:()=>tc,$ZodCheckIncludes:()=>np,$ZodCheckLengthEquals:()=>Yf,$ZodCheckLessThan:()=>ec,$ZodCheckLowerCase:()=>ep,$ZodCheckMaxLength:()=>qf,$ZodCheckMaxSize:()=>Wf,$ZodCheckMimeType:()=>sp,$ZodCheckMinLength:()=>Xf,$ZodCheckMinSize:()=>Jf,$ZodCheckMultipleOf:()=>Zf,$ZodCheckNumberFormat:()=>Gf,$ZodCheckOverwrite:()=>lp,$ZodCheckProperties:()=>ap,$ZodCheckProperty:()=>ip,$ZodCheckRegex:()=>Qf,$ZodCheckSizeEquals:()=>Kf,$ZodCheckStartsWith:()=>rp,$ZodCheckStringFormat:()=>Zo,$ZodCheckUpperCase:()=>tp,$ZodCodec:()=>Ua,$ZodCreditCard:()=>jp,$ZodCustom:()=>kh,$ZodCustomStringFormat:()=>Lp,$ZodCyclicError:()=>xc,$ZodDate:()=>Kp,$ZodDefault:()=>dh,$ZodDiscriminatedUnion:()=>eh,$ZodE164:()=>Dp,$ZodEmail:()=>fp,$ZodEmoji:()=>bp,$ZodEncodeError:()=>dr,$ZodEnum:()=>ih,$ZodError:()=>rf,$ZodExactOptional:()=>ch,$ZodFile:()=>sh,$ZodFunction:()=>vh,$ZodGUID:()=>dp,$ZodIBAN:()=>Np,$ZodIPv4:()=>Tp,$ZodIPv6:()=>Pp,$ZodISODate:()=>Sp,$ZodISODateTime:()=>xp,$ZodISODuration:()=>Ip,$ZodISOTime:()=>Rp,$ZodIntersection:()=>th,$ZodJWT:()=>Fp,$ZodKSUID:()=>$p,$ZodLazy:()=>Ba,$ZodLiteral:()=>ah,$ZodMAC:()=>Ap,$ZodMap:()=>rh,$ZodNaN:()=>gh,$ZodNanoID:()=>yp,$ZodNever:()=>Wp,$ZodNonOptional:()=>fh,$ZodNull:()=>Zp,$ZodNullable:()=>uh,$ZodNumber:()=>gc,$ZodNumberFormat:()=>zp,$ZodObject:()=>Hk,$ZodObjectJIT:()=>Xp,$ZodOptional:()=>_c,$ZodPipe:()=>vc,$ZodPrefault:()=>mh,$ZodPreprocess:()=>bh,$ZodPromise:()=>wh,$ZodReadonly:()=>yh,$ZodRealError:()=>Ut,$ZodRecord:()=>nh,$ZodRegistry:()=>Ac,$ZodSet:()=>oh,$ZodString:()=>Gr,$ZodStringFormat:()=>Me,$ZodSuccess:()=>ph,$ZodSymbol:()=>Bp,$ZodTemplateLiteral:()=>_h,$ZodTransform:()=>lh,$ZodTuple:()=>yc,$ZodType:()=>pe,$ZodULID:()=>wp,$ZodURL:()=>gp,$ZodUUID:()=>mp,$ZodUndefined:()=>Vp,$ZodUnion:()=>za,$ZodUnknown:()=>Hp,$ZodVoid:()=>Jp,$ZodXID:()=>kp,$ZodXor:()=>Yp,$brand:()=>ef,$constructor:()=>T,$input:()=>Rh,$output:()=>Sh,Doc:()=>Zr,INVALID:()=>Et,JSONSchema:()=>Mx,JSONSchemaGenerator:()=>du,NEVER:()=>Qm,TimePrecision:()=>Nh,URL_BAD_FORMAT:()=>pp,URL_UNPARSEABLE:()=>Ca,ZodCompileAsyncError:()=>un,ZodCompileUnsupportedError:()=>Se,_any:()=>eg,_array:()=>sg,_base64:()=>Yc,_base64url:()=>Qc,_bigint:()=>Wh,_boolean:()=>Gh,_catch:()=>QD,_check:()=>bx,_cidrv4:()=>qc,_cidrv6:()=>Xc,_coercedBigint:()=>Jh,_coercedBoolean:()=>Hh,_coercedDate:()=>ig,_coercedNumber:()=>Lh,_coercedString:()=>Mh,_creditCard:()=>Dh,_cuid:()=>Vc,_cuid2:()=>Zc,_custom:()=>cg,_date:()=>og,_decode:()=>Vl,_decodeAsync:()=>Gl,_default:()=>qD,_discriminatedUnion:()=>FD,_e164:()=>eu,_email:()=>Dc,_emoji:()=>Uc,_encode:()=>Bl,_encodeAsync:()=>Zl,_endsWith:()=>ei,_enum:()=>ZD,_file:()=>lg,_float32:()=>Uh,_float64:()=>Bh,_gt:()=>Sn,_gte:()=>Ht,_guid:()=>jc,_iban:()=>jh,_includes:()=>Yo,_int:()=>zh,_int32:()=>Vh,_int64:()=>Kh,_intersection:()=>LD,_ipv4:()=>Jc,_ipv6:()=>Kc,_isoDate:()=>qa,_isoDateTime:()=>Ka,_isoDuration:()=>Ya,_isoTime:()=>Xa,_jwt:()=>tu,_ksuid:()=>Wc,_lazy:()=>r2,_length:()=>Yr,_literal:()=>HD,_lowercase:()=>qo,_lt:()=>xn,_lte:()=>Gt,_mac:()=>Ch,_map:()=>BD,_max:()=>Gt,_maxLength:()=>Xr,_maxSize:()=>fr,_mime:()=>ni,_min:()=>Ht,_minLength:()=>Gn,_minSize:()=>Rn,_multipleOf:()=>mr,_nan:()=>ag,_nanoid:()=>Bc,_nativeEnum:()=>GD,_negative:()=>ru,_never:()=>ng,_nonnegative:()=>iu,_nonoptional:()=>XD,_nonpositive:()=>ou,_normalize:()=>ri,_null:()=>Qh,_nullable:()=>KD,_number:()=>Fh,_optional:()=>JD,_overwrite:()=>dn,_parse:()=>zo,_parseAsync:()=>Uo,_pipe:()=>e2,_positive:()=>nu,_promise:()=>o2,_properties:()=>ti,_property:()=>au,_readonly:()=>t2,_record:()=>UD,_refine:()=>ug,_regex:()=>Ko,_safeDecode:()=>Wl,_safeDecodeAsync:()=>Kl,_safeEncode:()=>Hl,_safeEncodeAsync:()=>Jl,_safeParse:()=>Bo,_safeParseAsync:()=>Vo,_set:()=>VD,_size:()=>qr,_slugify:()=>si,_startsWith:()=>Qo,_string:()=>Oh,_stringFormat:()=>Qr,_stringbool:()=>pg,_success:()=>YD,_superRefine:()=>dg,_symbol:()=>Xh,_templateLiteral:()=>n2,_toLowerCase:()=>ii,_toUpperCase:()=>ai,_transform:()=>WD,_trim:()=>oi,_tuple:()=>zD,_uint32:()=>Zh,_uint64:()=>qh,_ulid:()=>Gc,_undefined:()=>Yh,_union:()=>jD,_unknown:()=>tg,_uppercase:()=>Xo,_url:()=>Ja,_uuid:()=>Nc,_uuidv4:()=>Fc,_uuidv6:()=>Lc,_uuidv7:()=>zc,_void:()=>rg,_xid:()=>Hc,_xor:()=>ND,base64Charset:()=>dc,base64urlCharset:()=>Fa,canParseURL:()=>hp,clone:()=>Oe,compile:()=>Ah,compileFn:()=>Mc,config:()=>Xe,createStandardJSONSchemaMethod:()=>li,createToJSONSchemaMethod:()=>gg,decode:()=>zM,decodeAsync:()=>BM,describe:()=>mg,encode:()=>LM,encodeAsync:()=>UM,extractDefs:()=>hr,finalize:()=>gr,flattenError:()=>Ra,formatError:()=>Ia,getDiscriminatedOption:()=>Qp,globalConfig:()=>dt,globalRegistry:()=>bt,handleUnrepresentable:()=>ot,initializeContext:()=>pr,isBackEdge:()=>Rc,isRecursiveSchema:()=>Sc,isValidBase64:()=>Na,isValidBase64URL:()=>mc,isValidCIDRv6:()=>uc,isValidCreditCard:()=>fc,isValidIBAN:()=>pc,isValidIPv6:()=>ja,isValidJWT:()=>hc,locales:()=>Wa,memoizer:()=>Ga,mergeValues:()=>Go,meta:()=>fg,parse:()=>zl,parseAsync:()=>Ul,parseURLObject:()=>Vk,prettifyError:()=>af,process:()=>Ce,processSchema:()=>Ce,regexes:()=>tn,registry:()=>Ec,safeDecode:()=>ZM,safeDecodeAsync:()=>HM,safeEncode:()=>VM,safeEncodeAsync:()=>GM,safeParse:()=>CM,safeParseAsync:()=>DM,standardProps:()=>ac,stripTabAndNewline:()=>Da,toDotPath:()=>kk,toJSONSchema:()=>uu,toZod:()=>ba,treeifyError:()=>of,urlHostnameOk:()=>lc,urlProtocolOk:()=>cc,util:()=>N,validate:()=>Ta,validateAsync:()=>Pa,validateURL:()=>sc,version:()=>cp,withParser:()=>Oc});var N={};Dn(N,{BIGINT_FORMAT_RANGES:()=>ka,CONSTANT_CATCH:()=>Fl,Class:()=>Vm,NUMBER_FORMAT_RANGES:()=>wa,aborted:()=>At,allowsEval:()=>Hm,assert:()=>eM,assertEqual:()=>qO,assertIs:()=>YO,assertNever:()=>QO,assertNotEqual:()=>XO,assignProp:()=>gt,attachSchema:()=>Nl,base64ToUint8Array:()=>gk,base64urlToUint8Array:()=>_M,cached:()=>No,captureStackTrace:()=>Dl,cleanEnum:()=>yM,cleanRegex:()=>Vn,clone:()=>Oe,cloneDef:()=>rM,codePointLength:()=>Br,constantCatch:()=>Xm,createTransparentProxy:()=>cM,defineLazy:()=>Zm,defineLazyInternal:()=>ke,derived:()=>$M,esc:()=>Pt,escapeRegex:()=>en,explicitlyAborted:()=>Km,extend:()=>mM,finalizeIssue:()=>Lt,floatSafeRemainder:()=>ya,getElementAtPath:()=>oM,getEnumValues:()=>Do,getLengthableOrigin:()=>xa,getParsedType:()=>lM,getSizableOrigin:()=>$a,hexToUint8Array:()=>wM,hide:()=>Sa,installLazyProp:()=>IM,isObject:()=>Ur,isPlainObject:()=>Qt,issue:()=>Lo,joinValues:()=>A,jsonStringifyReplacer:()=>jo,members:()=>qm,merge:()=>pM,mergeDefs:()=>cn,normalizeParams:()=>J,nullish:()=>Cl,numKeys:()=>sM,objectClone:()=>tM,omit:()=>dM,optionalKeys:()=>Jm,own:()=>ur,parsedType:()=>U,partial:()=>hM,pick:()=>uM,prefixIssues:()=>Ft,primitiveTypes:()=>Wm,promiseAllObject:()=>iM,propertyKeyTypes:()=>va,randomString:()=>aM,rawShape:()=>Fo,required:()=>gM,safeExtend:()=>fM,shallowClone:()=>_a,slugify:()=>Gm,stringifyPrimitive:()=>F,toZod:()=>ba,uint8ArrayToBase64:()=>bk,uint8ArrayToBase64url:()=>vM,uint8ArrayToHex:()=>kM,unwrapMessage:()=>Co});function qO(e){return e}function XO(e){return e}function ba(){return e=>e}function YO(e){}function QO(e){throw new Error("Unexpected value in exhaustive check")}function eM(e){}function Do(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 A(e,t="|"){return e.map(r=>F(r)).join(t)}function jo(e,t){return typeof t=="bigint"?t.toString():t}var Bm=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 No(e){return new Bm(e)}function Cl(e){return e==null}function Vn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ya(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 mk=Symbol("evaluating");function Zm(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==mk)return o===void 0&&(o=mk,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tM(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function gt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Fo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Bn(e){return Fo(e._zod.def)??e._zod.def.shape}function fk(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return gt(this,t,o),o},enumerable:!0,configurable:!0})}function pk(e,t,r){t in e?gt(e,t,r):e[t]=r}function zr(e,t,r,o){let n=Bn(t);for(let i of r){let a=Object.getOwnPropertyDescriptor(n,i);a.enumerable&&(a.get?fk(e,i,()=>{let s=t._zod.def.shape[i];return o?o(s,i):s}):pk(e,i,o?o(a.value,i):a.value))}}function nM(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?fk(e,r,()=>t[r]):pk(e,r,o.value))}}function cn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function rM(e){return cn(e._zod.def)}function oM(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function iM(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function aM(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Pt(e){return JSON.stringify(e)}function Gm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hm=No(()=>{if(dt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Qt(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 _a(e){return Qt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sM(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var lM=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}`)}},va=new Set(["string","number","symbol"]),Wm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function en(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function J(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 cM(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},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 F(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Jm(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var wa={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]},ka={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uM(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 i={};return zr(i,e,jl(e,t)),Oe(e,cn(r,{shape:i,checks:[]}))}function jl(e,t){let r=Bn(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 dM(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 i=new Set(jl(e,t)),a={};return zr(a,e,Reflect.ownKeys(Bn(e)).filter(s=>!i.has(s))),Oe(e,cn(r,{shape:a,checks:[]}))}function mM(e,t){if(!Qt(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=Bn(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Oe(e,cn(e._zod.def,{shape:hk(e,t)}))}function hk(e,t){let r={};return zr(r,e,Reflect.ownKeys(Bn(e))),nM(r,t),r}function fM(e,t){if(!Qt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Oe(e,cn(e._zod.def,{shape:hk(e,t)}))}function pM(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={};zr(r,e,Reflect.ownKeys(Bn(e))),zr(r,t,Reflect.ownKeys(Bn(t)));let o=cn(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Oe(e,o)}function hM(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let s=r?new Set(jl(t,r)):void 0,l={};return zr(l,t,Reflect.ownKeys(Bn(t)),e&&((c,u)=>s&&!s.has(u)?c:new e({type:"optional",innerType:c}))),Oe(t,cn(t._zod.def,{shape:l,checks:[]}))}function gM(e,t,r){let o=r?new Set(jl(t,r)):void 0,n={};return zr(n,t,Reflect.ownKeys(Bn(t)),(i,a)=>o&&!o.has(a)?i:new e({type:"nonoptional",innerType:i})),Oe(t,cn(t._zod.def,{shape:n}))}function At(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 Km(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 Ft(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Co(e){return typeof e=="string"?e:e?.message}function Nl(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 i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Co(e.inst?._zod.def?.error?.(e))??Co(i?.(e))??Co(t?.error?.(e))??Co(r.customError?.(e))??Co(r.localeError?.(e))??"Invalid input",s={};for(let l of Object.keys(e))l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__"||(s[l]=e[l]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function $a(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var bM=/[\uD800-\uDBFF]/;function Br(e){let t=e.length;if(!bM.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 xa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function U(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 Lo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function yM(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gk(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 bk(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function _M(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return gk(t+r)}function vM(e){return bk(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wM(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 kM(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Vm=class{constructor(...t){}};function qm(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):xM(e,r,o.value)}}function ur(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Sa(e,t,r){return ur(e,t,r,!1)}function $M(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return ur(this,r,o(this))},set(n){ur(this,r,n)}})}return t}function xM(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:ur(this,t,r.bind(this))},set(o){ur(this,t,o)}})}function SM(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Um,cr=!1,RM={configurable:!0,get(){cr=!0}};function ke(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Um!==e._zod){Um=void 0;return}Um=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,RM);let n=cr;cr=!1;try{let i=r(this);return cr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),cr=cr||n,i}catch(i){throw delete this[t],cr=cr||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function IM(e,t,r,o){let n=SM(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Fl="~constantCatch";function Xm(e){let t=()=>e;return t[Fl]=!0,t}var yk,Qm=Object.freeze({status:"aborted"}),Ym={value:void 0,enumerable:!1},_k="captureStackTrace"in Error?Error:null;function TM(e){let t=_k;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return _k=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function T(e,t,r,o){let n={};function i(f){this.def=f,this.constr=d,this.traits=new Set}i.prototype=n;let a=r,s=a&&new WeakSet;function l(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{Ym.value=new i(m);try{Object.defineProperty(f,"_zod",Ym)}finally{Ym.value=void 0}}if(f._zod.traits.add(e),t(f,m),s){let g=Object.getPrototypeOf(f),_=f._zod.constr.prototype,v=g;for(;v&&v!==_;)v=Object.getPrototypeOf(v);let y=v??g;s.has(y)||(s.add(y),qm(y,a))}let p=d.prototype;for(let g in p)Object.prototype.hasOwnProperty.call(p,g)&&(g in f||(f[g]=p[g].bind(f)))}let c=o?.Parent??Object;class u extends c{}Object.defineProperty(u,"name",{value:e});function d(f){let m=o?.Parent?TM(u):this;l(m,f);let p=m._zod.deferred;if(p){for(let _ of p)_();m._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(m),m}return Object.defineProperty(d,"init",{value:l}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>o?.Parent&&f instanceof o.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ef=Symbol("zod_brand"),zt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(yk=globalThis).__zod_globalConfig??(yk.__zod_globalConfig={});var dt=globalThis.__zod_globalConfig;function Xe(e){return e&&Object.assign(dt,e),dt}function PM(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,jo,2)),e.message}function AM(e){this._zod.message=e}var EM={get:PM,set:AM,enumerable:!0,configurable:!0},nf={value:void 0,enumerable:!1},vk=new WeakSet([Object.prototype,Error.prototype]),wk=(e,t)=>{e.name="$ZodError",nf.value=t,Object.defineProperty(e,"issues",nf),nf.value=void 0,Object.defineProperty(e,"message",EM);let r=Object.getPrototypeOf(e);vk.has(r)||(vk.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})}}))},rf=T("$ZodError",wk),Ut=T("$ZodError",wk,void 0,{Parent:Error});function OM(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 Ra(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?OM(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ia(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,c=0;for(;c<s.length;){let u=s[c],d=c===s.length-1;if(u==="_errors"){d&&l._errors.push(t(a)),c++;continue}Object.prototype.hasOwnProperty.call(l,u)||Object.defineProperty(l,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=l[u];d&&f._errors.push(t(a)),l=f,c++}}}};return o(e),r}function of(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>o({issues:l},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let l=[...i,...s.path];if(l.length===0){r.errors.push(t(s));continue}let c=r,u=0;for(;u<l.length;){let d=l[u],f=u===l.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(a=c.items)[d]??(a[d]={errors:[]}),c=c.items[d]),f&&c.errors.push(t(s)),u++}}};return o(e),r}function kk(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function af(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${kk(o.path)}`);return t.join(`
|
|
4
4
|
`)}function Ll(e,t){return{callee:t?.callee??e,Err:t?.Err}}var zo=e=>{let t=(r,o,n,i)=>{let a=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},a);if(s instanceof Promise)throw new zt;if(s.issues.length){let l=new(i?.Err??e)(s.issues.map(c=>Lt(c,a,Xe())));throw Dl(l,i?.callee??t),l}return s.value};return t},zl=zo(Ut),Uo=e=>{let t=async(r,o,n,i)=>{let a=n?{...n,async:!0}:{async:!0},s=r._zod.run({value:o,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(i?.Err??e)(s.issues.map(c=>Lt(c,a,Xe())));throw Dl(l,i?.callee??t),l}return s.value};return t},Ul=Uo(Ut),Bo=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new zt;return i.issues.length?$k(e,i.issues,n):{success:!0,data:i.value}},CM=Bo(Ut);function $k(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>Lt(n,r,Xe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Vo=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?$k(e,i.issues,n):{success:!0,data:i.value}},DM=Vo(Ut),jM=Symbol.for("zod.compile.invalid"),NM=Symbol.for("zod.compile.fallback"),Ta=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==jM)return!0;if(o.definite===!0&&r===void 0)return!1}return FM(e,t,r)});function FM(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n?(o[NM]=!0,i=n({value:t,issues:[]},o)):i=e._zod.run({value:t,issues:[]},o),i instanceof Promise)throw new zt;return i.issues.length===0}var Pa=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},Bl=e=>{let t=zo(e),r=(o,n,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,s,Ll(r,a))};return r},LM=Bl(Ut),Vl=e=>{let t=zo(e),r=(o,n,i,a)=>t(o,n,i,Ll(r,a));return r},zM=Vl(Ut),Zl=e=>{let t=Uo(e),r=async(o,n,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,s,Ll(r,a))};return r},UM=Zl(Ut),Gl=e=>{let t=Uo(e),r=async(o,n,i,a)=>await t(o,n,i,Ll(r,a));return r},BM=Gl(Ut),Hl=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Bo(e)(t,r,n)},VM=Hl(Ut),Wl=e=>(t,r,o)=>Bo(e)(t,r,o),ZM=Wl(Ut),Jl=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Vo(e)(t,r,n)},GM=Jl(Ut),Kl=e=>async(t,r,o)=>Vo(e)(t,r,o),HM=Kl(Ut);var tn={};Dn(tn,{anyString:()=>Mf,base64:()=>xf,base64url:()=>Sf,bigint:()=>Df,boolean:()=>jf,browserEmail:()=>eC,cidrv4:()=>kf,cidrv6:()=>$f,creditCard:()=>ql,cuid:()=>lf,cuid2:()=>cf,currencyCode:()=>Pf,date:()=>Af,datetime:()=>Of,domain:()=>If,duration:()=>hf,e164:()=>Tf,email:()=>bf,emoji:()=>yf,extendedDuration:()=>WM,guid:()=>gf,hex:()=>Uf,hostname:()=>Rf,html5Email:()=>XM,httpProtocol:()=>Aa,iban:()=>Xl,idnEmail:()=>QM,integer:()=>Ea,ipv4:()=>_f,ipv6:()=>vf,ksuid:()=>mf,lowercase:()=>Lf,mac:()=>wf,md5_base64:()=>oC,md5_base64url:()=>iC,md5_hex:()=>rC,nanoid:()=>ff,nanoidOfLength:()=>pf,null:()=>Nf,number:()=>Zn,rfc5322Email:()=>YM,sha1_base64:()=>sC,sha1_base64url:()=>lC,sha1_hex:()=>aC,sha256_base64:()=>uC,sha256_base64url:()=>dC,sha256_hex:()=>cC,sha384_base64:()=>fC,sha384_base64url:()=>pC,sha384_hex:()=>mC,sha512_base64:()=>gC,sha512_base64url:()=>bC,sha512_hex:()=>hC,string:()=>Cf,time:()=>Ef,ulid:()=>uf,undefined:()=>Ff,unicodeEmail:()=>xk,uppercase:()=>zf,uuid:()=>Vr,uuid4:()=>JM,uuid6:()=>KM,uuid7:()=>qM,xid:()=>df});var lf=/^[cC][0-9a-z]{6,}$/,cf=/^[0-9a-z]+$/,uf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,df=/^[0-9a-vA-V]{20}$/,mf=/^[A-Za-z0-9]{27}$/,ff=/^[a-zA-Z0-9_-]{21}$/;function pf(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gf=/^([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})$/,Vr=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)$/,JM=Vr(4),KM=Vr(6),qM=Vr(7),bf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,XM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,YM=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,xk=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,QM=xk,eC=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tC="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function yf(){return new RegExp(tC,"u")}var _f=/^(?:(?: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])$/,vf=/^(([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}|:))$/,wf=e=>{let t=en(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},kf=/^((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])$/,$f=/^(([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])$/,xf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sf=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rf=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,If=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Aa=/^https?$/,Tf=/^\+[1-9]\d{6,14}$/,ql=/^\d(?:[ -]?\d){11,18}$/,Pf=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Xl=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Sk="(?:(?:\\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 nC(e){return new RegExp(`^${e}$`)}var Af=nC(Sk);function sf(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 Ef(e){return new RegExp(`^${sf(e)}$`)}function Of(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${sf({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${sf({precision:e.precision})}`:r;return new RegExp(`^${Sk}T(?:${o})$`)}var Mf=/^[\s\S]{0,}$/,Cf=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Df=/^-?\d+n?$/,Ea=/^-?\d+$/,Zn=/^-?\d+(?:\.\d+)?$/,jf=/^(?:true|false)$/i,Nf=/^null$/i;var Ff=/^undefined$/i;var Lf=/^[^A-Z]*$/,zf=/^[^a-z]*$/,Uf=/^[0-9a-fA-F]*$/;function Oa(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ma(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var rC=/^[0-9a-fA-F]{32}$/,oC=Oa(22,"=="),iC=Ma(22),aC=/^[0-9a-fA-F]{40}$/,sC=Oa(27,"="),lC=Ma(27),cC=/^[0-9a-fA-F]{64}$/,uC=Oa(43,"="),dC=Ma(43),mC=/^[0-9a-fA-F]{96}$/,fC=Oa(64,""),pC=Ma(64),hC=/^[0-9a-fA-F]{128}$/,gC=Oa(86,"=="),bC=Ma(86);var Le=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Bf=e=>{let t=e.value;return!Cl(t)&&t.size!==void 0},Vf=e=>{let t=e.value;return!Cl(t)&&t.length!==void 0},Yl={number:"number",bigint:"bigint",object:"date"},ec=T("$ZodCheckLessThan",(e,t)=>{Le.init(e,t);let r=Yl[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Yl[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})}}),tc=T("$ZodCheckGreaterThan",(e,t)=>{Le.init(e,t);let r=Yl[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Yl[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})}}),Zf=T("$ZodCheckMultipleOf",(e,t)=>{Le.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):ya(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})}}),Gf=T("$ZodCheckNumberFormat",(e,t)=>{Le.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=wa[t.format];e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,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}):a.issues.push({input:s,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}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Hf=T("$ZodCheckBigIntFormat",(e,t)=>{Le.init(e,t);let[r,o]=ka[t.format];e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Wf=T("$ZodCheckMaxSize",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Bf),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:$a(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Jf=T("$ZodCheckMinSize",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Bf),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:$a(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Kf=T("$ZodCheckSizeEquals",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Bf),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:$a(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),qf=T("$ZodCheckMaxLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=o=>{let n=o.value,i=n.length;if((typeof n=="string"&&i>t.maximum?Br(n):i)<=t.maximum)return;let s=xa(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xf=T("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=o=>{let n=o.value,i=n.length;if((typeof n=="string"&&i>=t.minimum&&i<t.minimum*2?Br(n):i)>=t.minimum)return;let s=xa(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yf=T("$ZodCheckLengthEquals",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=o=>{let n=o.value,i=n.length,a=typeof n=="string"&&i>=t.length&&i<=t.length*2?Br(n):i;if(a===t.length)return;let s=xa(n),l=a>t.length;o.issues.push({origin:s,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Zo=T("$ZodCheckStringFormat",(e,t)=>{var r,o;Le.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=()=>{})}),Qf=T("$ZodCheckRegex",(e,t)=>{Zo.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})}}),ep=T("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Lf),Zo.init(e,t)}),tp=T("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zf),Zo.init(e,t)}),np=T("$ZodCheckIncludes",(e,t)=>{Le.init(e,t);let r=en(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})}}),rp=T("$ZodCheckStartsWith",(e,t)=>{Le.init(e,t);let r=new RegExp(`^${en(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})}}),op=T("$ZodCheckEndsWith",(e,t)=>{Le.init(e,t);let r=new RegExp(`.*${en(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})}});function Ql(e,t,r){e.issues.length&&t.issues.push(...Ft(r,e.issues))}var ip=T("$ZodCheckProperty",(e,t)=>{Le.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Ql(n,r,t.property));Ql(o,r,t.property)}}),ap=T("$ZodCheckProperties",(e,t)=>{Le.init(e,t),Sa(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let n=o.value,i;for(let[a,s]of r){let l=s._zod.run({value:n[a],issues:[]},{});l instanceof Promise?(i??(i=[]),i.push(l.then(c=>Ql(c,o,a)))):Ql(l,o,a)}if(i)return Promise.all(i).then(()=>{})}}),sp=T("$ZodCheckMimeType",(e,t)=>{Le.init(e,t);let r=new Set(t.mime);e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),lp=T("$ZodCheckOverwrite",(e,t)=>{Le.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Zr=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(`
|
|
5
5
|
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
6
6
|
${r.join(`
|
|
@@ -231,9 +231,9 @@ ${(i??[]).map(s=>`note: ${s}
|
|
|
231
231
|
${(await Un(u)).replace(/^/gm," ")}`}catch(u){c+=`
|
|
232
232
|
read failed: ${u instanceof Error?u.message:String(u)}`}s.push(c)}return Ae(s.join(`
|
|
233
233
|
|
|
234
|
-
`))}catch(i){return D(i)}}},{name:"host_export",hidden:!0,protectedStages:["canonicalize"],title:"Export a timeline from the running host",description:`Ask the running host to export a timeline in its own format, through its scripting door (read-only on the project), and read it into a session. Resolve: any timeline of the open project by name (default: the one in the viewer) as Resolve's own .drt. Baselight: a scene (default: the one open in the app; or "host:job:scene") read shot by shot through FLAPI into an OTIO. Premiere, Media Composer, Flame, Nuke Studio: through the conform.tools plugin in the host (host_setup says how to install it), as OTIO (Premiere / Media Composer: the host's own export; Flame / Nuke: the timeline as the plugin reads it). Use when host_current cannot read the open timeline from disk (a PostgreSQL project library, a timeline never saved), or to pick a timeline by name.`,inputSchema:{host:h.enum(at).describe("The host to export from"),timeline:h.string().optional().describe("Timeline name; the open one when omitted"),out_path:h.string().optional().describe("Where to write the file; a temp file when omitted"),read:h.boolean().default(!0).describe("Also read it into a session (session_id in the reply)")},run:async({host:e,timeline:t,out_path:r,read:o})=>{try{if(e==="premiere"&&!r&&o!==!1){let{premiereSession:l}=await import("./host-relink-
|
|
234
|
+
`))}catch(i){return D(i)}}},{name:"host_export",hidden:!0,protectedStages:["canonicalize"],title:"Export a timeline from the running host",description:`Ask the running host to export a timeline in its own format, through its scripting door (read-only on the project), and read it into a session. Resolve: any timeline of the open project by name (default: the one in the viewer) as Resolve's own .drt. Baselight: a scene (default: the one open in the app; or "host:job:scene") read shot by shot through FLAPI into an OTIO. Premiere, Media Composer, Flame, Nuke Studio: through the conform.tools plugin in the host (host_setup says how to install it), as OTIO (Premiere / Media Composer: the host's own export; Flame / Nuke: the timeline as the plugin reads it). Use when host_current cannot read the open timeline from disk (a PostgreSQL project library, a timeline never saved), or to pick a timeline by name.`,inputSchema:{host:h.enum(at).describe("The host to export from"),timeline:h.string().optional().describe("Timeline name; the open one when omitted"),out_path:h.string().optional().describe("Where to write the file; a temp file when omitted"),read:h.boolean().default(!0).describe("Also read it into a session (session_id in the reply)")},run:async({host:e,timeline:t,out_path:r,read:o})=>{try{if(e==="premiere"&&!r&&o!==!1){let{premiereSession:l}=await import("./host-relink-UWML4C7W.js"),c=wt("premiere"),u=await l(c,t).catch(d=>{if(d.code==="panel_old")return null;throw d});if(u){let d=await Xt(u.session,u.path,/\.otio$/i.test(u.path)?"otio":"prproj"),f=await c.current(),m=u.session.timelines[0]?.name??t??f.timeline;return z([`read ${f.project} / ${m} from ${u.from}`,...u.lossy?[`\u26A0 ${u.lossy}`]:[],`session_id: ${d.id}`,await Un(u.session)].join(`
|
|
235
235
|
`),{path:u.path,format:/\.otio$/i.test(u.path)?"otio":"prproj",project:f.project,timeline:m,session_id:d.id,from:u.from})}}let n=r??M(await nt("conform-export-"),`${(t??"current").replace(/[^\w.-]+/g,"_")}.${e==="resolve"?"drt":"otio"}`),i=await wt(e).export({timeline:t,out_path:n}),a=[`exported ${i.project} / ${i.timeline} \u2192 ${i.path} (${i.format})`,...(i.notes??[]).map(l=>`\u26A0 ${l}`)].join(`
|
|
236
|
-
`),s={...i};if(o!==!1){let{session:l,format:c}=await Mo(i.path,i.format);e==="resolve"&&await(await import("./host-relink-
|
|
236
|
+
`),s={...i};if(o!==!1){let{session:l,format:c}=await Mo(i.path,i.format);e==="resolve"&&await(await import("./host-relink-UWML4C7W.js")).withOfflineReference(wt("resolve"),l).catch(()=>0),e==="premiere"&&await(await import("./host-relink-UWML4C7W.js")).withPremiereTimecodes(wt("premiere"),l).catch(()=>0);let u=await Xt(l,i.path,c);a+=`
|
|
237
237
|
session_id: ${u.id}
|
|
238
238
|
${await Un(l)}`,s.session_id=u.id}return z(a,s)}catch(n){return D(new P("refused",n instanceof Error?n.message:String(n)))}}},{name:"host_open",protectedStages:["write"],title:"Open a timeline file in the running host",description:`Import a timeline file into the running host as a NEW timeline (never overwrites one; a taken name gets a number). Resolve: into the open project's conform.tools media pool folder (into=current, the default), or into our scratch project (into=scratch: the user's project is saved first, then reopened). Baselight: a NEW scene in the open scene's job (into=current) or our job conform_tools (into=scratch), V1 built shot by shot from the file's media paths, saved; the scene in the app is never touched. folder (Resolve): the media pool folder to land it in, by path under Master, e.g. "000 - TIMELINES/20261006" (learn the project's layout with host_project first); a missing folder is refused unless create_folder=true. link_existing=true links the timeline to clips already in the media pool (no duplicate clips; Resolve importSourceClips off): the way to bring an insert/update timeline into a project that has the media. The user's timeline, folder and page are put back afterwards unless stay=true. Use after timeline_write to land a conversion in the host, or to bring a turnover in for checking. Premiere, Media Composer, Flame, Nuke Studio: through the host's conform.tools plugin, into the open project (Flame: the CONFORM.TOOLS reel group on the desktop, segments relinked to media on disk). session_id (+ timeline_id) opens a session's timeline directly \u2014 the push half of a Resolve tool: host_current via=export \u2192 timeline_edit add_handles / all_clips \u2192 host_open session_id timeline_id link_existing=true.`,inputSchema:{host:h.enum(at).describe("The host to open it in"),path:h.string().optional().describe("The timeline file (Resolve: .drt, .xml, .fcpxml, .aaf, .edl, .otio); or give session_id"),session_id:h.string().optional().describe("Open a timeline of this session instead of a file (written here first in the host's own format: .drt Resolve, .prproj Premiere, .avb Media Composer, .fcpxml Flame, FCP7 .xml Nuke Studio)"),timeline_id:h.string().optional().describe("With session_id: which timeline (e.g. the one timeline_edit just built); default the session's first"),name:h.string().optional().describe("Timeline name; the file name (or the session timeline's name) when omitted"),into:h.enum(["current","scratch"]).default("current").describe("current: the open project; scratch: our own project"),media_dirs:h.array(h.string()).optional().describe("Folders to link media from while importing"),stay:h.boolean().default(!1).describe("Leave the host showing the imported timeline"),folder:h.string().optional().describe('Resolve: media pool folder path to import into, e.g. "000 - TIMELINES/20261006" (default: conform.tools)'),create_folder:h.boolean().default(!1).describe("Create the folder (and its parents) when missing"),link_existing:h.boolean().default(!1).describe("Link to clips already in the media pool instead of importing new ones")},run:async({host:e,path:t,session_id:r,timeline_id:o,name:n,into:i,media_dirs:a,stay:s,folder:l,create_folder:c,link_existing:u})=>{try{if(r){let m=await Fe(r),p=m.session.timelines.find(b=>b.id===o)??m.session.timelines.find(b=>b.kind!=="compound");if(!p)return D(new P("not_found",`no timeline ${o??""} in session ${r}`));let g={...m.session,timelines:m.session.timelines.filter(b=>b.id===p.id||b.kind==="compound")},[_,v]=HO[e]??HO.resolve;t=(await jm(g,_,M(await nt("conform-open-"),`${p.name.replace(/[^\w.-]+/g,"_")}.${v}`),m.source_path)).path,n??=p.name}if(!t)return D(new P("invalid_args","host_open needs path or session_id"));let d=await wt(e).open({path:t,name:n,into:i,media_dirs:a,stay:s,folder:l,create_folder:c,link_existing:u}),f=[`opened in ${e}: ${d.project} / ${d.timeline}${d.folder?` (media pool: ${d.folder})`:""}`,d.restored?"the user's timeline, folder and page were put back":"left showing the imported timeline",...u?["linked to clips already in the media pool (no new clips imported)"]:[],...d.notes];return z(f.join(`
|
|
239
239
|
`),{...d})}catch(d){return D(new P("refused",d instanceof Error?d.message:String(d)))}}},{name:"host_render",long:!0,title:"Render a timeline in the running host (optionally through the renderplugin)",description:`Render a timeline (or a frame range of it) with the host's own renderer and wait for the files. Only OUR job is queued and started; the user's render queue is never run, their Deliver settings are restored as soon as our job is queued, and their timeline and page come back when it finishes. Refuses while the host is already rendering. Resolve: preset = a render preset saved in Resolve (default: the project's current render settings); range = absolute timeline frames, inclusive; name = the output file name. Baselight: timeline = a scene (default: the one open in the app), preset = a deliverable defined in the scene (default: ProRes 422 HQ of the working space), queued on the local render queue as "conform.tools <name>". Premiere: preset = the path of a Media Encoder .epr. Flame (through its conform.tools hook): preset = one of Flame's export presets by name (required), range as Resolve's; Flame renders in the foreground and a running export cannot be cancelled from here. Picture only unless audio=true. audio_tracks (Resolve) = the Deliver page's audio output routing by timeline track, which its API cannot set: [1, 2] = A1 (5.1) on ch1-6 + A2 (stereo) on ch7-8 (an 8CH_5-1_STEREO deliverable), [2] = stereo only; set it whenever a name promises a channel layout. disable_tracks = video tracks to leave out of this render, by name (every track so named, e.g. ["Lower Thirds"] for a TEXTLESS version) or "V7": Resolve's API has no per-job track selection, so they are switched off on the Edit page (read back) for our job and switched back on when it ends. Resolve names the queued job itself ("Job N"); its API cannot. renderplugin=true (Resolve): render through the conform.tools renderplugin instead, which measures EVERY frame after grading and compositing, and return findings: black edges (blanking) per range with the clip and edge, black frames, failed/warned checks (clipping, freeze/flash, dead pixels, leader/slate), audio loudness and peak; markers go on the timeline (ours, tagged; a re-run replaces them, nobody else's are touched). The throwaway render is deleted unless keep_render. strictness: strict (1 px, 1 frame; default) | standard | relaxed. expected_aspect: the delivered ratio when bars are part of the deliverable (2.39 in UHD, 1.85 in DCI). Use for finishing QC ('check this timeline for black edges', 'QC the master before it goes'). Long: pass background=true for a job id, then job action=status.`,inputSchema:{host:h.enum(at).describe("The host to render in"),timeline:h.string().optional().describe("Timeline name; the open one when omitted"),target_dir:h.string().optional().describe("Folder for the render (required unless renderplugin=true); created if missing"),name:h.string().optional().describe("Output name without extension; the timeline name when omitted"),preset:h.string().optional().describe("A render preset saved in the host"),range:h.object({in:h.number().int(),out:h.number().int()}).optional().describe("Frame range, absolute timeline frames, inclusive"),audio:h.boolean().optional().describe("Render audio with the picture (default: off = picture only; on for renderplugin)"),disable_tracks:h.array(h.string()).optional().describe('Video tracks to leave out of this render, by name or "V7" (e.g. ["Lower Thirds"] for TEXTLESS)'),audio_tracks:h.array(h.number().int().positive()).optional().describe("Resolve: audio output n = timeline track audio_tracks[n], e.g. [1, 2] = 5.1 (A1) on ch1-6 + stereo (A2) on ch7-8; [2] = stereo only. Implies audio"),renderplugin:h.boolean().default(!1).describe("Resolve: render through the conform.tools renderplugin and return QC findings"),strictness:h.enum(Object.keys(ma)).optional().describe("renderplugin: strict (default) | standard | relaxed"),expected_aspect:h.number().positive().optional().describe("renderplugin: delivered aspect ratio when bars are expected, e.g. 2.39"),markers:h.boolean().default(!0).describe("renderplugin: place markers on the findings"),keep_render:h.boolean().default(!1).describe("renderplugin: keep the throwaway ProRes render"),ignore_space:h.boolean().default(!1).describe("renderplugin: skip the free-space check")},run:async({host:e,timeline:t,target_dir:r,name:o,preset:n,range:i,audio:a,disable_tracks:s,audio_tracks:l,renderplugin:c,strictness:u,expected_aspect:d,markers:f,keep_render:m,ignore_space:p,__progress:g,__signal:_})=>{let v=wt(e);try{if(c){if(e!=="resolve")return D(new P("unsupported","the renderplugin is a DaVinci Resolve plugin"));let w=await $E(v,ga,{timeline:t,range:i,strictness:u,expected_aspect:d,markers:f,keep_render:m,ignore_space:p,audio:a},g,_);return z(xE(w),{...w})}if(!r)return D(new P("invalid_args","target_dir is required (unless renderplugin=true)"));if(l?.length&&e!=="resolve")return D(new P("unsupported","audio_tracks (output routing) is for DaVinci Resolve"));let y=await v.renderStart({timeline:t,target_dir:r,name:o,preset:n,range:i,audio:(a??!1)||!!l?.length,...s?.length?{disable_tracks:s}:{},...l?.length?{audio_tracks:l}:{}});if(y=await hv(v,y,g,_),y.state!=="complete")return D(new P(y.state==="cancelled"?"cancelled":"engine",`render ${y.state}${y.error?`: ${y.error}`:""}${y.notes?.length?`; ${y.notes.join("; ")}`:""}`));let b=y.outputs?.length?y.outputs:await Q0(r,o??t??"");return z([`rendered in ${e} \u2192 ${b.join(", ")||r}${a||l?.length?"":" (picture only)"}`,...s?.length?[`without video tracks: ${s.join(", ")}`]:[],...l?.length?[`audio outputs: ${l.map((w,k)=>`${k+1} = timeline track ${w}`).join(", ")} \u2014 probe the file to confirm the channel layout`]:[],"the user's render settings, timeline and page were put back",`${e} render queue job ${y.job_id} (the host's own id, kept in its queue \u2014 not a conform.tools job id)`,...y.notes??[]].join(`
|
|
@@ -242,7 +242,7 @@ ${s({...c.summary,name:c.preset})}`:""}
|
|
|
242
242
|
prove it: host_render a ~11-frame range with this preset, then media_probe the channels`,c)}let l=await a.presets({...r?.length?{names:r}:{}});return z([`${l.presets.length} render preset(s) in "${l.project}":`,...l.presets.map(s)].join(`
|
|
243
243
|
`),l)}catch(a){return D(new P("refused",a instanceof Error?a.message:String(a)))}}},{name:"host_project",title:"Learn the open host project: media pool, render queue, tracks",description:"Read-only look at the project open in the running host, to learn its conventions before acting. Resolve: the media pool folder tree with clip counts (clips=true lists every clip with its file, start TC and usage); find = file paths or name fragments to look up project-wide ('is this file already in the project? where?'); the render queue with each job's name, timeline, output folder/file, status, mark in/out and the settings Resolve reports; and every track of a timeline (default: the open one) with its name and enabled/locked state. Use before host_open (which folder) and host_render (which tracks are Lower Thirds, which job made the deliverable).",inputSchema:{host:h.enum(at).default("resolve").describe("The host"),timeline:h.string().optional().describe("Timeline whose tracks to list; the open one when omitted"),clips:h.boolean().default(!1).describe("List every clip in every folder (large projects: long)"),find:h.array(h.string()).optional().describe("File paths or name fragments to look up in the media pool")},run:async({host:e,timeline:t,clips:r,find:o})=>{try{let n=wt(e??"resolve");if(!n.project)return D(new P("unsupported",`${n.host}: host_project is not available for this host yet`));let i=await n.project({timeline:t,clips:r,find:o}),a=0,s=0,l=[],c=(d,f)=>{f&&(a++,l.push(`${" ".repeat(f)}${d.path.split("/").pop()} (${d.clips} clip${d.clips===1?"":"s"})`)),s+=d.clips;for(let m of d.clip_list??[])l.push(`${" ".repeat(f+1)}- ${m.name} ${m.file}${m.start_tc?` TC ${m.start_tc}`:""}${m.usage?` used ${m.usage}x`:""}`);for(let m of d.folders)c(m,f+1)};c(i.pool,0);let u=[`${e??"resolve"} project "${i.project}": ${a} media pool folders, ${s} clips; ${i.jobs.length} render job(s)${i.timeline?`; timeline "${i.timeline}" has ${i.tracks.length} tracks`:""}`];u.push("media pool:",...l.length?l:[" (no folders)"]);for(let[d,f]of Object.entries(i.found??{}))u.push(f.length?`find "${d}": ${f.map(m=>`${m.folder||"Master"}/${m.name} (${m.file||"no file"}${m.usage?`, used ${m.usage}x`:""})`).join("; ")}`:`find "${d}": not in the project`);i.jobs.length&&u.push("render queue:");for(let d of i.jobs){let f=d.MarkIn!=null?` frames ${d.MarkIn}-${d.MarkOut}`:"";u.push(` ${d.RenderJobName??d.JobId} [${d.JobStatus||"?"}] "${d.TimelineName??""}" \u2192 ${Wv(String(d.TargetDir??""),String(d.OutputFilename??""))}${f}${d.VideoCodec?` ${d.VideoFormat??""} ${d.VideoCodec}`:""}${d.PresetName?` preset ${d.PresetName}`:""}`)}return i.tracks?.length&&u.push(`tracks: ${f_(i.tracks)}`),z(u.join(`
|
|
244
244
|
`),i)}catch(n){return D(new P("refused",n instanceof Error?n.message:String(n)))}}},{name:"host_items",title:"Live clip attributes in the host (colour, flags, versions, groups)",description:"Resolve: per item of a timeline (default the open one) what its timeline file does not carry: clip colour, flags, enabled, the loaded grade version, colour group, node count, keywords, and its unique id. Items are addressed like timeline_query rows: kind + 1-based track + start (record frames from the timeline start), so the two join. Also the project's colour groups and node-stack layer count. Read-only.",inputSchema:{host:h.enum(at).default("resolve").describe("The host (each says when it cannot do this yet)"),timeline:h.string().optional().describe("Timeline by name; the open one when omitted"),kind:h.enum(["video","audio"]).optional(),track:h.number().int().positive().optional(),selected:h.boolean().optional().describe("only the clips selected in the host's timeline right now: {selected: [{kind, track, start, id, name}]}")},run:async({host:e,timeline:t,kind:r,track:o,selected:n})=>{try{let i=wt(e??"resolve");if(!i.items)return D(new P("unsupported",`${i.host}: host_items is not available for this host yet`));if(n){let l=await i.items({timeline:t,selected:!0});return z(`"${l.timeline}": ${l.selected.length} clip(s) selected`,l)}let a=await i.items({timeline:t,kind:r,track:o}),s=l=>a.items.filter(c=>c[l]&&(!Array.isArray(c[l])||c[l].length)).length;return z(`"${a.timeline}": ${a.items.length} items; ${s("color")} with a clip colour, ${s("flags")} flagged, ${a.items.filter(l=>!l.enabled).length} disabled; colour groups: ${a.color_groups.join(", ")||"none"}`,a)}catch(i){return D(new P("refused",i instanceof Error?i.message:String(i)))}}},{name:"host_apply",title:"Change clips in the open host timeline (colour, flags, markers, grades, names)",description:"Resolve: carry out live edits on a timeline (default the open one), in order, each read back. Items are addressed {kind?, track, start} (a timeline_query row's track number and record start frame from the timeline start) or {id} (host_items). Ops: marker_add|marker_update|marker_delete {item?, frame, color?, name?, note?, duration?, data?, to_frame?} (no item = a timeline marker; frame from the timeline start, or from the clip's start for a clip marker); clip_color {item, color|''}; flags {item, add?:[colour], clear?:colour|'All'}; enabled {item, on}; name {item, name}; properties {item, set:{Pan, Tilt, ZoomX, ZoomY, RotationAngle, FlipX, CropLeft\u2026, Opacity, CompositeMode, RetimeProcess\u2026}}; metadata {item, set:{Keywords, Comments, Scene\u2026}} (the clip's media pool item); copy_grade {item, to:[item], from_timeline?} (verified by node count; from_timeline = the source item is in that timeline); copy_properties {item, to:[item], keys:[Pan, ZoomX, CropLeft, Opacity\u2026]} (the source's values as Resolve holds them); version {item, add|load|delete, type?:'local'|'remote'}; color_group {item, group|''}; cache {item, color?:bool, fusion?:'Auto'|'On'|'Off'}; fades {item, set}; output_blanking {item, set}; drx {item, path, graph?, mode?} (apply a .drx still); edit_keys {item, keys:[{t, transform, shape?}]} (timeline_align sizing_target edit, a move: Resolve cannot keyframe the Edit page from a script, so after every other op the moving clips are keyed on a copy, '<timeline> ALIGNED' \u2014 Resolve's own .drt of the timeline with only those clips' Transform keyed on Resolve's Edit-page law, every grade and setting as it was, linked to the same pool clips; the timeline itself is not changed); grade_sizing {item, target:'input'|'node', zoom, height?, rotation (degrees clockwise), pan, tilt (fractions of the timeline width / height, tilt up), flip_x?, flip_y?} (Color-page Input Sizing or node Sizing as timeline_align answers it, ADDED to the clip's grade as it stands on a new local version 'conform.tools aligned' (the colourist's version untouched; a grade that cannot be read is refused, never replaced); a clip on a remote version is moved onto its local one first; undo resets the grade and loads the remote version back); node_structure {item, node_structure: a .drx path} (that node tree onto the clip on a new local version 'conform.tools aligned', the colourist's own version untouched; undo goes back); lut {item, graph?, node, path}; node_copy {item, from:{layer|pre|post|timeline}, to:{\u2026}, to_item?, clear_source?}; playhead {tc} (move the playhead to a record timecode); pool_rename {clip:id, name}; pool_move {clips:[id], folder, create?}; pool_delete {clips:[id]}; pool_import {paths:[file], folder:'A/B', at?:[frame]} (import files into that pool folder, made if missing; at = lay each on one new top video track at that frame from the timeline start; undo removes the track and what it added); track_delete {kind, index}; timeline_rename {timeline?, name}; timeline_duplicate {timeline?, name} (a copy under a name no timeline has, made the open one; answers its name); goto {timeline?, frame} (open that timeline with the playhead on frame, from its start). The reply has one result per op and an undo_id: host_apply {undo: undo_id} puts back everything that batch changed (pool_delete, copy_grade and drx cannot be undone). Changes the user's project: only when asked.",inputSchema:{host:h.enum(at).default("resolve").describe("The host (each says when it cannot do this yet)"),timeline:h.string().optional().describe("Timeline by name; the open one when omitted"),ops:h.array(h.object({op:h.string()}).passthrough()).optional().describe("The edits, in order (see description)"),undo:h.string().optional().describe("An undo_id from an earlier host_apply: put that batch back")},protectedStages:["canonicalize","write"],run:async({host:e,timeline:t,ops:r,undo:o})=>{try{let n=wt(e??"resolve");if(!n.apply)return D(new P("unsupported",`${n.host}: host_apply is not available for this host yet`));let i=M(he(),"host-undo"),a=r;if(o){let d=JSON.parse(await _e(M(i,`${o.replace(/[^\w-]/g,"")}.json`)));a=d.ops,t=d.timeline}if(!a?.length)return D(new P("usage","host_apply needs ops (or undo)"));let s=await n.apply({timeline:t,ops:a}),l;s.undo.length&&(l=`${Date.now().toString(36)}-${crypto.randomUUID().slice(0,6)}`,await be(i),await ge(M(i,`${l}.json`),JSON.stringify({timeline:s.timeline,project:s.project,ops:s.undo})));let c=s.results.map((d,f)=>({...d,i:f})).filter(d=>!d.ok),u=[`${o?"undid":"applied"} ${s.applied}/${s.results.length} on "${s.timeline}" (${s.project})${l?`; undo_id: ${l}`:""}`];for(let d of c.slice(0,20))u.push(` #${d.i+1} ${d.op}: ${d.detail??(d.refused?`refused ${d.refused.join(", ")}`:"Resolve refused")}`);return c.length>20&&u.push(` \u2026and ${c.length-20} more`),z(u.join(`
|
|
245
|
-
`),{...s,undo:void 0,undo_id:l})}catch(n){return D(new P("refused",n instanceof Error?n.message:String(n)))}}},{name:"host_edit",title:"Edit the open Premiere sequence into a new one (resize, un-nest, frame rate, handles\u2026)",description:"Premiere: read the open sequence (the saved .prproj when it matches the live one \u2014 every effect, retime and nest \u2014 else Premiere's OTIO export with its timecodes), run timeline_edit operations on it, and import the result as a NEW sequence written by the conform.tools .prproj writer. The open sequence never changes. ops: [{kind, args}] in order, kinds as timeline_edit (timeline_id defaults to the sequence), plus unnest. Common jobs: resize without moving a pixel: {kind:'reformat', args:{resolution_w:3840, resolution_h:2160}} (HD \u2194 UHD: every clip keeps its framing; an aspect change needs fit:'fit'|'fill'|'stretch'); un-nest: {kind:'unnest'} (every nested sequence expanded into the cut with the nest's transform, opacity and speed composed onto its clips; multicam clips read as their active angle; adjustment layers kept); conform the rate: {kind:'timeline_rate', args:{fps_num, fps_den}}; a handles / all-clips / string-out version: add_handles {handles}, all_clips {}, stringout {}. name: the new sequence's name (default <sequence>_<KIND>). The reply lists what the writer could not carry.",inputSchema:{host:h.enum(["premiere"]).default("premiere"),timeline:h.string().optional().describe("Sequence by name; the active one when omitted"),ops:h.array(h.object({kind:h.string(),args:h.object({}).passthrough().optional()})).min(1),name:h.string().optional()},run:async({timeline:e,ops:t,name:r})=>{try{let{hostEdit:o}=await import("./host-relink-
|
|
245
|
+
`),{...s,undo:void 0,undo_id:l})}catch(n){return D(new P("refused",n instanceof Error?n.message:String(n)))}}},{name:"host_edit",title:"Edit the open Premiere sequence into a new one (resize, un-nest, frame rate, handles\u2026)",description:"Premiere: read the open sequence (the saved .prproj when it matches the live one \u2014 every effect, retime and nest \u2014 else Premiere's OTIO export with its timecodes), run timeline_edit operations on it, and import the result as a NEW sequence written by the conform.tools .prproj writer. The open sequence never changes. ops: [{kind, args}] in order, kinds as timeline_edit (timeline_id defaults to the sequence), plus unnest. Common jobs: resize without moving a pixel: {kind:'reformat', args:{resolution_w:3840, resolution_h:2160}} (HD \u2194 UHD: every clip keeps its framing; an aspect change needs fit:'fit'|'fill'|'stretch'); un-nest: {kind:'unnest'} (every nested sequence expanded into the cut with the nest's transform, opacity and speed composed onto its clips; multicam clips read as their active angle; adjustment layers kept); conform the rate: {kind:'timeline_rate', args:{fps_num, fps_den}}; a handles / all-clips / string-out version: add_handles {handles}, all_clips {}, stringout {}. name: the new sequence's name (default <sequence>_<KIND>). The reply lists what the writer could not carry.",inputSchema:{host:h.enum(["premiere"]).default("premiere"),timeline:h.string().optional().describe("Sequence by name; the active one when omitted"),ops:h.array(h.object({kind:h.string(),args:h.object({}).passthrough().optional()})).min(1),name:h.string().optional()},run:async({timeline:e,ops:t,name:r})=>{try{let{hostEdit:o}=await import("./host-relink-UWML4C7W.js"),n=await o(wt("premiere"),{timeline:e,ops:t,name:r});return z(n.text,n.data)}catch(o){return D(new P("refused",o instanceof Error?o.message:String(o)))}}},{name:"host_relink",title:"Conform into the open Premiere sequence (proxies \u2192 online, cut in returns)",description:"Premiere: link the open sequence's media with conform.tools' matcher (Conform Connect: reel, timecode containment, loose proxy names, picture when asked) instead of Premiere's Link Media, then hand the result to Premiere. The sequence is read from the saved .prproj when it matches the live one (every effect and retime), else Premiere's XML export. modes: replace = repoint every proxy project clip at its online file (every use follows; not in Premiere's undo, the reply says how to put it back); hires = attach the online file as full-res behind each proxy (Premiere's Toggle Proxies switches between them); proxy = the other way: the project is on the online media and each clip gets its proxy from the folder attached (matched by name + timecode, not by Premiere's Attach Proxies); cut_in = cut each matched return (VFX / colour returns trimmed with handles, matched by reel + timecode) in over its clip on the track above (track, default the top + 1), video only, the clip's sizing carried, originals left underneath \u2014 one \u2318Z in Premiere; new_version = a NEW sequence written by the conform.tools .prproj writer from the relinked cut and imported (nothing in the open sequence changes). dry_run=true lists what would link to what. criteria / tolerances as timeline_relink (default: loose names for replace/hires, reel + timecode for cut_in). Changes the user's project: only when asked.",inputSchema:{host:h.enum(["premiere"]).default("premiere"),media_root:h.string().describe("The folder with the online media / returns"),mode:h.enum(["replace","hires","proxy","cut_in","new_version"]).default("new_version"),timeline:h.string().optional().describe("Sequence by name; the active one when omitted"),track:h.number().int().positive().optional().describe("cut_in: the video track to cut onto (default above the top track)"),name:h.string().optional().describe("new_version: the new sequence's name (default <sequence>_CONFORMED)"),dry_run:h.boolean().default(!1),criteria:h.object({}).passthrough().optional().describe("as timeline_relink criteria"),tolerances:h.object({}).passthrough().optional().describe("as timeline_relink tolerances")},run:async({media_root:e,mode:t,timeline:r,track:o,name:n,dry_run:i,criteria:a,tolerances:s})=>{try{let{hostRelink:l}=await import("./host-relink-UWML4C7W.js"),c=await l(wt("premiere"),{media_root:e,mode:t,timeline:r,track:o,name:n,dry_run:i,criteria:a,tolerances:s});return z(c.text,c.data)}catch(l){return D(new P("refused",l instanceof Error?l.message:String(l)))}}},{name:"host_setup",title:"Host readiness, and installing the renderplugin",description:"What works with each editing host on this machine and what to do about what doesn't (Resolve: Studio, external scripting, an open project; the conform.tools renderplugin installed and loaded). action=install_renderplugin downloads the published renderplugin for this platform, verifies its checksum before writing anything, and installs it into Resolve's system I/O plugin folder (the OS asks for an administrator password). Resolve must be restarted afterwards. action=install_probe installs ColorMatchProbe, the OFX plugin the app ships (Apple silicon Macs): it lets conform.tools read the Color page's selected clips and node (administrator password, then restart Resolve). action=install_panel installs the host's conform.tools plugin: Premiere's UXP panel with Adobe's own installer (the user then opens Window > UXP Plugins > conform.tools once); Flame's Python hook into this user's hook folder (then Rescan Python Hooks); the Nuke Studio / Hiero panel into ~/.nuke (then restart it). Never with sudo. Only install when the user asks.",inputSchema:{host:h.enum(at).default("resolve").describe("The host"),action:h.enum(["status","install_renderplugin","install_panel","install_probe"]).default("status")},run:async({host:e,action:t})=>{try{let r=e??"resolve";if((t??"status")==="install_panel"){if(r==="flame"||r==="nuke"){let s=bv[r],l=await s.install();return z([`conform.tools ${s.what} ${l.version} installed in ${l.dest}`,s.next].join(`
|
|
246
246
|
`),{...l})}if(r!=="premiere")return D(new P("unsupported","install_panel installs the conform.tools plugin for Premiere Pro, Flame or Nuke Studio (Media Composer's panel: mcp/hosts/avid/panel)"));let a=await rk();return z([`conform.tools panel ${a.version} installed for Premiere Pro (Adobe's installer: ${a.output.split(`
|
|
247
247
|
`).pop()})`,"In Premiere: Window > UXP Plugins > conform.tools (restart Premiere first if it was running). It connects by itself from then on."].join(`
|
|
248
248
|
`),{...a})}if(t==="install_probe"){if(r!=="resolve")return D(new P("unsupported","the probe is a DaVinci Resolve plugin"));let{installProbe:a}=await import("./probe-F7WQHMIA.js"),s=await a();return z([`ColorMatchProbe installed at ${s.path} (with administrator approval)`,"Restart Resolve: it loads OFX plugins at launch."].join(`
|