conformtools 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +58 -0
  2. package/dist/browser/timeline_core_bg.wasm +0 -0
  3. package/dist/chunk-6TM32YIJ.js +7 -0
  4. package/dist/chunk-7XTBFOUJ.js +3 -0
  5. package/dist/chunk-E6YXZIJS.js +230 -0
  6. package/dist/chunk-GXEVALBL.js +3 -0
  7. package/dist/{chunk-YPRTUS5W.js → chunk-N43NAG5E.js} +1 -1
  8. package/dist/chunk-PSMXHDMX.js +3 -0
  9. package/dist/chunk-PZFWQJCF.js +3 -0
  10. package/dist/chunk-R6WJ6JIQ.js +3 -0
  11. package/dist/chunk-UUDNNFU7.js +3 -0
  12. package/dist/chunk-XDHIIZ6A.js +3 -0
  13. package/dist/chunk-Y2BEEOPB.js +3 -0
  14. package/dist/chunk-ZAHP3ES5.js +3 -0
  15. package/dist/cli.js +5 -4
  16. package/dist/cr3-wasm-CWKEOCYH.js +3 -0
  17. package/dist/dng-wasm-JNFS44V5.js +3 -0
  18. package/dist/dpx-wasm-VNJRFPYY.js +3 -0
  19. package/dist/exr-wasm-5D66YR7A.js +3 -0
  20. package/dist/{h264-JHQCJTWP.js → h264-ZB5DJSNV.js} +1 -1
  21. package/dist/{h264-mxf-4M63NBQK.js → h264-mxf-NVBLGU3V.js} +1 -1
  22. package/dist/http.js +2 -2
  23. package/dist/{inspect-6OM4FTVW.js → inspect-MGSZRRAF.js} +2 -2
  24. package/dist/isobmff-7G55HKDG.js +3 -0
  25. package/dist/mcp.js +11 -9
  26. package/dist/media_core-AISE7FMT.js +9 -0
  27. package/dist/{media_core_bg-XIM7Y4R3.js → media_core_bg-FGAR5KA5.js} +1 -1
  28. package/dist/mxf-YH2A2XLW.js +3 -0
  29. package/dist/{ops-7HVBBXUQ.js → ops-BQDPU4M6.js} +1 -1
  30. package/dist/premiere-uxp/icons/panel.png +0 -0
  31. package/dist/premiere-uxp/icons/panel@2x.png +0 -0
  32. package/dist/premiere-uxp/icons/plugin.png +0 -0
  33. package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
  34. package/dist/premiere-uxp/index.html +38 -0
  35. package/dist/premiere-uxp/index.js +93 -0
  36. package/dist/premiere-uxp/lib/clipmeta.js +170 -0
  37. package/dist/premiere-uxp/lib/ctx.js +62 -0
  38. package/dist/premiere-uxp/lib/handles.js +57 -0
  39. package/dist/premiere-uxp/lib/markers.js +198 -0
  40. package/dist/premiere-uxp/lib/pairing.js +58 -0
  41. package/dist/premiere-uxp/lib/premiere.js +82 -0
  42. package/dist/premiere-uxp/lib/probe.js +139 -0
  43. package/dist/premiere-uxp/lib/protocol.js +165 -0
  44. package/dist/premiere-uxp/lib/render.js +38 -0
  45. package/dist/premiere-uxp/lib/session.js +85 -0
  46. package/dist/premiere-uxp/lib/sizing.js +312 -0
  47. package/dist/premiere-uxp/lib/time.js +82 -0
  48. package/dist/premiere-uxp/lib/timeline.js +336 -0
  49. package/dist/premiere-uxp/lib/verbs.js +20 -0
  50. package/dist/premiere-uxp/lib/write.js +97 -0
  51. package/dist/premiere-uxp/manifest.json +102 -0
  52. package/dist/r3d-T6D3M2XJ.js +3 -0
  53. package/dist/{r3d-AT6NNIY3.js → r3d-U4XTQJXQ.js} +1 -1
  54. package/dist/resolve-bridge.py +551 -0
  55. package/dist/resolve-presets/conform.tools.xml +127 -0
  56. package/dist/skills/auto-conform/SKILL.md +87 -0
  57. package/dist/skills/conform-artist/SKILL.md +68 -0
  58. package/dist/skills/conform-artist/references/avid.md +19 -0
  59. package/dist/skills/conform-artist/references/other-hosts.md +23 -0
  60. package/dist/skills/conform-artist/references/premiere.md +18 -0
  61. package/dist/skills/conform-artist/references/resolve.md +19 -0
  62. package/dist/skills/conform-artist/references/troubleshooting.md +33 -0
  63. package/dist/skills/conform-artist/references/turnover-checklist.md +37 -0
  64. package/dist/skills/delivery-qc/SKILL.md +48 -0
  65. package/dist/sscd-embed-DHFTEIOC.js +3 -0
  66. package/dist/sscd-sweep-OYS4XAID.js +3 -0
  67. package/dist/{still-E4HLCCST.js → still-UFLOAEM4.js} +1 -1
  68. package/dist/tiff-wasm-2CEABW6L.js +3 -0
  69. package/dist/wasm/media_core_bg.wasm +0 -0
  70. package/dist/wasm/udf_bg.wasm +0 -0
  71. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  72. package/dist/{wav-DXF73Y56.js → wav-KNJZMOGX.js} +1 -1
  73. package/package.json +1 -1
  74. package/dist/chunk-35U7WGES.js +0 -3
  75. package/dist/chunk-3XTUTEKJ.js +0 -102
  76. package/dist/chunk-HJXRLQOI.js +0 -3
  77. package/dist/chunk-IDDQR56R.js +0 -7
  78. package/dist/chunk-UUMHVA7R.js +0 -3
  79. package/dist/chunk-WWGQFOB2.js +0 -64
  80. package/dist/cr3-wasm-X6Q4YMUU.js +0 -3
  81. package/dist/dng-wasm-EAB24KDN.js +0 -3
  82. package/dist/dpx-wasm-OX2D24ZB.js +0 -3
  83. package/dist/exr-wasm-Z6BBPJSN.js +0 -3
  84. package/dist/isobmff-XL33CVJR.js +0 -3
  85. package/dist/media_core-VSTO6CS4.js +0 -9
  86. package/dist/mxf-VIANACTI.js +0 -3
  87. package/dist/r3d-2QCFX7UX.js +0 -3
  88. package/dist/sscd-sweep-IXM4OD7O.js +0 -3
  89. package/dist/tiff-wasm-XYTQNL2F.js +0 -3
  90. package/dist/zod-IPSV75LP.js +0 -3
  91. /package/dist/{arriraw-Y5VXHXNX.js → arriraw-3GKCR6K2.js} +0 -0
  92. /package/dist/{chunk-NYB4ISL3.js → chunk-WHY3DVXS.js} +0 -0
  93. /package/dist/{media_core_bg-BKXQLNFA.js → media_core_bg-YK63OUDM.js} +0 -0
  94. /package/dist/{prores-TQEZ3KFH.js → prores-L4JZZWGH.js} +0 -0
  95. /package/dist/{timeline_core_bg-QEOVAIWP.js → timeline_core_bg-2TYWZ35G.js} +0 -0
  96. /package/dist/{udf_bg-UTQ6BVXX.js → udf_bg-A4WEMSAX.js} +0 -0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a as U}from"./chunk-DRHOPOC7.js";import{a as me}from"./chunk-QDWB7QU7.js";import{a as ce}from"./chunk-AHNDJFQR.js";import{a as ue}from"./chunk-TK55FA56.js";import{$ as re,A as G,B as J,G as X,I as Z,K as j,M as Y,W as Q,X as ee,d as B,da as ne,f as V,i as H,j as z,la as te,ma as oe,q as v,ra as ae,ta as ie,u as K,ua as P,v as N,y as $,z as q}from"./chunk-UUMHVA7R.js";import{a as se}from"./chunk-NYB4ISL3.js";function E(){return ie({module_or_path:se})}function R(r){let e=new DataView(r.buffer,r.byteOffset,8);return{w:e.getUint32(0,!0),h:e.getUint32(4,!0)}}function de(r){let e=q(r),{w:t,h:n}=R(e),o=new Int32Array(t*n),s=new DataView(e.buffer,e.byteOffset+8,t*n*4);for(let a=0;a<t*n;a++)o[a]=s.getInt32(a*4,!0);return{y:o,w:t,h:n}}function Ne(r){let e=v(r),{w:t,h:n}=R(e),o=new Uint16Array(t*n),s=new DataView(e.buffer,e.byteOffset+8,t*n*2);for(let a=0;a<t*n;a++)o[a]=s.getUint16(a*2,!0);return{y:o,width:t,height:n}}function le(r){let e=$(r),{w:t,h:n}=R(e);return{rgba:new Uint8ClampedArray(e.buffer,e.byteOffset+8,t*n*4).slice(),width:t,height:n}}function fe(r){let e=ce(r);return e==="prores"||e==="h264"||e==="hevc"?e:"other"}var Ce={prores:"ProRes",h264:"H.264",hevc:"HEVC",r3d:"R3D",arriraw:"ARRIRAW",xocn:"X-OCN",vc3:"DNxHR",braw:"BRAW",proresraw:"ProRes RAW",other:"unsupported"};function I(r){return Ce[r]??"unsupported"}function Ge(r,e,t=.1){return r==null||e==null?!1:Math.abs(r-e)>t}function Je(r){return r==null?"?":Number.isInteger(r)?String(r):String(Math.round(r*1e3)/1e3)}function Me(r){let e=JSON.parse(r),t=e.frames??[],n=t.length>>1,o=new Array(n);for(let s=0,a=0;a<n;s+=2,a++)o[a]={offset:t[s],size:t[s+1]};return{offs:o,codec:e.codec,kind:fe(e.codec),w:e.width,h:e.height,fps:e.fps??null,startFrame:e.start_frame??0,dropFrame:e.drop_frame??!1}}async function pe(r){await P();let t=await ae((n,o)=>r.slice(n,n+o).arrayBuffer().then(s=>new Uint8Array(s)),r.size,"mov");return Me(t)}var x=8,we=0,Ue=3,D=2;async function ve(r){let e=new Uint8Array(await r.slice(0,16).arrayBuffer()),t=a=>String.fromCharCode(e[a],e[a+1],e[a+2],e[a+3]);if(e[0]===6&&e[1]===14&&e[2]===43&&e[3]===52)return"mxf";if(t(4)==="RED1"||t(4)==="RED2")return"r3d";let n=e[0]<<24|e[1]<<16|e[2]<<8|e[3],o=t(4);return/^[A-Za-z0-9 ]{4}$/.test(o)&&(n>=8||n===1)&&n<=r.size?"isobmff":null}function Pe(r){let e=r.toLowerCase();return e.endsWith(".braw")?"braw":e.endsWith(".crm")?"crm":"mov"}function De(r){return async(e,t)=>new Uint8Array(await r.slice(e,Math.min(e+t,r.size)).arrayBuffer())}function he(r){let e=r.timecode;return!e||!e.fps_denominator?null:e.fps_numerator/e.fps_denominator}async function or(r){await P();let e=await ve(r),t=[];if(e==="r3d"){let n=async(i,m,d)=>new Uint8Array(await r.slice(m,Math.min(m+d,r.size)).arrayBuffer()),o=JSON.stringify([{name:r.name,size:r.size}]),s=JSON.parse(await oe(n,o)),a=JSON.parse(await re(n,o));return/_\d{3}\.r3d$/i.test(r.name)&&!/_001\.r3d$/i.test(r.name)&&t.push("spanned R3D part \u2014 only this part's frames are indexed"),{frames:a.map(i=>({offset:i.essenceOffset,size:i.essenceLength})),w:s.width??0,h:s.height??0,fps:he(s),startFrame:s.timecode?.start_frame??0,dropFrame:s.timecode?.drop_frame??!1,label:"R3D",spec:{codec:"r3d",subbands:we},geometrySpec:{codec:"r3d",subbands:Ue},index:null,warnings:t}}if(e==="mxf"){let n=De(r),o=JSON.parse(await te(n,r.size));if(!o)throw new Error(`${r.name}: MXF index unreadable`);let s=JSON.parse(await ne(n,r.size)),a=[];for(let c=0;c<s.frame_count;c++)a.push({offset:s.frames[c*2],size:s.frames[c*2+1]});let i=a.filter(c=>c.size===0).length;i&&t.push(`${i} frame(s) had no locatable picture KLV`);let m=o.width??0,d=o.height??0,l=(o.inner_codec??"").toLowerCase(),u=null,p="MXF";return l==="arriraw"?(u={codec:"arriraw",w:m,h:d,scale:x},p="ARRIRAW"):l==="xocn"?(u={codec:"xocn",scale:x},p="X-OCN"):await ee(n,r.size)?(u={codec:"vc3",scale:x},p="DNxHR"):await Q(n,r.size)?(u={codec:"prores"},p="ProRes"):t.push(`MXF inner codec ${l||"unknown"} not wired to the fingerprint pool`),{frames:u?a:[],w:m,h:d,fps:he(o),startFrame:o.timecode?.start_frame??0,dropFrame:o.timecode?.drop_frame??!1,label:p,spec:u,geometrySpec:u&&u.codec==="arriraw"?{...u,scale:D}:u&&u.codec==="xocn"?{codec:"xocn",scale:D}:u&&u.codec==="vc3"?{codec:"vc3",scale:D}:null,index:null,warnings:t}}if(e==="isobmff"){let n=await pe(r),o=Pe(r.name);if(n.kind==="prores")return{frames:n.offs,w:n.w,h:n.h,fps:n.fps,startFrame:n.startFrame,dropFrame:n.dropFrame,label:I(n.kind),spec:{codec:"prores"},geometrySpec:null,index:n,warnings:t};if(n.kind==="h264"||n.kind==="hevc")return{frames:n.offs,w:n.w,h:n.h,fps:n.fps,startFrame:n.startFrame,dropFrame:n.dropFrame,label:I(n.kind),spec:null,geometrySpec:null,index:n,warnings:t};let s=o==="braw"?{codec:"braw",scale:x}:n.codec==="aprh"||n.codec==="aprn"?{codec:"proresraw",scale:x}:null;return s||t.push(`codec ${n.codec} not wired to the fingerprint pool`),{frames:s?n.offs:[],w:n.w,h:n.h,fps:n.fps,startFrame:n.startFrame,dropFrame:n.dropFrame,label:s?o==="braw"?"BRAW":"ProRes RAW":`unsupported (${n.codec})`,spec:s,geometrySpec:s?{...s,scale:D}:null,index:n,warnings:t}}throw new Error(`${r.name}: unrecognised container`)}function T(r,e,t){switch(r){case"prores":return{codec:"prores"};case"r3d":return{codec:"r3d",subbands:we};case"arriraw":return{codec:"arriraw",w:e,h:t,scale:x};case"xocn":return{codec:"xocn",scale:x};case"vc3":return{codec:"vc3",scale:x};case"braw":return{codec:"braw",scale:x};case"proresraw":return{codec:"proresraw",scale:x};default:return null}}function C(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength),t=e.getUint32(0,!0),n=e.getUint32(4,!0),o=t*n;if(r.byteLength<8+o*4)throw new Error(`decoded frame short: ${r.byteLength} B for ${t}x${n}`);let s=new Uint8Array(o);for(let a=0,i=8;a<o;a++,i+=4)s[a]=54*r[i]+183*r[i+1]+19*r[i+2]+128>>8;return{y:s,w:t,h:n}}function F(r,e){let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=t.getUint32(0,!0),o=t.getUint32(4,!0),s=n*o;if(r.byteLength<8+s*2)throw new Error(`decoded luma short: ${r.byteLength} B for ${n}x${o}`);let a=new Uint16Array(s);for(let i=0,m=8;i<s;i++,m+=2)a[i]=t.getUint16(m,!0);return{y:a,w:n,h:o,peak:e}}function Le(r,e){switch(e.codec){case"prores":return F(v(r),1023);case"r3d":return F(G(r),255);case"arriraw":return F(B(r,e.w,e.h),255);case"xocn":return F(j(r),255);case"vc3":return F(X(r),255);case"braw":return F(H(r),4095);case"proresraw":return F(K(r),255)}}function Ee(r){let e=r.y.length,t=new Uint8Array(e);if(r.peak===255){for(let o=0;o<e;o++)t[o]=r.y[o]>255?255:r.y[o];return t}let n=255/r.peak;for(let o=0;o<e;o++){let s=Math.round(r.y[o]*n);t[o]=s>255?255:s}return t}function L(r,e,t="coarse"){if(t==="exact"){let n=Le(r,e);return{y:Ee(n),w:n.w,h:n.h}}switch(e.codec){case"prores":{let n=de(r);return{y:n.y,w:n.w,h:n.h}}case"r3d":return C(J(r,e.subbands));case"arriraw":return C(V(r,e.w,e.h,e.scale));case"xocn":return C(Y(r,e.scale));case"vc3":return C(Z(r,e.scale));case"braw":return C(z(r,e.scale));case"proresraw":return C(N(r,e.scale))}}async function be(r,e,t,n={}){if(typeof VideoDecoder>"u")throw new Error("this browser has no VideoDecoder (WebCodecs) \u2014 H.264/HEVC needs Chrome/Edge/Safari 16+");let o={fileSize:r.size,read:async(c,f)=>new Uint8Array(await r.slice(c,c+f).arrayBuffer())},s=await ue(o),a=me(s);if(!a)throw new Error("no H.264/HEVC decoder configuration found in this file");let i={codec:a.codec,description:a.description,hardwareAcceleration:"prefer-hardware"};if(!(await VideoDecoder.isConfigSupported(i).catch(()=>null))?.supported){if(!(await VideoDecoder.isConfigSupported({codec:a.codec,description:a.description}).catch(()=>null))?.supported)throw new Error(`this browser can't decode ${a.codec} \u2014 try a ProRes or H.264 export`);delete i.hardwareAcceleration}let d=a.decodeToPres.length||e.length,l=null,u=new VideoDecoder({output:c=>{try{t(c,Number(c.timestamp))}catch(f){l=l??(f instanceof Error?f:new Error(String(f)))}finally{c.close()}},error:c=>{l=c instanceof Error?c:new Error(String(c))}});u.configure(i);let p=[];for(let c=0;c<a.keyframes.length;c++){let f=a.keyframes[c],h=c+1<a.keyframes.length?a.keyframes[c+1]:e.length;h>f&&p.push([f,h])}try{for(let[c,f]of p){if(l||n.signal?.aborted)break;if(n.wantPres){let b=!1;for(let g=c;g<f&&!b;g++)b=n.wantPres.has(a.decodeToPres[g]);if(!b)continue}let h=1/0,w=0;for(let b=c;b<f;b++)h=Math.min(h,e[b].offset),w=Math.max(w,e[b].offset+e[b].size);let y=new Uint8Array(await r.slice(h,w).arrayBuffer());for(let b=c;b<f;b++){let g=e[b];u.decode(new EncodedVideoChunk({type:b===c?"key":"delta",timestamp:a.decodeToPres[b],data:y.subarray(g.offset-h,g.offset-h+g.size)}))}await u.flush()}}finally{try{u.close()}catch{}}if(l)throw l;if(n.signal?.aborted)throw new DOMException("aborted","AbortError");return d}var ye=240;function ge(r,e,t,n=ye){let o=Math.max(1,Math.ceil(Math.max(e,t)/n));if(o===1)return{w:e,h:t,rgba:r};let s=Math.max(1,Math.floor(e/o)),a=Math.max(1,Math.floor(t/o)),i=new Uint8ClampedArray(s*a*4);for(let m=0,d=0;m<a;m++){let l=m*o*e;for(let u=0;u<s;u++,d+=4){let p=(l+u*o)*4;i[d]=r[p],i[d+1]=r[p+1],i[d+2]=r[p+2],i[d+3]=255}}return{w:s,h:a,rgba:i}}async function Re(r,e,t,n){await E();let o=new Map;for(let s of t){let a=e.offs[s];if(!a)continue;let i=new Uint8Array(await r.slice(a.offset,a.offset+a.size).arrayBuffer()),m=le(i),d=ge(m.rgba,m.width,m.height,n);o.set(s,{frame:s,...d})}return o}async function Ie(r,e,t,n){let o=new Set(t),s=new Map,a=null,i=null;return await be(r,e.offs,(m,d)=>{if(!o.has(d))return;let l=m.visibleRect,u=l?l.width:m.codedWidth,p=l?l.height:m.codedHeight,c=Math.min(1,n/Math.max(u,p)),f=Math.max(1,Math.round(u*c)),h=Math.max(1,Math.round(p*c));(!a||a.width!==f||a.height!==h)&&(a=new OffscreenCanvas(f,h),i=a.getContext("2d",{willReadFrequently:!0})),i&&(i.drawImage(m,0,0,f,h),s.set(d,{frame:d,w:f,h,rgba:i.getImageData(0,0,f,h).data}))},{wantPres:o}),s}async function Te(r,e,t,n){let o=T(e.kind,e.w,e.h),s=new Map;if(!o)return s;await E();for(let a of t){let i=e.offs[a];if(i)try{let m=new Uint8Array(await r.slice(i.offset,i.offset+i.size).arrayBuffer()),d=L(m,o),l=1/0,u=-1/0;for(let h=0;h<d.y.length;h++){let w=d.y[h];w<l&&(l=w),w>u&&(u=w)}let p=u>l?u-l:1,c=new Uint8ClampedArray(d.w*d.h*4);for(let h=0,w=0;h<d.y.length;h++,w+=4){let y=(d.y[h]-l)/p*255;c[w]=y,c[w+1]=y,c[w+2]=y,c[w+3]=255}let f=ge(c,d.w,d.h,n);s.set(a,{frame:a,...f})}catch{}}return s}async function xe(r,e,t,n=ye){if(t.length===0)return new Map;if(e.kind==="prores")return Re(r,e,t,n);if(e.kind==="h264"||e.kind==="hevc")return Ie(r,e,t,n);if(T(e.kind,e.w,e.h))return Te(r,e,t,n);throw new Error(`unsupported codec "${e.codec}" for frame thumbnails`)}function k(r,e=288){let t=e*e,n=new Float32Array(r.length*3*t);for(let o=0;o<r.length;o++){let s=r[o],a=o*3*t;for(let i=0;i<t;i++)n[a+i]=s[i*4]/255,n[a+t+i]=s[i*4+1]/255,n[a+2*t+i]=s[i*4+2]/255}return n}var ke=import.meta.env?.VITE_SSCD_MODEL_URL||"/sscd/sscd_disc_mixup.288.fp16.onnx";var O=null;function Oe(){return O||(O=(async()=>{let r=await import("./onnxruntime-web-stub-PKJ2NZBF.js"),t=(typeof globalThis.crossOriginIsolated=="boolean"?globalThis.crossOriginIsolated:!1)?Math.max(1,Math.min(navigator.hardwareConcurrency||4,10)):1;return r.env.wasm.wasmPaths=t>1?{wasm:U,mjs:U}:{wasm:U},r.env.wasm.numThreads=t,r.InferenceSession.create(ke,{executionProviders:["wasm"]})})()),O}async function Ae(r,e=288){if(r.length===0)return[];let t=await import("./onnxruntime-web-stub-PKJ2NZBF.js"),n=await Oe(),o=[];for(let s=0;s<r.length;s+=8){let a=r.slice(s,s+8),i=k(a,e),d=(await n.run({rgb:new t.Tensor("float32",i,[a.length,3,e,e])})).embedding,l=d.dims[1],u=d.data;for(let p=0;p<a.length;p++)o.push(u.slice(p*l,(p+1)*l))}return o}var We=4;function Be(r){let e=new Uint8ClampedArray(r.length);for(let t=0;t<r.length;t+=4){let n=54*r[t]+183*r[t+1]+19*r[t+2]+128>>8;e[t]=e[t+1]=e[t+2]=n,e[t+3]=255}return e}function Fe(r,e,t,n=288){let o=new Uint8ClampedArray(n*n*4),s=e/n,a=t/n;if(s>=1&&a>=1){for(let i=0;i<n;i++){let m=Math.floor(i*a),d=Math.max(m+1,Math.min(t,Math.ceil((i+1)*a)));for(let l=0;l<n;l++){let u=Math.floor(l*s),p=Math.max(u+1,Math.min(e,Math.ceil((l+1)*s))),c=0,f=0,h=0,w=0;for(let b=m;b<d;b++)for(let g=u,S=(b*e+u)*4;g<p;g++,S+=4)c+=r[S],f+=r[S+1],h+=r[S+2],w++;let y=(i*n+l)*4;o[y]=c/w,o[y+1]=f/w,o[y+2]=h/w,o[y+3]=255}}return o}for(let i=0;i<n;i++){let m=Math.min(t-1,Math.max(0,(i+.5)*a-.5)),d=Math.floor(m),l=Math.min(t-1,d+1),u=m-d;for(let p=0;p<n;p++){let c=Math.min(e-1,Math.max(0,(p+.5)*s-.5)),f=Math.floor(c),h=Math.min(e-1,f+1),w=c-f,y=(d*e+f)*4,b=(d*e+h)*4,g=(l*e+f)*4,S=(l*e+h)*4,W=(i*n+p)*4;for(let A=0;A<3;A++){let _e=r[y+A]*(1-w)+r[b+A]*w,Se=r[g+A]*(1-w)+r[S+A]*w;o[W+A]=_e*(1-u)+Se*u}o[W+3]=255}}return o}function Ve(r,e,t){let n=new Uint8ClampedArray(e*t*4);for(let o=0,s=0;o<r.length;o++,s+=4)n[s]=n[s+1]=n[s+2]=r[o],n[s+3]=255;return n}async function Dr(r,e,t={}){let n=Math.max(1,Math.min(We,Math.floor(t.stride??1))),o=e.frames.length||e.index?.offs.length||0;if(o===0)return[];let s=[];for(let m=0;m<o;m+=n)s.push(m);let a=[];for(let m=0;m<s.length;m+=8){if(t.signal?.aborted)throw new DOMException("aborted","AbortError");let d=s.slice(m,m+8),l=[];for(let u of d){let p=null;try{if(e.geometrySpec){let{offset:c,size:f}=e.frames[u]??{offset:0,size:0};if(f>0){let h=new Uint8Array(await r.slice(c,c+f).arrayBuffer()),w=L(h,e.geometrySpec),y=Uint8Array.from(w.y);p=Fe(Ve(y,w.w,w.h),w.w,w.h)}}else if(e.index){let f=(await xe(r,e.index,[u],288*2)).get(u);f&&(p=Fe(Be(f.rgba),f.w,f.h))}}catch{}l.push(p??new Uint8ClampedArray(288*288*4))}a.push(...await Ae(l)),t.onProgress?.(Math.min(s.length,m+d.length),s.length)}let i=a.length-1;return i<0?[]:Array.from({length:o},(m,d)=>a[Math.min(i,Math.round(d/n))])}export{I as a,Ge as b,Je as c,or as d,E as e,Ne as f,L as g,be as h,xe as i,k as j,We as k,Be as l,Fe as m,Dr as n};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var Xt="0.5.1";var Me=Symbol("Let zodToJsonSchema decide on which parser to use");var $e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},ze=r=>typeof r=="string"?{...$e,name:r}:{...$e,...r};var x;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let s={};for(let i of n)s[i]=i;return s},r.getValidEnumValues=n=>{let s=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of s)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(s){return n[s]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},r.find=(n,s)=>{for(let i of n)if(s(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}r.joinValues=a,r.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(x||(x={}));var Le;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Le||(Le={}));var f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),E=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}};var u=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var O=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},a={_errors:[]},n=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)a._errors.push(t(i));else{let o=a,c=0;for(;c<i.path.length;){let p=i.path[c],g=c===i.path.length-1;if(p==="_errors"){g&&o._errors.push(t(i)),c++;continue}Object.prototype.hasOwnProperty.call(o,p)||(p==="__proto__"?Object.defineProperty(o,p,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):o[p]={_errors:[]}),o=o[p],g&&o._errors.push(t(i)),c++}}};return n(this),a}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t=Object.create(null),a=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}};O.create=r=>new O(r);var xt=(r,e)=>{let t;switch(r.code){case u.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case u.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case u.invalid_union:t="Invalid input";break;case u.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case u.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case u.invalid_arguments:t="Invalid function arguments";break;case u.invalid_return_type:t="Invalid function return type";break;case u.invalid_date:t="Invalid date";break;case u.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case u.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case u.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case u.custom:t="Invalid input";break;case u.invalid_intersection_types:t="Intersection results could not be merged";break;case u.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case u.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}},z=xt;var bt=z;function ne(){return bt}var ge=r=>{let{data:e,path:t,errorMaps:a,issueData:n}=r,s=[...t,...n.path||[]],i={...n,path:s};if(n.message!==void 0)return{...n,path:s,message:n.message};let o="",c=a.filter(p=>!!p).slice().reverse();for(let p of c)o=p(i,{data:e,defaultError:o}).message;return{...n,path:s,message:o}};function l(r,e){let t=ne(),a=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===z?void 0:z].filter(n=>!!n)});r.common.issues.push(a)}var w=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let a=[];for(let n of t){if(n.status==="aborted")return h;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){let a=[];for(let n of t){let s=await n.key,i=await n.value;a.push({key:s,value:i})}return r.mergeObjectSync(e,a)}static mergeObjectSync(e,t){let a={};for(let n of t){let{key:s,value:i}=n;if(s.status==="aborted"||i.status==="aborted")return h;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(a[s.value]=i.value)}return{status:e.value,value:a}}},h=Object.freeze({status:"aborted"}),B=r=>({status:"dirty",value:r}),A=r=>({status:"valid",value:r}),Te=r=>r.status==="aborted",Oe=r=>r.status==="dirty",F=r=>r.status==="valid",se=r=>typeof Promise<"u"&&r instanceof Promise;var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(m||(m={}));var j=class{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ve=(r,e)=>{if(F(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new O(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:a,description:n}=r;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{let{message:c}=r;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??a??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??t??o.defaultError}},description:n}}var v=class{get description(){return this._def.description}_getType(e){return E(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:E(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:E(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(se(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){let a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Ve(a,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:t});return F(a)?{value:a.value}:{issues:t.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>F(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){let a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){let a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(se(n)?n:Promise.resolve(n));return Ve(a,s)}refine(e,t){let a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,s)=>{let i=e(n),o=()=>s.addIssue({code:u.custom,...a(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new C({schema:this,typeName:d.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return N.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return U.create(this,this._def)}or(e){return Y.create([this,e],this._def)}and(e){return K.create(this,e,this._def)}transform(e){return new C({..._(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new te({..._(this._def),innerType:this,defaultValue:t,typeName:d.ZodDefault})}brand(){return new _e({typeName:d.ZodBranded,type:this,..._(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new re({..._(this._def),innerType:this,catchValue:t,typeName:d.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ve.create(this,e)}readonly(){return ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kt=/^c[^\s-]{8,}$/i,wt=/^[0-9a-z]+$/,At=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ot=/^[a-z0-9_-]{21}$/i,St=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pt=/^[-+]?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)?)??$/,jt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nt="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Se,Ct=/^(?:(?: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])$/,Zt=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Dt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rt=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Et=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,It=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fe="((\\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])))",$t=new RegExp(`^${Fe}$`);function Ue(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Mt(r){return new RegExp(`^${Ue(r)}$`)}function zt(r){let e=`${Fe}T${Ue(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Lt(r,e){return!!((e==="v4"||!e)&&Ct.test(r)||(e==="v6"||!e)&&Dt.test(r))}function Vt(r,e){if(!St.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ft(r,e){return!!((e==="v4"||!e)&&Zt.test(r)||(e==="v6"||!e)&&Rt.test(r))}var q=class r extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.string,received:s.parsedType}),h}let a=new w,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&l(n,{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")jt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Se||(Se=new RegExp(Nt,"u")),Se.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")kt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")wt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")At.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:u.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:u.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?zt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?$t.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?Mt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?Pt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?Lt(e.data,s.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?Vt(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"jwt",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?Ft(e.data,s.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cidr",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?Et.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?It.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64url",code:u.invalid_string,message:s.message}),a.dirty()):x.assertNever(s);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:u.invalid_string,...m.errToObj(a)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...m.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};q.create=r=>new q({checks:[],typeName:d.ZodString,coerce:r?.coerce??!1,..._(r)});function Ut(r,e){let t=(r.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,s=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return s%i/10**n}var ie=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.number,received:s.parsedType}),h}let a,n=new w;for(let s of this._def.checks)s.kind==="int"?x.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:u.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?Ut(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_finite,message:s.message}),n.dirty()):x.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,a,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:m.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}};ie.create=r=>new ie({checks:[],typeName:d.ZodNumber,coerce:r?.coerce||!1,..._(r)});var oe=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let a,n=new w;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):x.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return l(t,{code:u.invalid_type,expected:f.bigint,received:t.parsedType}),h}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,a,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:m.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};oe.create=r=>new oe({checks:[],typeName:d.ZodBigInt,coerce:r?.coerce??!1,..._(r)});var ce=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.boolean,received:a.parsedType}),h}return A(e.data)}};ce.create=r=>new ce({typeName:d.ZodBoolean,coerce:r?.coerce||!1,..._(r)});var ue=class r extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.date,received:s.parsedType}),h}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_date}),h}let a=new w,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):x.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};ue.create=r=>new ue({checks:[],coerce:r?.coerce||!1,typeName:d.ZodDate,..._(r)});var de=class extends v{_parse(e){if(this._getType(e)!==f.symbol){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.symbol,received:a.parsedType}),h}return A(e.data)}};de.create=r=>new de({typeName:d.ZodSymbol,..._(r)});var J=class extends v{_parse(e){if(this._getType(e)!==f.undefined){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.undefined,received:a.parsedType}),h}return A(e.data)}};J.create=r=>new J({typeName:d.ZodUndefined,..._(r)});var H=class extends v{_parse(e){if(this._getType(e)!==f.null){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.null,received:a.parsedType}),h}return A(e.data)}};H.create=r=>new H({typeName:d.ZodNull,..._(r)});var le=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return A(e.data)}};le.create=r=>new le({typeName:d.ZodAny,..._(r)});var L=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return A(e.data)}};L.create=r=>new L({typeName:d.ZodUnknown,..._(r)});var R=class extends v{_parse(e){let t=this._getOrReturnCtx(e);return l(t,{code:u.invalid_type,expected:f.never,received:t.parsedType}),h}};R.create=r=>new R({typeName:d.ZodNever,..._(r)});var pe=class extends v{_parse(e){if(this._getType(e)!==f.undefined){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.void,received:a.parsedType}),h}return A(e.data)}};pe.create=r=>new pe({typeName:d.ZodVoid,..._(r)});var V=class r extends v{_parse(e){let{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:u.invalid_type,expected:f.array,received:t.parsedType}),h;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?u.too_big:u.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:u.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:u.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new j(t,i,t.path,o)))).then(i=>w.mergeArray(a,i));let s=[...t.data].map((i,o)=>n.type._parseSync(new j(t,i,t.path,o)));return w.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}};V.create=(r,e)=>new V({type:r,minLength:null,maxLength:null,exactLength:null,typeName:d.ZodArray,..._(e)});function W(r){if(r instanceof S){let e={};for(let t in r.shape){let a=r.shape[t];e[t]=N.create(W(a))}return new S({...r._def,shape:()=>e})}else return r instanceof V?new V({...r._def,type:W(r.element)}):r instanceof N?N.create(W(r.unwrap())):r instanceof M?M.create(W(r.unwrap())):r instanceof $?$.create(r.items.map(e=>W(e))):r}var S=class r extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=x.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let p=this._getOrReturnCtx(e);return l(p,{code:u.invalid_type,expected:f.object,received:p.parsedType}),h}let{status:a,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(let p in n.data)i.includes(p)||o.push(p);let c=[];for(let p of i){let g=s[p],P=n.data[p];c.push({key:{status:"valid",value:p},value:g._parse(new j(n,P,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof R){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of o)c.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(p==="strict")o.length>0&&(l(n,{code:u.unrecognized_keys,keys:o}),a.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let g of o){let P=n.data[g];c.push({key:{status:"valid",value:g},value:p._parse(new j(n,P,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of c){let P=await g.key,Ie=await g.value;p.push({key:P,value:Ie,alwaysSet:g.alwaysSet})}return p}).then(p=>w.mergeObjectSync(a,p)):w.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{let n=this._def.errorMap?.(t,a).message??a.defaultError;return t.code==="unrecognized_keys"?{message:m.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:d.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let a of x.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let a of x.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new r({...this._def,shape:()=>t})}deepPartial(){return W(this)}partial(e){let t={};for(let a of x.objectKeys(this.shape)){let n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let a of x.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof N;)s=s._def.innerType;t[a]=s}return new r({...this._def,shape:()=>t})}keyof(){return Be(x.objectKeys(this.shape))}};S.create=(r,e)=>new S({shape:()=>r,unknownKeys:"strip",catchall:R.create(),typeName:d.ZodObject,..._(e)});S.strictCreate=(r,e)=>new S({shape:()=>r,unknownKeys:"strict",catchall:R.create(),typeName:d.ZodObject,..._(e)});S.lazycreate=(r,e)=>new S({shape:r,unknownKeys:"strip",catchall:R.create(),typeName:d.ZodObject,..._(e)});var Y=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new O(o.ctx.common.issues));return l(t,{code:u.invalid_union,unionErrors:i}),h}if(t.common.async)return Promise.all(a.map(async s=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let s,i=[];for(let c of a){let p={...t,common:{...t.common,issues:[]},parent:null},g=c._parseSync({data:t.data,path:t.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new O(c));return l(t,{code:u.invalid_union,unionErrors:o}),h}}get options(){return this._def.options}};Y.create=(r,e)=>new Y({options:r,typeName:d.ZodUnion,..._(e)});var I=r=>r instanceof G?I(r.schema):r instanceof C?I(r.innerType()):r instanceof Q?[r.value]:r instanceof X?r.options:r instanceof ee?x.objectValues(r.enum):r instanceof te?I(r._def.innerType):r instanceof J?[void 0]:r instanceof H?[null]:r instanceof N?[void 0,...I(r.unwrap())]:r instanceof M?[null,...I(r.unwrap())]:r instanceof _e||r instanceof ae?I(r.unwrap()):r instanceof re?I(r._def.innerType):[],Pe=class r extends v{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:u.invalid_type,expected:f.object,received:t.parsedType}),h;let a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){let n=new Map;for(let s of t){let i=I(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new r({typeName:d.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(a)})}};function je(r,e){let t=E(r),a=E(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&a===f.object){let n=x.objectKeys(e),s=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(let o of s){if(o==="__proto__")continue;let c=je(r[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(t===f.array&&a===f.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<r.length;s++){let i=r[s],o=e[s],c=je(i,o);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return t===f.date&&a===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var K=class extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e),n=(s,i)=>{if(Te(s)||Te(i))return h;let o=je(s.value,i.value);return o.valid?((Oe(s)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(l(a,{code:u.invalid_intersection_types}),h)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,i])=>n(s,i)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};K.create=(r,e,t)=>new K({left:r,right:e,typeName:d.ZodIntersection,..._(t)});var $=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.array)return l(a,{code:u.invalid_type,expected:f.array,received:a.parsedType}),h;if(a.data.length<this._def.items.length)return l(a,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&a.data.length>this._def.items.length&&(l(a,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...a.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new j(a,i,a.path,o)):null}).filter(i=>!!i);return a.common.async?Promise.all(s).then(i=>w.mergeArray(t,i)):w.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};$.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:r,typeName:d.ZodTuple,rest:null,..._(e)})};var Ne=class r extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.object)return l(a,{code:u.invalid_type,expected:f.object,received:a.parsedType}),h;let n=[],s=this._def.keyType,i=this._def.valueType;for(let o in a.data)n.push({key:s._parse(new j(a,o,a.path,o)),value:i._parse(new j(a,a.data[o],a.path,o)),alwaysSet:o in a.data});return a.common.async?w.mergeObjectAsync(t,n):w.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof v?new r({keyType:e,valueType:t,typeName:d.ZodRecord,..._(a)}):new r({keyType:q.create(),valueType:e,typeName:d.ZodRecord,..._(t)})}},fe=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.map)return l(a,{code:u.invalid_type,expected:f.map,received:a.parsedType}),h;let n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map(([o,c],p)=>({key:n._parse(new j(a,o,a.path,[p,"key"])),value:s._parse(new j(a,c,a.path,[p,"value"]))}));if(a.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let p=await c.key,g=await c.value;if(p.status==="aborted"||g.status==="aborted")return h;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let c of i){let p=c.key,g=c.value;if(p.status==="aborted"||g.status==="aborted")return h;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}}}};fe.create=(r,e,t)=>new fe({valueType:e,keyType:r,typeName:d.ZodMap,..._(t)});var me=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.set)return l(a,{code:u.invalid_type,expected:f.set,received:a.parsedType}),h;let n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(l(a,{code:u.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(l(a,{code:u.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let s=this._def.valueType;function i(c){let p=new Set;for(let g of c){if(g.status==="aborted")return h;g.status==="dirty"&&t.dirty(),p.add(g.value)}return{status:t.value,value:p}}let o=[...a.data.values()].map((c,p)=>s._parse(new j(a,c,a.path,p)));return a.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,t){return new r({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};me.create=(r,e)=>new me({valueType:r,minSize:null,maxSize:null,typeName:d.ZodSet,..._(e)});var Ce=class r extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:u.invalid_type,expected:f.function,received:t.parsedType}),h;function a(o,c){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),z].filter(p=>!!p),issueData:{code:u.invalid_arguments,argumentsError:c}})}function n(o,c){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),z].filter(p=>!!p),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof U){let o=this;return A(async function(...c){let p=new O([]),g=await o._def.args.parseAsync(c,s).catch(Ae=>{throw p.addIssue(a(c,Ae)),p}),P=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(P,s).catch(Ae=>{throw p.addIssue(n(P,Ae)),p})})}else{let o=this;return A(function(...c){let p=o._def.args.safeParse(c,s);if(!p.success)throw new O([a(c,p.error)]);let g=Reflect.apply(i,this,p.data),P=o._def.returns.safeParse(g,s);if(!P.success)throw new O([n(g,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:$.create(e).rest(L.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new r({args:e||$.create([]).rest(L.create()),returns:t||L.create(),typeName:d.ZodFunction,..._(a)})}},G=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};G.create=(r,e)=>new G({getter:r,typeName:d.ZodLazy,..._(e)});var Q=class extends v{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:u.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}};Q.create=(r,e)=>new Q({value:r,typeName:d.ZodLiteral,..._(e)});function Be(r,e){return new X({values:r,typeName:d.ZodEnum,..._(e)})}var X=class r extends v{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{expected:x.joinValues(a),received:t.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{received:t.data,code:u.invalid_enum_value,options:a}),h}return A(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}};X.create=Be;var ee=class extends v{_parse(e){let t=x.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==f.string&&a.parsedType!==f.number){let n=x.objectValues(t);return l(a,{expected:x.joinValues(n),received:a.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=x.objectValues(t);return l(a,{received:a.data,code:u.invalid_enum_value,options:n}),h}return A(e.data)}get enum(){return this._def.values}};ee.create=(r,e)=>new ee({values:r,typeName:d.ZodNativeEnum,..._(e)});var U=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:u.invalid_type,expected:f.promise,received:t.parsedType}),h;let a=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return A(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};U.create=(r,e)=>new U({type:r,typeName:d.ZodPromise,..._(e)});var C=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:i=>{l(a,i),i.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let i=n.transform(a.data,s);if(a.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return c.status==="aborted"?h:c.status==="dirty"?B(c.value):t.value==="dirty"?B(c.value):c});{if(t.value==="aborted")return h;let o=this._def.schema._parseSync({data:i,path:a.path,parent:a});return o.status==="aborted"?h:o.status==="dirty"?B(o.value):t.value==="dirty"?B(o.value):o}}if(n.type==="refinement"){let i=o=>{let c=n.refinement(o,s);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?h:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?h:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(a.common.async===!1){let i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!F(i))return h;let o=n.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>F(i)?Promise.resolve(n.transform(i.value,s)).then(o=>({status:t.value,value:o})):h);x.assertNever(n)}};C.create=(r,e,t)=>new C({schema:r,typeName:d.ZodEffects,effect:e,..._(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:d.ZodEffects,..._(t)});var N=class extends v{_parse(e){return this._getType(e)===f.undefined?A(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(r,e)=>new N({innerType:r,typeName:d.ZodOptional,..._(e)});var M=class extends v{_parse(e){return this._getType(e)===f.null?A(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M.create=(r,e)=>new M({innerType:r,typeName:d.ZodNullable,..._(e)});var te=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=t.data;return t.parsedType===f.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};te.create=(r,e)=>new te({innerType:r,typeName:d.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var re=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return se(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};re.create=(r,e)=>new re({innerType:r,typeName:d.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var he=class extends v{_parse(e){if(this._getType(e)!==f.nan){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.nan,received:a.parsedType}),h}return{status:"valid",value:e.data}}};he.create=r=>new he({typeName:d.ZodNaN,..._(r)});var vr=Symbol("zod_brand"),_e=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}},ve=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?h:s.status==="dirty"?(t.dirty(),B(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{let n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?h:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new r({in:e,out:t,typeName:d.ZodPipeline})}},ae=class extends v{_parse(e){let t=this._def.innerType._parse(e),a=n=>(F(n)&&(n.value=Object.freeze(n.value)),n);return se(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}};ae.create=(r,e)=>new ae({innerType:r,typeName:d.ZodReadonly,..._(e)});var xr={object:S.lazycreate},d;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(d||(d={}));var br=q.create,kr=ie.create,wr=he.create,Ar=oe.create,Tr=ce.create,Or=ue.create,Sr=de.create,Pr=J.create,jr=H.create,Nr=le.create,Cr=L.create,Zr=R.create,Dr=pe.create,Rr=V.create,Er=S.create,Ir=S.strictCreate,$r=Y.create,Mr=Pe.create,zr=K.create,Lr=$.create,Vr=Ne.create,Fr=fe.create,Ur=me.create,Br=Ce.create,Wr=G.create,qr=Q.create,Jr=X.create,Hr=ee.create,Yr=U.create,Kr=C.create,Gr=N.create,Qr=M.create,Xr=C.createWithPreprocess,ea=ve.create;var xe=(r,e)=>{let t=0;for(;t<r.length&&t<e.length&&r[t]===e[t];t++);return[(r.length-t).toString(),...e.slice(t)].join("/")};function k(r){if(r.target!=="openAi")return{};let e=[...r.basePath,r.definitionPath,r.openAiAnyTypeName];return r.flags.hasReferencedOpenAiAnyType=!0,{$ref:r.$refStrategy==="relative"?xe(e,r.currentPath):e.join("/")}}function Ze(r,e,t,a){a?.errorMessages&&t&&(r.errorMessage={...r.errorMessage,[e]:t})}function b(r,e,t,a,n){r[e]=t,Ze(r,e,a,n)}function We(r,e){let t={type:"array"};return r.type?._def&&r.type?._def?.typeName!==d.ZodAny&&(t.items=y(r.type._def,{...e,currentPath:[...e.currentPath,"items"]})),r.minLength&&b(t,"minItems",r.minLength.value,r.minLength.message,e),r.maxLength&&b(t,"maxItems",r.maxLength.value,r.maxLength.message,e),r.exactLength&&(b(t,"minItems",r.exactLength.value,r.exactLength.message,e),b(t,"maxItems",r.exactLength.value,r.exactLength.message,e)),t}function qe(r,e){let t={type:"integer",format:"int64"};if(!r.checks)return t;for(let a of r.checks)switch(a.kind){case"min":e.target==="jsonSchema7"?a.inclusive?b(t,"minimum",a.value,a.message,e):b(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),b(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?b(t,"maximum",a.value,a.message,e):b(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),b(t,"maximum",a.value,a.message,e));break;case"multipleOf":b(t,"multipleOf",a.value,a.message,e);break}return t}function Je(){return{type:"boolean"}}function be(r,e){return y(r.type._def,e)}var He=(r,e)=>y(r.innerType._def,e);function De(r,e,t){let a=t??e.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,s)=>De(r,e,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bt(r,e)}}var Bt=(r,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let a of r.checks)switch(a.kind){case"min":b(t,"minimum",a.value,a.message,e);break;case"max":b(t,"maximum",a.value,a.message,e);break}return t};function Ye(r,e){return{...y(r.innerType._def,e),default:r.defaultValue()}}function Ke(r,e){return e.effectStrategy==="input"?y(r.schema._def,e):k(e)}function Ge(r){return{type:"string",enum:Array.from(r.values)}}var Wt=r=>"type"in r&&r.type==="string"?!1:"allOf"in r;function Qe(r,e){let t=[y(r.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),y(r.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),a=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return t.forEach(s=>{if(Wt(s))n.push(...s.allOf),s.unevaluatedProperties===void 0&&(a=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:o,...c}=s;i=c}else a=void 0;n.push(i)}}),n.length?{allOf:n,...a}:void 0}function Xe(r,e){let t=typeof r.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(r.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[r.value]}:{type:t==="bigint"?"integer":t,const:r.value}}var Re,Z={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Re===void 0&&(Re=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Re),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ke(r,e){let t={type:"string"};if(r.checks)for(let a of r.checks)switch(a.kind){case"min":b(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,a.value):a.value,a.message,e);break;case"max":b(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":D(t,"email",a.message,e);break;case"format:idn-email":D(t,"idn-email",a.message,e);break;case"pattern:zod":T(t,Z.email,a.message,e);break}break;case"url":D(t,"uri",a.message,e);break;case"uuid":D(t,"uuid",a.message,e);break;case"regex":T(t,a.regex,a.message,e);break;case"cuid":T(t,Z.cuid,a.message,e);break;case"cuid2":T(t,Z.cuid2,a.message,e);break;case"startsWith":T(t,RegExp(`^${Ee(a.value,e)}`),a.message,e);break;case"endsWith":T(t,RegExp(`${Ee(a.value,e)}$`),a.message,e);break;case"datetime":D(t,"date-time",a.message,e);break;case"date":D(t,"date",a.message,e);break;case"time":D(t,"time",a.message,e);break;case"duration":D(t,"duration",a.message,e);break;case"length":b(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,a.value):a.value,a.message,e),b(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,a.value):a.value,a.message,e);break;case"includes":{T(t,RegExp(Ee(a.value,e)),a.message,e);break}case"ip":{a.version!=="v6"&&D(t,"ipv4",a.message,e),a.version!=="v4"&&D(t,"ipv6",a.message,e);break}case"base64url":T(t,Z.base64url,a.message,e);break;case"jwt":T(t,Z.jwt,a.message,e);break;case"cidr":{a.version!=="v6"&&T(t,Z.ipv4Cidr,a.message,e),a.version!=="v4"&&T(t,Z.ipv6Cidr,a.message,e);break}case"emoji":T(t,Z.emoji(),a.message,e);break;case"ulid":{T(t,Z.ulid,a.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(t,"binary",a.message,e);break}case"contentEncoding:base64":{b(t,"contentEncoding","base64",a.message,e);break}case"pattern:zod":{T(t,Z.base64,a.message,e);break}}break}case"nanoid":T(t,Z.nanoid,a.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return t}function Ee(r,e){return e.patternStrategy==="escape"?Jt(r):r}var qt=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Jt(r){let e="";for(let t=0;t<r.length;t++)qt.has(r[t])||(e+="\\"),e+=r[t];return e}function D(r,e,t,a){r.format||r.anyOf?.some(n=>n.format)?(r.anyOf||(r.anyOf=[]),r.format&&(r.anyOf.push({format:r.format,...r.errorMessage&&a.errorMessages&&{errorMessage:{format:r.errorMessage.format}}}),delete r.format,r.errorMessage&&(delete r.errorMessage.format,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.anyOf.push({format:e,...t&&a.errorMessages&&{errorMessage:{format:t}}})):b(r,"format",e,t,a)}function T(r,e,t,a){r.pattern||r.allOf?.some(n=>n.pattern)?(r.allOf||(r.allOf=[]),r.pattern&&(r.allOf.push({pattern:r.pattern,...r.errorMessage&&a.errorMessages&&{errorMessage:{pattern:r.errorMessage.pattern}}}),delete r.pattern,r.errorMessage&&(delete r.errorMessage.pattern,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.allOf.push({pattern:et(e,a),...t&&a.errorMessages&&{errorMessage:{pattern:t}}})):b(r,"pattern",et(e,a),t,a)}function et(r,e){if(!e.applyRegexFlags||!r.flags)return r.source;let t={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},a=t.i?r.source.toLowerCase():r.source,n="",s=!1,i=!1,o=!1;for(let c=0;c<a.length;c++){if(s){n+=a[c],s=!1;continue}if(t.i){if(i){if(a[c].match(/[a-z]/)){o?(n+=a[c],n+=`${a[c-2]}-${a[c]}`.toUpperCase(),o=!1):a[c+1]==="-"&&a[c+2]?.match(/[a-z]/)?(n+=a[c],o=!0):n+=`${a[c]}${a[c].toUpperCase()}`;continue}}else if(a[c].match(/[a-z]/)){n+=`[${a[c]}${a[c].toUpperCase()}]`;continue}}if(t.m){if(a[c]==="^"){n+=`(^|(?<=[\r
4
- ]))`;continue}else if(a[c]==="$"){n+=`($|(?=[\r
5
- ]))`;continue}}if(t.s&&a[c]==="."){n+=i?`${a[c]}\r
6
- `:`[${a[c]}\r
7
- ]`;continue}n+=a[c],a[c]==="\\"?s=!0:i&&a[c]==="]"?i=!1:!i&&a[c]==="["&&(i=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),r.source}return n}function we(r,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&r.keyType?._def.typeName===d.ZodEnum)return{type:"object",required:r.keyType._def.values,properties:r.keyType._def.values.reduce((a,n)=>({...a,[n]:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??k(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(r.keyType?._def.typeName===d.ZodString&&r.keyType._def.checks?.length){let{type:a,...n}=ke(r.keyType._def,e);return{...t,propertyNames:n}}else{if(r.keyType?._def.typeName===d.ZodEnum)return{...t,propertyNames:{enum:r.keyType._def.values}};if(r.keyType?._def.typeName===d.ZodBranded&&r.keyType._def.type._def.typeName===d.ZodString&&r.keyType._def.type._def.checks?.length){let{type:a,...n}=be(r.keyType._def,e);return{...t,propertyNames:n}}}return t}function tt(r,e){if(e.mapStrategy==="record")return we(r,e);let t=y(r.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||k(e),a=y(r.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||k(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,a],minItems:2,maxItems:2}}}function rt(r){let e=r.values,a=Object.keys(r.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),n=Array.from(new Set(a.map(s=>typeof s)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:a}}function at(r){return r.target==="openAi"?void 0:{not:k({...r,currentPath:[...r.currentPath,"not"]})}}function nt(r){return r.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var ye={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function it(r,e){if(e.target==="openApi3")return st(r,e);let t=r.options instanceof Map?Array.from(r.options.values()):r.options;if(t.every(a=>a._def.typeName in ye&&(!a._def.checks||!a._def.checks.length))){let a=t.reduce((n,s)=>{let i=ye[s._def.typeName];return i&&!n.includes(i)?[...n,i]:n},[]);return{type:a.length>1?a:a[0]}}else if(t.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){let a=t.reduce((n,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...n,i];case"bigint":return[...n,"integer"];case"object":if(s._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(a.length===t.length){let n=a.filter((s,i,o)=>o.indexOf(s)===i);return{type:n.length>1?n:n[0],enum:t.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(t.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((a,n)=>[...a,...n._def.values.filter(s=>!a.includes(s))],[])};return st(r,e)}var st=(r,e)=>{let t=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((a,n)=>y(a._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return t.length?{anyOf:t}:void 0};function ot(r,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(r.innerType._def.typeName)&&(!r.innerType._def.checks||!r.innerType._def.checks.length))return e.target==="openApi3"?{type:ye[r.innerType._def.typeName],nullable:!0}:{type:[ye[r.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let a=y(r.innerType._def,{...e,currentPath:[...e.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}let t=y(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function ct(r,e){let t={type:"number"};if(!r.checks)return t;for(let a of r.checks)switch(a.kind){case"int":t.type="integer",Ze(t,"type",a.message,e);break;case"min":e.target==="jsonSchema7"?a.inclusive?b(t,"minimum",a.value,a.message,e):b(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),b(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?b(t,"maximum",a.value,a.message,e):b(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),b(t,"maximum",a.value,a.message,e));break;case"multipleOf":b(t,"multipleOf",a.value,a.message,e);break}return t}function ut(r,e){let t=e.target==="openAi",a={type:"object",properties:{}},n=[],s=r.shape();for(let o in s){let c=s[o];if(c===void 0||c._def===void 0)continue;let p=Yt(c);p&&t&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),p=!1);let g=y(c._def,{...e,currentPath:[...e.currentPath,"properties",o],propertyPath:[...e.currentPath,"properties",o]});g!==void 0&&(a.properties[o]=g,p||n.push(o))}n.length&&(a.required=n);let i=Ht(r,e);return i!==void 0&&(a.additionalProperties=i),a}function Ht(r,e){if(r.catchall._def.typeName!=="ZodNever")return y(r.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Yt(r){try{return r.isOptional()}catch{return!0}}var dt=(r,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return y(r.innerType._def,e);let t=y(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:k(e)},t]}:k(e)};var lt=(r,e)=>{if(e.pipeStrategy==="input")return y(r.in._def,e);if(e.pipeStrategy==="output")return y(r.out._def,e);let t=y(r.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),a=y(r.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,a].filter(n=>n!==void 0)}};function pt(r,e){return y(r.type._def,e)}function ft(r,e){let a={type:"array",uniqueItems:!0,items:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return r.minSize&&b(a,"minItems",r.minSize.value,r.minSize.message,e),r.maxSize&&b(a,"maxItems",r.maxSize.value,r.maxSize.message,e),a}function mt(r,e){return r.rest?{type:"array",minItems:r.items.length,items:r.items.map((t,a)=>y(t._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((t,a)=>a===void 0?t:[...t,a],[]),additionalItems:y(r.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:r.items.length,maxItems:r.items.length,items:r.items.map((t,a)=>y(t._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((t,a)=>a===void 0?t:[...t,a],[])}}function ht(r){return{not:k(r)}}function yt(r){return k(r)}var gt=(r,e)=>y(r.innerType._def,e);var _t=(r,e,t)=>{switch(e){case d.ZodString:return ke(r,t);case d.ZodNumber:return ct(r,t);case d.ZodObject:return ut(r,t);case d.ZodBigInt:return qe(r,t);case d.ZodBoolean:return Je();case d.ZodDate:return De(r,t);case d.ZodUndefined:return ht(t);case d.ZodNull:return nt(t);case d.ZodArray:return We(r,t);case d.ZodUnion:case d.ZodDiscriminatedUnion:return it(r,t);case d.ZodIntersection:return Qe(r,t);case d.ZodTuple:return mt(r,t);case d.ZodRecord:return we(r,t);case d.ZodLiteral:return Xe(r,t);case d.ZodEnum:return Ge(r);case d.ZodNativeEnum:return rt(r);case d.ZodNullable:return ot(r,t);case d.ZodOptional:return dt(r,t);case d.ZodMap:return tt(r,t);case d.ZodSet:return ft(r,t);case d.ZodLazy:return()=>r.getter()._def;case d.ZodPromise:return pt(r,t);case d.ZodNaN:case d.ZodNever:return at(t);case d.ZodEffects:return Ke(r,t);case d.ZodAny:return k(t);case d.ZodUnknown:return yt(t);case d.ZodDefault:return Ye(r,t);case d.ZodBranded:return be(r,t);case d.ZodReadonly:return gt(r,t);case d.ZodCatch:return He(r,t);case d.ZodPipeline:return lt(r,t);case d.ZodFunction:case d.ZodVoid:case d.ZodSymbol:return;default:return(a=>{})(e)}};function y(r,e,t=!1){let a=e.seen.get(r);if(e.override){let o=e.override?.(r,e,a,t);if(o!==Me)return o}if(a&&!t){let o=Kt(a,e);if(o!==void 0)return o}let n={def:r,path:e.currentPath,jsonSchema:void 0};e.seen.set(r,n);let s=_t(r,r.typeName,e),i=typeof s=="function"?y(s(),e):s;if(i&&Gt(r,e,i),e.postProcess){let o=e.postProcess(i,r,e);return n.jsonSchema=i,o}return n.jsonSchema=i,i}var Kt=(r,e)=>{switch(e.$refStrategy){case"root":return{$ref:r.path.join("/")};case"relative":return{$ref:xe(e.currentPath,r.path)};case"none":case"seen":return r.path.length<e.currentPath.length&&r.path.every((t,a)=>e.currentPath[a]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),k(e)):e.$refStrategy==="seen"?k(e):void 0}},Gt=(r,e,t)=>(r.description&&(t.description=r.description,e.markdownDescription&&(t.markdownDescription=r.description)),t);var vt=r=>{let e=ze(r),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([a,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,a],jsonSchema:void 0}]))}};var Qt=(r,e)=>{let t=vt(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[p,g])=>({...c,[p]:y(g._def,{...t,currentPath:[...t.basePath,t.definitionPath,p]},!0)??k(t)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=y(r._def,n===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,n]},!1)??k(t),i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(s.title=i),t.flags.hasReferencedOpenAiAnyType&&(a||(a={}),a[t.openAiAnyTypeName]||(a[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}));let o=n===void 0?a?{...s,[t.definitionPath]:a}:s:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,n].join("/"),[t.definitionPath]:{...a,[n]:s}};return t.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o};export{Xt as a,Er as b,Qt as c};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{d as Tt}from"./chunk-PSANHDZM.js";var At={};Tt(At,{ExrBench:()=>J,ExrStreamEncoder:()=>Q,ProResBench:()=>Z,ProResMovEncoder:()=>tt,ProResMovWriter:()=>et,arriraw12_clip_info:()=>Ot,arriraw_mxf_gpu_frame:()=>Ft,audio_aac_au:()=>Wt,audio_aac_config:()=>St,audio_info:()=>Rt,bench_f32_boundary:()=>Lt,bench_piz_no_huffman:()=>Dt,dci_code_full_depth:()=>zt,dci_frame_cap:()=>Ut,dci_gpu_colour_patch:()=>jt,dci_gpu_colour_tables:()=>Bt,dci_last_pass_caps:()=>Pt,dci_legal_rates:()=>Ct,dci_mq_bench:()=>qt,dci_pack_tier1:()=>Nt,dci_stage_rgba8:()=>Ht,dci_transform_only:()=>Gt,decode_arriraw12_luma:()=>Vt,decode_arriraw12_mxf:()=>Kt,decode_arriraw12_preview:()=>Xt,decode_arriraw12_rgba:()=>Yt,decode_arriraw_luma:()=>$t,decode_arriraw_mxf:()=>Jt,decode_arriraw_preview:()=>Qt,decode_arriraw_preview_gray:()=>Zt,decode_arriraw_preview_meta:()=>te,decode_arriraw_rgba:()=>ee,decode_arriraw_rgba_meta:()=>ne,decode_audio_pcm:()=>re,decode_braw_gen5log:()=>_e,decode_braw_luma:()=>oe,decode_braw_preview:()=>ie,decode_braw_rgba:()=>ae,decode_cr3_rgba:()=>ce,decode_crm:()=>se,decode_dng_preview:()=>de,decode_dng_rgba:()=>pe,decode_dpx_preview:()=>ge,decode_dpx_rgba:()=>ue,decode_exr_linear:()=>we,decode_exr_preview:()=>be,decode_exr_rgba:()=>le,decode_prores_band_rgba:()=>fe,decode_prores_luma:()=>ve,decode_prores_mxf:()=>xe,decode_prores_preview:()=>Ie,decode_prores_raw_acescct:()=>ye,decode_prores_raw_luma:()=>me,decode_prores_raw_preview:()=>he,decode_prores_raw_rec2020:()=>ke,decode_prores_raw_rgba:()=>Ae,decode_prores_rgb16:()=>Me,decode_prores_rgba:()=>Ee,decode_prores_thumb_dc32:()=>Te,decode_r3d_luma:()=>Oe,decode_r3d_preview:()=>Fe,decode_r3d_preview_clip:()=>We,decode_r3d_rgb16:()=>Se,decode_r3d_rgba:()=>Re,decode_r3d_rgba_clip:()=>Le,decode_tiff_preview:()=>De,decode_tiff_rgba:()=>ze,decode_vc3_band_rgba:()=>Ue,decode_vc3_luma:()=>je,decode_vc3_mxf:()=>Be,decode_vc3_preview:()=>Pe,decode_vc3_rgba:()=>Ce,decode_xocn_luma:()=>qe,decode_xocn_mxf:()=>Ne,decode_xocn_preview:()=>He,decode_xocn_rgb16:()=>Ge,decode_xocn_rgba:()=>Ve,default:()=>nt,encode_dci_j2c:()=>Ke,encode_dci_j2c_rgb:()=>Xe,encode_dci_j2c_rgba8:()=>Ye,encode_dci_j2c_staged:()=>$e,encode_dci_j2c_staged_modelled:()=>Je,encode_exr:()=>Qe,encode_prores_4444_alpha_mov_rgba:()=>Ze,encode_prores_4444_alpha_sample_q:()=>tn,encode_prores_444_sample_cbr:()=>en,encode_prores_444_sample_cbr_rgb16:()=>nn,encode_prores_444_sample_cbr_rgb16_lut:()=>rn,encode_prores_mov_rgba:()=>_n,encode_prores_rgba:()=>on,encode_prores_sample_cbr:()=>an,encode_prores_sample_cbr_rgb16:()=>cn,encode_prores_sample_cbr_rgb16_lut:()=>sn,encode_prores_sample_q:()=>dn,exr_sequence_filename:()=>pn,initSync:()=>Mr,inspect_cr3:()=>gn,inspect_dng:()=>un,inspect_dpx:()=>wn,inspect_exr:()=>bn,inspect_isobmff:()=>ln,inspect_tiff:()=>fn,inspect_wav:()=>vn,is_arriraw12_mxf:()=>xn,is_arriraw_mxf:()=>In,is_crm:()=>yn,is_prores_mxf:()=>mn,is_vc3_mxf:()=>hn,is_xavc_mxf:()=>kn,is_xocn_mxf:()=>An,list_isobmff_segments:()=>Mn,list_mxf_segments:()=>En,list_r3d_frames:()=>Tn,list_r3d_segments:()=>On,list_wav_segments:()=>Fn,mux_prores_4444_alpha_samples:()=>Wn,mux_prores_samples:()=>Sn,mux_prores_samples_full:()=>Rn,mxf_au_run:()=>Ln,mxf_frame_index:()=>Dn,mxf_gop_map:()=>zn,mxf_h264_kind:()=>Un,plan_isobmff_trim:()=>jn,plan_isobmff_trim_reader:()=>Bn,plan_mxf_compact_trim:()=>Pn,plan_mxf_trim:()=>Cn,plan_r3d_compact:()=>qn,plan_wav_trim:()=>Nn,plan_wav_trim_reader:()=>Hn,prepare_isobmff:()=>Gn,prepare_mxf:()=>Vn,prepare_r3d:()=>Kn,prepare_wav:()=>Xn,probe_mov:()=>Yn,probe_mxf:()=>$n,probe_r3d:()=>Jn,prores_band_info:()=>Qn,prores_reset_rate_control:()=>Zn,r3d_gpu_develop_params:()=>tr,r3d_is_helium:()=>er,read_arriraw_fcs:()=>nr,read_arriraw_unit_correction:()=>rr,recover_reframe:()=>_r,resample_rgba16:()=>or,resample_rgba8:()=>ir,reset_dci_rate_state:()=>ar,rgba8_to_xyz12:()=>cr,trim_r3d:()=>sr,vc3_band_info:()=>dr,video_frame_index_isobmff_reader:()=>pr,xavc_au:()=>gr,xavc_frame_count:()=>ur,xocn_frame_count:()=>wr});var J=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,wt.unregister(this),e}free(){let e=this.__destroy_into_raw();t.__wbg_exrbench_free(e,0)}block_rows(){return t.exrbench_block_rows(this.__wbg_ptr)>>>0}f32_to_half_block(){return t.exrbench_f32_to_half_block(this.__wbg_ptr)}n_blocks(){return t.exrbench_n_blocks(this.__wbg_ptr)>>>0}constructor(e,n,o,a){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=I(a,t.__wbindgen_export4,t.__wbindgen_export5),u=p;t.exrbench_new(d,e,n,o,g,u);var c=_().getInt32(d+0,!0),i=_().getInt32(d+4,!0),s=_().getInt32(d+8,!0);if(s)throw w(i);return this.__wbg_ptr=c,wt.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}piz_stage_block(e){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.exrbench_piz_stage_block(c,this.__wbg_ptr,e);var n=_().getFloat64(c+0,!0),o=_().getInt32(c+8,!0),a=_().getInt32(c+12,!0);if(a)throw w(o);return n}finally{t.__wbindgen_add_to_stack_pointer(16)}}staging_f32_ptr(){return t.exrbench_staging_f32_ptr(this.__wbg_ptr)>>>0}staging_f32_samples(){return t.exrbench_staging_f32_samples(this.__wbg_ptr)>>>0}staging_half_len(){return t.exrbench_staging_half_len(this.__wbg_ptr)>>>0}staging_half_ptr(){return t.exrbench_staging_half_ptr(this.__wbg_ptr)>>>0}zip_stage_block(e){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.exrbench_zip_stage_block(c,this.__wbg_ptr,e);var n=_().getFloat64(c+0,!0),o=_().getInt32(c+8,!0),a=_().getInt32(c+12,!0);if(a)throw w(o);return n}finally{t.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(J.prototype[Symbol.dispose]=J.prototype.free);var Q=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,bt.unregister(this),e}free(){let e=this.__destroy_into_raw();t.__wbg_exrstreamencoder_free(e,0)}block_rows(){return t.exrstreamencoder_block_rows(this.__wbg_ptr)>>>0}finish(){try{let i=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_finish(i,this.__wbg_ptr);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_header(a,this.__wbg_ptr);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}n_blocks(){return t.exrstreamencoder_n_blocks(this.__wbg_ptr)>>>0}constructor(e,n,o,a,c,i,s,d,g,u){try{let y=t.__wbindgen_add_to_stack_pointer(-16),h=I(o,t.__wbindgen_export4,t.__wbindgen_export5),A=p,M=I(a,t.__wbindgen_export4,t.__wbindgen_export5),O=p,F=I(c,t.__wbindgen_export4,t.__wbindgen_export5),T=p,W=I(i,t.__wbindgen_export4,t.__wbindgen_export5),L=p,D=I(d,t.__wbindgen_export4,t.__wbindgen_export5),U=p;t.exrstreamencoder_new(y,e,n,h,A,M,O,F,T,W,L,s,D,U,g,u);var b=_().getInt32(y+0,!0),x=_().getInt32(y+4,!0),m=_().getInt32(y+8,!0);if(m)throw w(x);return this.__wbg_ptr=b,bt.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_block(e){try{let s=t.__wbindgen_add_to_stack_pointer(-16);t.exrstreamencoder_push_block(s,this.__wbg_ptr,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}rows_remaining(){return t.exrstreamencoder_rows_remaining(this.__wbg_ptr)>>>0}staging_ptr(){return t.exrstreamencoder_staging_ptr(this.__wbg_ptr)>>>0}staging_samples(){return t.exrstreamencoder_staging_samples(this.__wbg_ptr)>>>0}};Symbol.dispose&&(Q.prototype[Symbol.dispose]=Q.prototype.free);var Z=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),e}free(){let e=this.__destroy_into_raw();t.__wbg_proresbench_free(e,0)}constructor(e,n,o,a){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=I(o,t.__wbindgen_export4,t.__wbindgen_export5),u=p;t.proresbench_new(d,e,n,g,u,a);var c=_().getInt32(d+0,!0),i=_().getInt32(d+4,!0),s=_().getInt32(d+8,!0);if(s)throw w(i);return this.__wbg_ptr=c,lt.register(this,this.__wbg_ptr,this),this}finally{t.__wbindgen_add_to_stack_pointer(16)}}stage(e){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.proresbench_stage(c,this.__wbg_ptr,e);var n=_().getFloat64(c+0,!0),o=_().getInt32(c+8,!0),a=_().getInt32(c+12,!0);if(a)throw w(o);return n}finally{t.__wbindgen_add_to_stack_pointer(16)}}staging_len(){return t.proresbench_staging_len(this.__wbg_ptr)>>>0}staging_ptr(){return t.proresbench_staging_ptr(this.__wbg_ptr)>>>0}};Symbol.dispose&&(Z.prototype[Symbol.dispose]=Z.prototype.free);var tt=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),e}free(){let e=this.__destroy_into_raw();t.__wbg_proresmovencoder_free(e,0)}add_frame_rgba(e){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(e,t.__wbindgen_export4),i=p;t.proresmovencoder_add_frame_rgba(a,this.__wbg_ptr,c,i);var n=_().getInt32(a+0,!0),o=_().getInt32(a+4,!0);if(o)throw w(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}finish(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovencoder_finish(a,this.__wbg_ptr);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}frame_count(){return t.proresmovencoder_frame_count(this.__wbg_ptr)>>>0}constructor(e,n,o,a){let c=t.proresmovencoder_new(e,n,o,a);return this.__wbg_ptr=c,ft.register(this,this.__wbg_ptr,this),this}set_alpha(e){t.proresmovencoder_set_alpha(this.__wbg_ptr,e)}set_bitrate_mbps(e){t.proresmovencoder_set_bitrate_mbps(this.__wbg_ptr,e)}set_qscale(e){t.proresmovencoder_set_qscale(this.__wbg_ptr,e)}};Symbol.dispose&&(tt.prototype[Symbol.dispose]=tt.prototype.free);var et=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,vt.unregister(this),e}free(){let e=this.__destroy_into_raw();t.__wbg_proresmovwriter_free(e,0)}finish(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_finish(a,this.__wbg_ptr);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}frame_count(){return t.proresmovwriter_frame_count(this.__wbg_ptr)>>>0}header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_header(a,this.__wbg_ptr);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}mdat_box_header(){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_mdat_box_header(a,this.__wbg_ptr);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}mdat_box_offset(){return t.proresmovwriter_mdat_box_offset(this.__wbg_ptr)}constructor(e,n,o,a){let c=t.proresmovwriter_new(e,n,o,a);return this.__wbg_ptr=c,vt.register(this,this.__wbg_ptr,this),this}push_frame(){try{let i=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_push_frame(i,this.__wbg_ptr);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_sample(e){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(e,t.__wbindgen_export4),i=p;t.proresmovwriter_push_sample(a,this.__wbg_ptr,c,i);var n=_().getInt32(a+0,!0),o=_().getInt32(a+4,!0);if(o)throw w(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}push_sample_len(e){try{let a=t.__wbindgen_add_to_stack_pointer(-16);t.proresmovwriter_push_sample_len(a,this.__wbg_ptr,e);var n=_().getInt32(a+0,!0),o=_().getInt32(a+4,!0);if(o)throw w(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}reserve_large_mdat(e){t.proresmovwriter_reserve_large_mdat(this.__wbg_ptr,e)}set_alpha(e){t.proresmovwriter_set_alpha(this.__wbg_ptr,e)}set_bitrate_mbps(e){t.proresmovwriter_set_bitrate_mbps(this.__wbg_ptr,e)}set_par(e,n){t.proresmovwriter_set_par(this.__wbg_ptr,e,n)}set_profile(e){let n=I(e,t.__wbindgen_export4,t.__wbindgen_export5),o=p;t.proresmovwriter_set_profile(this.__wbg_ptr,n,o)}set_qscale(e){t.proresmovwriter_set_qscale(this.__wbg_ptr,e)}set_start_timecode(e,n){t.proresmovwriter_set_start_timecode(this.__wbg_ptr,e,n)}staging_len(){return t.proresmovwriter_staging_len(this.__wbg_ptr)>>>0}staging_ptr(){return t.proresmovwriter_staging_ptr(this.__wbg_ptr)>>>0}total_len(){return t.proresmovwriter_total_len(this.__wbg_ptr)}};Symbol.dispose&&(et.prototype[Symbol.dispose]=et.prototype.free);function Ot(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.arriraw12_clip_info(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function Ft(r,e,n,o){var a=B(o)?0:I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p;let i=t.arriraw_mxf_gpu_frame(v(r),e,n,a,c);return w(i)}function Wt(r,e,n){let o=t.audio_aac_au(v(r),e,n);return w(o)}function St(r,e){let n=t.audio_aac_config(v(r),e);return w(n)}function Rt(r,e){let n=t.audio_info(v(r),e);return w(n)}function Lt(r){let e=gt(r,t.__wbindgen_export4),n=p;return t.bench_f32_boundary(e,n)}function Dt(r,e,n,o){let a=gt(r,t.__wbindgen_export4),c=p;return t.bench_piz_no_huffman(a,c,e,n,o)}function zt(r,e,n){let o=S(r,t.__wbindgen_export4),a=p;return t.dci_code_full_depth(o,a,e,n)}function Ut(r,e,n){return t.dci_frame_cap(r,e,n)>>>0}function jt(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p,u=I(e,t.__wbindgen_export4,t.__wbindgen_export5),b=p;t.dci_gpu_colour_patch(s,d,g,u,b);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=pt(n,o).slice();return t.__wbindgen_export3(n,o*2,2),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Bt(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=I(r,t.__wbindgen_export4,t.__wbindgen_export5),d=p;t.dci_gpu_colour_tables(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Pt(){try{let o=t.__wbindgen_add_to_stack_pointer(-16);t.dci_last_pass_caps(o);var r=_().getInt32(o+0,!0),e=_().getInt32(o+4,!0),n=_t(r,e).slice();return t.__wbindgen_export3(r,e*4,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ct(r,e){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.dci_legal_rates(c,r,e);var n=_().getInt32(c+0,!0),o=_().getInt32(c+4,!0),a=_t(n,o).slice();return t.__wbindgen_export3(n,o*4,4),a}finally{t.__wbindgen_add_to_stack_pointer(16)}}function qt(r){return t.dci_mq_bench(r)>>>0}function Nt(r,e,n,o,a,c,i,s,d,g,u){try{let A=t.__wbindgen_add_to_stack_pointer(-16),M=R(r,t.__wbindgen_export4),O=p,F=l(e,t.__wbindgen_export4),T=p,W=R(n,t.__wbindgen_export4),L=p,D=R(o,t.__wbindgen_export4),U=p,C=R(a,t.__wbindgen_export4),q=p,ot=R(c,t.__wbindgen_export4),it=p,at=R(i,t.__wbindgen_export4),ct=p,Mt=R(s,t.__wbindgen_export4),Et=p;t.dci_pack_tier1(A,M,O,F,T,W,L,D,U,C,q,ot,it,at,ct,Mt,Et,d,g,u);var b=_().getInt32(A+0,!0),x=_().getInt32(A+4,!0),m=_().getInt32(A+8,!0),y=_().getInt32(A+12,!0);if(y)throw w(m);var h=f(b,x).slice();return t.__wbindgen_export3(b,x*1,1),h}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ht(r,e){let n=t.dci_stage_rgba8(r,e);return w(n)}function Gt(r,e,n){let o=S(r,t.__wbindgen_export4),a=p;return t.dci_transform_only(o,a,e,n)}function Vt(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p,u=l(e,t.__wbindgen_export4),b=p;t.decode_arriraw12_luma(s,d,g,u,b);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Kt(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_arriraw12_mxf(v(r),e,n,a,c);return w(i)}function Xt(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p,b=l(e,t.__wbindgen_export4),x=p;t.decode_arriraw12_preview(d,g,u,b,x,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Yt(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p,u=l(e,t.__wbindgen_export4),b=p;t.decode_arriraw12_rgba(s,d,g,u,b);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function $t(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p;t.decode_arriraw_luma(d,g,u,e,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Jt(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_arriraw_mxf(v(r),e,n,a,c);return w(i)}function Qt(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.decode_arriraw_preview(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Zt(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.decode_arriraw_preview_gray(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function te(r,e,n,o,a,c,i,s,d){try{let A=t.__wbindgen_add_to_stack_pointer(-16),M=l(r,t.__wbindgen_export4),O=p;var g=B(d)?0:Y(d,t.__wbindgen_export4),u=p;t.decode_arriraw_preview_meta(A,M,O,e,n,o,a,c,i,s,g,u);var b=_().getInt32(A+0,!0),x=_().getInt32(A+4,!0),m=_().getInt32(A+8,!0),y=_().getInt32(A+12,!0);if(y)throw w(m);var h=f(b,x).slice();return t.__wbindgen_export3(b,x*1,1),h}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ee(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p;t.decode_arriraw_rgba(d,g,u,e,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ne(r,e,n,o,a,c,i,s){try{let h=t.__wbindgen_add_to_stack_pointer(-16),A=l(r,t.__wbindgen_export4),M=p;var d=B(s)?0:Y(s,t.__wbindgen_export4),g=p;t.decode_arriraw_rgba_meta(h,A,M,e,n,o,a,c,i,d,g);var u=_().getInt32(h+0,!0),b=_().getInt32(h+4,!0),x=_().getInt32(h+8,!0),m=_().getInt32(h+12,!0);if(m)throw w(x);var y=f(u,b).slice();return t.__wbindgen_export3(u,b*1,1),y}finally{t.__wbindgen_add_to_stack_pointer(16)}}function re(r,e,n,o){let a=t.decode_audio_pcm(v(r),e,n,o);return w(a)}function _e(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.decode_braw_gen5log(a,c,i);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}function oe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_braw_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ie(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_braw_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ae(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_braw_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ce(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_cr3_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function se(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_crm(v(r),e,n,a,c);return w(i)}function de(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_dng_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function pe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_dng_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ge(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_dpx_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ue(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_dpx_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function we(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_exr_linear(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function be(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_exr_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function le(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_exr_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function fe(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p;t.decode_prores_band_rgba(d,g,u,e,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ve(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function xe(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_prores_mxf(v(r),e,n,a,c);return w(i)}function Ie(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_prores_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ye(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_raw_acescct(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function me(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_raw_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function he(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_prores_raw_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ke(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_raw_rec2020(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ae(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_raw_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Me(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_rgb16(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ee(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Te(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_prores_thumb_dc32(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Oe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_r3d_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Fe(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_r3d_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function We(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p,b=l(e,t.__wbindgen_export4),x=p;t.decode_r3d_preview_clip(d,g,u,b,x,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Se(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_r3d_rgb16(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Re(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_r3d_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Le(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p,u=l(e,t.__wbindgen_export4),b=p;t.decode_r3d_rgba_clip(s,d,g,u,b);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function De(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_tiff_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ze(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_tiff_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ue(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p;t.decode_vc3_band_rgba(d,g,u,e,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function je(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_vc3_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Be(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_vc3_mxf(v(r),e,n,a,c);return w(i)}function Pe(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_vc3_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ce(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_vc3_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function qe(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_xocn_luma(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ne(r,e,n,o){let a=I(o,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.decode_xocn_mxf(v(r),e,n,a,c);return w(i)}function He(r,e){try{let s=t.__wbindgen_add_to_stack_pointer(-16),d=l(r,t.__wbindgen_export4),g=p;t.decode_xocn_preview(s,d,g,e);var n=_().getInt32(s+0,!0),o=_().getInt32(s+4,!0),a=_().getInt32(s+8,!0),c=_().getInt32(s+12,!0);if(c)throw w(a);var i=f(n,o).slice();return t.__wbindgen_export3(n,o*1,1),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ge(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.decode_xocn_rgb16(a,c,i);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ve(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.decode_xocn_rgba(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ke(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=S(r,t.__wbindgen_export4),b=p;t.encode_dci_j2c(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Xe(r,e,n,o,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=S(r,t.__wbindgen_export4),m=p,y=I(n,t.__wbindgen_export4,t.__wbindgen_export5),h=p;t.encode_dci_j2c_rgb(b,x,m,e,y,h,o,a,c);var i=_().getInt32(b+0,!0),s=_().getInt32(b+4,!0),d=_().getInt32(b+8,!0),g=_().getInt32(b+12,!0);if(g)throw w(d);var u=f(i,s).slice();return t.__wbindgen_export3(i,s*1,1),u}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ye(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(e,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.encode_dci_j2c_rgba8(u,b,x,m,y,n,o,a);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function $e(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=I(o,t.__wbindgen_export4,t.__wbindgen_export5),x=p;t.encode_dci_j2c_staged(u,r,e,n,b,x,a);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Je(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=I(o,t.__wbindgen_export4,t.__wbindgen_export5),x=p;t.encode_dci_j2c_staged_modelled(u,r,e,n,b,x,a);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Qe(r,e,n,o,a,c,i,s,d,g,u,b,x,m,y){try{let T=t.__wbindgen_add_to_stack_pointer(-16),W=gt(r,t.__wbindgen_export4),L=p,D=I(a,t.__wbindgen_export4,t.__wbindgen_export5),U=p,C=I(c,t.__wbindgen_export4,t.__wbindgen_export5),q=p,ot=I(i,t.__wbindgen_export4,t.__wbindgen_export5),it=p,at=I(x,t.__wbindgen_export4,t.__wbindgen_export5),ct=p;t.encode_exr(T,W,L,e,n,o,D,U,C,q,ot,it,s,d,g,u,b,at,ct,m,y);var h=_().getInt32(T+0,!0),A=_().getInt32(T+4,!0),M=_().getInt32(T+8,!0),O=_().getInt32(T+12,!0);if(O)throw w(M);var F=f(h,A).slice();return t.__wbindgen_export3(h,A*1,1),F}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ze(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p;t.encode_prores_4444_alpha_mov_rgba(u,b,x,e,n,o,a);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function tn(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.encode_prores_4444_alpha_sample_q(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function en(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.encode_prores_444_sample_cbr(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function nn(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=S(r,t.__wbindgen_export4),b=p;t.encode_prores_444_sample_cbr_rgb16(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function rn(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=S(r,t.__wbindgen_export4),x=p,m=S(a,t.__wbindgen_export4),y=p;t.encode_prores_444_sample_cbr_rgb16_lut(u,b,x,e,n,o,m,y);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function _n(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p;t.encode_prores_mov_rgba(u,b,x,e,n,o,a);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function on(r,e,n){try{let d=t.__wbindgen_add_to_stack_pointer(-16),g=l(r,t.__wbindgen_export4),u=p;t.encode_prores_rgba(d,g,u,e,n);var o=_().getInt32(d+0,!0),a=_().getInt32(d+4,!0),c=_().getInt32(d+8,!0),i=_().getInt32(d+12,!0);if(i)throw w(c);var s=f(o,a).slice();return t.__wbindgen_export3(o,a*1,1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}function an(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_cbr(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function cn(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=S(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_cbr_rgb16(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function sn(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=S(r,t.__wbindgen_export4),x=p,m=S(a,t.__wbindgen_export4),y=p;t.encode_prores_sample_cbr_rgb16_lut(u,b,x,e,n,o,m,y);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=f(c,i).slice();return t.__wbindgen_export3(c,i*1,1),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function dn(r,e,n,o){try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.encode_prores_sample_q(g,u,b,e,n,o);var a=_().getInt32(g+0,!0),c=_().getInt32(g+4,!0),i=_().getInt32(g+8,!0),s=_().getInt32(g+12,!0);if(s)throw w(i);var d=f(a,c).slice();return t.__wbindgen_export3(a,c*1,1),d}finally{t.__wbindgen_add_to_stack_pointer(16)}}function pn(r,e,n,o){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=I(r,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.exr_sequence_filename(x,m,y,e,n,o);var i=_().getInt32(x+0,!0),s=_().getInt32(x+4,!0),d=_().getInt32(x+8,!0),g=_().getInt32(x+12,!0),u=i,b=s;if(g)throw u=0,b=0,w(d);return a=u,c=b,E(u,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function gn(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.inspect_cr3(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function un(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.inspect_dng(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function wn(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.inspect_dpx(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function bn(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.inspect_exr(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function ln(r,e,n){let o=I(n,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.inspect_isobmff(v(r),e,o,a);return w(c)}function fn(r){let e,n;try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.inspect_tiff(c,i,s);var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);return e=o,n=a,E(o,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function vn(r,e){let n=t.inspect_wav(v(r),e);return w(n)}function xn(r,e){let n=t.is_arriraw12_mxf(v(r),e);return w(n)}function In(r,e){let n=t.is_arriraw_mxf(v(r),e);return w(n)}function yn(r,e){let n=t.is_crm(v(r),e);return w(n)}function mn(r,e){let n=t.is_prores_mxf(v(r),e);return w(n)}function hn(r,e){let n=t.is_vc3_mxf(v(r),e);return w(n)}function kn(r,e){let n=t.is_xavc_mxf(v(r),e);return w(n)}function An(r,e){let n=t.is_xocn_mxf(v(r),e);return w(n)}function Mn(r,e,n){let o=I(n,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.list_isobmff_segments(v(r),e,o,a);return w(c)}function En(r,e){let n=t.list_mxf_segments(v(r),e);return w(n)}function Tn(r,e){let n=I(e,t.__wbindgen_export4,t.__wbindgen_export5),o=p,a=t.list_r3d_frames(v(r),n,o);return w(a)}function On(r,e){let n=I(e,t.__wbindgen_export4,t.__wbindgen_export5),o=p,a=t.list_r3d_segments(v(r),n,o);return w(a)}function Fn(r,e){let n=t.list_wav_segments(v(r),e);return w(n)}function Wn(r,e,n,o,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=R(e,t.__wbindgen_export4),h=p;t.mux_prores_4444_alpha_samples(b,x,m,y,h,n,o,a,c);var i=_().getInt32(b+0,!0),s=_().getInt32(b+4,!0),d=_().getInt32(b+8,!0),g=_().getInt32(b+12,!0);if(g)throw w(d);var u=f(i,s).slice();return t.__wbindgen_export3(i,s*1,1),u}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Sn(r,e,n,o,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=R(e,t.__wbindgen_export4),h=p;t.mux_prores_samples(b,x,m,y,h,n,o,a,c);var i=_().getInt32(b+0,!0),s=_().getInt32(b+4,!0),d=_().getInt32(b+8,!0),g=_().getInt32(b+12,!0);if(g)throw w(d);var u=f(i,s).slice();return t.__wbindgen_export3(i,s*1,1),u}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Rn(r,e,n,o,a,c,i,s,d,g,u,b){try{let M=t.__wbindgen_add_to_stack_pointer(-16),O=l(r,t.__wbindgen_export4),F=p,T=R(e,t.__wbindgen_export4),W=p,L=I(i,t.__wbindgen_export4,t.__wbindgen_export5),D=p;t.mux_prores_samples_full(M,O,F,T,W,n,o,a,c,L,D,s,d,g,u,b);var x=_().getInt32(M+0,!0),m=_().getInt32(M+4,!0),y=_().getInt32(M+8,!0),h=_().getInt32(M+12,!0);if(h)throw w(y);var A=f(x,m).slice();return t.__wbindgen_export3(x,m*1,1),A}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Ln(r,e,n,o){let a=t.mxf_au_run(v(r),e,n,o);return w(a)}function Dn(r,e){let n=t.mxf_frame_index(v(r),e);return w(n)}function zn(r,e){let n=t.mxf_gop_map(v(r),e);return w(n)}function Un(r,e){let n=t.mxf_h264_kind(v(r),e);return w(n)}function jn(r,e){let n,o;try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(e,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.plan_isobmff_trim(u,b,x,m,y);var a=_().getInt32(u+0,!0),c=_().getInt32(u+4,!0),i=_().getInt32(u+8,!0),s=_().getInt32(u+12,!0),d=a,g=c;if(s)throw d=0,g=0,w(i);return n=d,o=g,E(d,g)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(n,o,1)}}function Bn(r,e,n,o,a){let c=I(a,t.__wbindgen_export4,t.__wbindgen_export5),i=p,s=t.plan_isobmff_trim_reader(v(r),e,n,o,c,i);return w(s)}function Pn(r){let e,n;try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=I(r,t.__wbindgen_export4,t.__wbindgen_export5),b=p;t.plan_mxf_compact_trim(g,u,b);var o=_().getInt32(g+0,!0),a=_().getInt32(g+4,!0),c=_().getInt32(g+8,!0),i=_().getInt32(g+12,!0),s=o,d=a;if(i)throw s=0,d=0,w(c);return e=s,n=d,E(s,d)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function Cn(r,e,n,o){let a=t.plan_mxf_trim(v(r),e,n,o);return w(a)}function qn(r,e,n,o,a,c,i,s){let d,g;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=l(r,t.__wbindgen_export4),y=p,h=l(e,t.__wbindgen_export4),A=p,M=l(n,t.__wbindgen_export4),O=p,F=l(o,t.__wbindgen_export4),T=p,W=Y(a,t.__wbindgen_export4),L=p,D=Y(c,t.__wbindgen_export4),U=p,C=Y(i,t.__wbindgen_export4),q=p;t.plan_r3d_compact(x,m,y,h,A,M,O,F,T,W,L,D,U,C,q,s);var u=_().getInt32(x+0,!0),b=_().getInt32(x+4,!0);return d=u,g=b,E(u,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(d,g,1)}}function Nn(r,e,n,o){let a,c;try{let x=t.__wbindgen_add_to_stack_pointer(-16),m=l(r,t.__wbindgen_export4),y=p;t.plan_wav_trim(x,m,y,e,n,o);var i=_().getInt32(x+0,!0),s=_().getInt32(x+4,!0),d=_().getInt32(x+8,!0),g=_().getInt32(x+12,!0),u=i,b=s;if(g)throw u=0,b=0,w(d);return a=u,c=b,E(u,b)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(a,c,1)}}function Hn(r,e,n,o,a){let c=t.plan_wav_trim_reader(v(r),e,n,o,a);return w(c)}function Gn(r,e,n,o){let a=I(n,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=I(o,t.__wbindgen_export4,t.__wbindgen_export5),s=p,d=t.prepare_isobmff(v(r),e,a,c,i,s);return w(d)}function Vn(r,e,n){let o=I(n,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.prepare_mxf(v(r),e,o,a);return w(c)}function Kn(r,e,n){let o=I(e,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=I(n,t.__wbindgen_export4,t.__wbindgen_export5),i=p,s=t.prepare_r3d(v(r),o,a,c,i);return w(s)}function Xn(r,e,n,o){let a=I(n,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=t.prepare_wav(v(r),e,a,c,o);return w(i)}function Yn(r){let e,n;try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.probe_mov(g,u,b);var o=_().getInt32(g+0,!0),a=_().getInt32(g+4,!0),c=_().getInt32(g+8,!0),i=_().getInt32(g+12,!0),s=o,d=a;if(i)throw s=0,d=0,w(c);return e=s,n=d,E(s,d)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function $n(r,e){let n=t.probe_mxf(v(r),e);return w(n)}function Jn(r,e){let n=I(e,t.__wbindgen_export4,t.__wbindgen_export5),o=p,a=t.probe_r3d(v(r),n,o);return w(a)}function Qn(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.prores_band_info(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=_t(e,n).slice();return t.__wbindgen_export3(e,n*4,4),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function Zn(){t.prores_reset_rate_control()}function tr(r){try{let a=t.__wbindgen_add_to_stack_pointer(-16),c=l(r,t.__wbindgen_export4),i=p;t.r3d_gpu_develop_params(a,c,i);var e=_().getInt32(a+0,!0),n=_().getInt32(a+4,!0),o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),o}finally{t.__wbindgen_add_to_stack_pointer(16)}}function er(r){let e=l(r,t.__wbindgen_export4),n=p;return t.r3d_is_helium(e,n)!==0}function nr(r){let e,n;try{let g=t.__wbindgen_add_to_stack_pointer(-16),u=l(r,t.__wbindgen_export4),b=p;t.read_arriraw_fcs(g,u,b);var o=_().getInt32(g+0,!0),a=_().getInt32(g+4,!0),c=_().getInt32(g+8,!0),i=_().getInt32(g+12,!0),s=o,d=a;if(i)throw s=0,d=0,w(c);return e=s,n=d,E(s,d)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,n,1)}}function rr(r,e){try{let c=t.__wbindgen_add_to_stack_pointer(-16),i=l(r,t.__wbindgen_export4),s=p;t.read_arriraw_unit_correction(c,i,s,e);var n=_().getInt32(c+0,!0),o=_().getInt32(c+4,!0),a=vr(n,o).slice();return t.__wbindgen_export3(n,o*8,8),a}finally{t.__wbindgen_add_to_stack_pointer(16)}}function _r(r,e,n,o,a,c,i){let s,d;try{let h=t.__wbindgen_add_to_stack_pointer(-16),A=l(r,t.__wbindgen_export4),M=p,O=l(o,t.__wbindgen_export4),F=p,T=I(i,t.__wbindgen_export4,t.__wbindgen_export5),W=p;t.recover_reframe(h,A,M,e,n,O,F,a,c,T,W);var g=_().getInt32(h+0,!0),u=_().getInt32(h+4,!0),b=_().getInt32(h+8,!0),x=_().getInt32(h+12,!0),m=g,y=u;if(x)throw m=0,y=0,w(b);return s=m,d=y,E(m,y)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(s,d,1)}}function or(r,e,n,o,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=S(r,t.__wbindgen_export4),m=p,y=I(c,t.__wbindgen_export4,t.__wbindgen_export5),h=p;t.resample_rgba16(b,x,m,e,n,o,a,y,h);var i=_().getInt32(b+0,!0),s=_().getInt32(b+4,!0),d=_().getInt32(b+8,!0),g=_().getInt32(b+12,!0);if(g)throw w(d);var u=pt(i,s).slice();return t.__wbindgen_export3(i,s*2,2),u}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ir(r,e,n,o,a,c){try{let b=t.__wbindgen_add_to_stack_pointer(-16),x=l(r,t.__wbindgen_export4),m=p,y=I(c,t.__wbindgen_export4,t.__wbindgen_export5),h=p;t.resample_rgba8(b,x,m,e,n,o,a,y,h);var i=_().getInt32(b+0,!0),s=_().getInt32(b+4,!0),d=_().getInt32(b+8,!0),g=_().getInt32(b+12,!0);if(g)throw w(d);var u=f(i,s).slice();return t.__wbindgen_export3(i,s*1,1),u}finally{t.__wbindgen_add_to_stack_pointer(16)}}function ar(){t.reset_dci_rate_state()}function cr(r,e,n,o,a){try{let u=t.__wbindgen_add_to_stack_pointer(-16),b=l(r,t.__wbindgen_export4),x=p,m=I(a,t.__wbindgen_export4,t.__wbindgen_export5),y=p;t.rgba8_to_xyz12(u,b,x,e,n,o,m,y);var c=_().getInt32(u+0,!0),i=_().getInt32(u+4,!0),s=_().getInt32(u+8,!0),d=_().getInt32(u+12,!0);if(d)throw w(s);var g=pt(c,i).slice();return t.__wbindgen_export3(c,i*2,2),g}finally{t.__wbindgen_add_to_stack_pointer(16)}}function sr(r,e,n,o){let a=I(e,t.__wbindgen_export4,t.__wbindgen_export5),c=p,i=I(n,t.__wbindgen_export4,t.__wbindgen_export5),s=p,d=I(o,t.__wbindgen_export4,t.__wbindgen_export5),g=p,u=t.trim_r3d(v(r),a,c,i,s,d,g);return w(u)}function dr(r){try{let i=t.__wbindgen_add_to_stack_pointer(-16),s=l(r,t.__wbindgen_export4),d=p;t.vc3_band_info(i,s,d);var e=_().getInt32(i+0,!0),n=_().getInt32(i+4,!0),o=_().getInt32(i+8,!0),a=_().getInt32(i+12,!0);if(a)throw w(o);var c=_t(e,n).slice();return t.__wbindgen_export3(e,n*4,4),c}finally{t.__wbindgen_add_to_stack_pointer(16)}}function pr(r,e,n){let o=I(n,t.__wbindgen_export4,t.__wbindgen_export5),a=p,c=t.video_frame_index_isobmff_reader(v(r),e,o,a);return w(c)}function gr(r,e,n){let o=t.xavc_au(v(r),e,n);return w(o)}function ur(r,e){let n=t.xavc_frame_count(v(r),e);return w(n)}function wr(r,e){let n=t.xocn_frame_count(v(r),e);return w(n)}function It(){return{__proto__:null,"./media_core_bg.js":{__proto__:null,__wbg___wbindgen_is_function_acc5528be2b923f2:function(e){return typeof k(e)=="function"},__wbg___wbindgen_is_undefined_721f8decd50c87a3:function(e){return k(e)===void 0},__wbg___wbindgen_throw_ea4887a5f8f9a9db:function(e,n){throw new Error(E(e,n))},__wbg__wbg_cb_unref_33c39e13d73b25f6:function(e){k(e)._wbg_cb_unref()},__wbg_call_0e855b388e315e17:function(){return st(function(e,n,o,a){let c=k(e).call(k(n),k(o),k(a));return v(c)},arguments)},__wbg_call_5575218572ead796:function(){return st(function(e,n,o){let a=k(e).call(k(n),k(o));return v(a)},arguments)},__wbg_call_dd0f909cbc9405d0:function(){return st(function(e,n,o,a,c){let i=k(e).call(k(n),k(o),k(a),k(c));return v(i)},arguments)},__wbg_length_589238bdcf171f0e:function(e){return k(e).length},__wbg_new_81880fb5002cb255:function(e){let n=new Uint8Array(k(e));return v(n)},__wbg_new_typed_00a409eb4ec4f2d9:function(e,n){try{var o={a:e,b:n},a=(i,s)=>{let d=o.a;o.a=0;try{return lr(d,o.b,i,s)}finally{o.a=d}};let c=new Promise(a);return v(c)}finally{o.a=0}},__wbg_prototypesetcall_d721637c7ca66eb8:function(e,n,o){Uint8Array.prototype.set.call(f(e,n),k(o))},__wbg_queueMicrotask_1c9b3800e321a967:function(e){let n=k(e).queueMicrotask;return v(n)},__wbg_queueMicrotask_311744e534a929a3:function(e){queueMicrotask(k(e))},__wbg_resolve_d82363d90af6928a:function(e){let n=Promise.resolve(k(e));return v(n)},__wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938:function(){let e=typeof globalThis>"u"?null:globalThis;return B(e)?0:v(e)},__wbg_static_accessor_GLOBAL_ce44e66a4935da8c:function(){let e=typeof global>"u"?null:global;return B(e)?0:v(e)},__wbg_static_accessor_SELF_44f6e0cb5e67cdad:function(){let e=typeof self>"u"?null:self;return B(e)?0:v(e)},__wbg_static_accessor_WINDOW_168f178805d978fe:function(){let e=typeof window>"u"?null:window;return B(e)?0:v(e)},__wbg_then_05edfc8a4fea5106:function(e,n,o){let a=k(e).then(k(n),k(o));return v(a)},__wbg_then_591b6b3a75ee817a:function(e,n){let o=k(e).then(k(n));return v(o)},__wbindgen_cast_0000000000000001:function(e,n){let o=Ir(e,n,br);return v(o)},__wbindgen_cast_0000000000000002:function(e){return v(e)},__wbindgen_cast_0000000000000003:function(e,n){let o=f(e,n);return v(o)},__wbindgen_cast_0000000000000004:function(e,n){let o=E(e,n);return v(o)},__wbindgen_cast_0000000000000005:function(e,n){var o=f(e,n).slice();return t.__wbindgen_export3(e,n*1,1),v(o)},__wbindgen_object_clone_ref:function(e){let n=k(e);return v(n)},__wbindgen_object_drop_ref:function(e){w(e)}}}}function br(r,e,n){try{let c=t.__wbindgen_add_to_stack_pointer(-16);t.__wasm_bindgen_func_elem_1714(c,r,e,v(n));var o=_().getInt32(c+0,!0),a=_().getInt32(c+4,!0);if(a)throw w(o)}finally{t.__wbindgen_add_to_stack_pointer(16)}}function lr(r,e,n,o){t.__wasm_bindgen_func_elem_1729(r,e,v(n),v(o))}var wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_exrbench_free(r,1)),bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_exrstreamencoder_free(r,1)),lt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresbench_free(r,1)),ft=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresmovencoder_free(r,1)),vt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbg_proresmovwriter_free(r,1));function v(r){X===z.length&&z.push(z.length+1);let e=X;return X=z[e],z[e]=r,e}var xt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>t.__wbindgen_export2(r.a,r.b));function fr(r){r<1028||(z[r]=X,X=r)}function vr(r,e){return r=r>>>0,yt().subarray(r/8,r/8+e)}function pt(r,e){return r=r>>>0,mt().subarray(r/2,r/2+e)}function _t(r,e){return r=r>>>0,ht().subarray(r/4,r/4+e)}function f(r,e){return r=r>>>0,P().subarray(r/1,r/1+e)}var j=null;function _(){return(j===null||j.buffer.detached===!0||j.buffer.detached===void 0&&j.buffer!==t.memory.buffer)&&(j=new DataView(t.memory.buffer)),j}var N=null;function xr(){return(N===null||N.byteLength===0)&&(N=new Float32Array(t.memory.buffer)),N}var H=null;function yt(){return(H===null||H.byteLength===0)&&(H=new Float64Array(t.memory.buffer)),H}function E(r,e){return mr(r>>>0,e)}var G=null;function mt(){return(G===null||G.byteLength===0)&&(G=new Uint16Array(t.memory.buffer)),G}var V=null;function ht(){return(V===null||V.byteLength===0)&&(V=new Uint32Array(t.memory.buffer)),V}var K=null;function P(){return(K===null||K.byteLength===0)&&(K=new Uint8Array(t.memory.buffer)),K}function k(r){return z[r]}function st(r,e){try{return r.apply(this,e)}catch(n){t.__wbindgen_export(v(n))}}var z=new Array(1024).fill(void 0);z.push(void 0,null,!0,!1);var X=z.length;function B(r){return r==null}function Ir(r,e,n){let o={a:r,b:e,cnt:1},a=(...c)=>{o.cnt++;let i=o.a;o.a=0;try{return n(i,o.b,...c)}finally{o.a=i,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--o.cnt===0&&(t.__wbindgen_export2(o.a,o.b),o.a=0,xt.unregister(o))},xt.register(a,o,o),a}function S(r,e){let n=e(r.length*2,2)>>>0;return mt().set(r,n/2),p=r.length,n}function R(r,e){let n=e(r.length*4,4)>>>0;return ht().set(r,n/4),p=r.length,n}function l(r,e){let n=e(r.length*1,1)>>>0;return P().set(r,n/1),p=r.length,n}function gt(r,e){let n=e(r.length*4,4)>>>0;return xr().set(r,n/4),p=r.length,n}function Y(r,e){let n=e(r.length*8,8)>>>0;return yt().set(r,n/8),p=r.length,n}function I(r,e,n){if(n===void 0){let s=$.encode(r),d=e(s.length,1)>>>0;return P().subarray(d,d+s.length).set(s),p=s.length,d}let o=r.length,a=e(o,1)>>>0,c=P(),i=0;for(;i<o;i++){let s=r.charCodeAt(i);if(s>127)break;c[a+i]=s}if(i!==o){i!==0&&(r=r.slice(i)),a=n(a,o,o=i+r.length*3,1)>>>0;let s=P().subarray(a+i,a+o),d=$.encodeInto(r,s);i+=d.written,a=n(a,o,i,1)>>>0}return p=i,a}function w(r){let e=k(r);return fr(r),e}var rt=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});rt.decode();var yr=2146435072,dt=0;function mr(r,e){return dt+=e,dt>=yr&&(rt=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),rt.decode(),dt=e),rt.decode(P().subarray(r,r+e))}var $=new TextEncoder;"encodeInto"in $||($.encodeInto=function(r,e){let n=$.encode(r);return e.set(n),{read:r.length,written:n.length}});var p=0,hr,kr,t;function kt(r,e){return kr=r,t=r.exports,hr=e,j=null,N=null,H=null,G=null,V=null,K=null,t}async function Ar(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(a){if(r.ok&&n(r.type)&&r.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",a);else throw a}let o=await r.arrayBuffer();return await WebAssembly.instantiate(o,e)}else{let o=await WebAssembly.instantiate(r,e);return o instanceof WebAssembly.Instance?{instance:o,module:r}:o}function n(o){switch(o){case"basic":case"cors":case"default":return!0}return!1}}function Mr(r){if(t!==void 0)return t;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=It();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));let n=new WebAssembly.Instance(r,e);return kt(n,r)}async function nt(r){if(t!==void 0)return t;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module_or_path:r}=r:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),r===void 0&&(r=new URL("media_core_bg.wasm",import.meta.url));let e=It();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:n,module:o}=await Ar(await r,e);return kt(n,o)}var Or=import.meta.env?.MODE==="development"?["conform.tools","localhost"]:["conform.tools"];var ut=null,Er=!1;function Tr(r){return ut||(ut=(async()=>{if(r!==void 0)return nt(r);if(typeof process<"u"&&process.versions?.node){let n="node:fs/promises",{readFile:o}=await import(n),a=await o(new URL("./wasm/media_core_bg.wasm",import.meta.url));return nt({module_or_path:a})}let{default:e}=await import("./media_core_bg-XIM7Y4R3.js");return nt({module_or_path:e})})().then(e=>(Er=!0,e))),ut}function Lr(){return Tr()}export{Ft as a,Rt as b,Kt as c,$t as d,Jt as e,Zt as f,re as g,_e as h,oe as i,ie as j,ae as k,ce as l,se as m,pe as n,ue as o,le as p,ve as q,xe as r,Ie as s,ye as t,me as u,he as v,Ae as w,Me as x,Ee as y,Te as z,Oe as A,Fe as B,We as C,Se as D,Le as E,ze as F,je as G,Be as H,Pe as I,Ce as J,qe as K,Ne as L,He as M,gn as N,un as O,wn as P,bn as Q,ln as R,fn as S,vn as T,xn as U,In as V,mn as W,hn as X,An as Y,Mn as Z,En as _,Tn as $,On as aa,Fn as ba,Ln as ca,Dn as da,zn as ea,Bn as fa,Cn as ga,Hn as ha,Gn as ia,Vn as ja,Xn as ka,$n as la,Jn as ma,tr as na,er as oa,_r as pa,sr as qa,pr as ra,At as sa,Tr as ta,Lr as ua};