conformtools 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -0
- package/dist/arriraw-Y5VXHXNX.js +525 -0
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/chunk-35U7WGES.js +3 -0
- package/dist/chunk-3XTUTEKJ.js +102 -0
- package/dist/chunk-7D7H6VFW.js +3 -0
- package/dist/chunk-AACY2V3L.js +3 -0
- package/dist/chunk-AHNDJFQR.js +3 -0
- package/dist/chunk-C2ESM27Z.js +3 -0
- package/dist/chunk-DKGGJM6Z.js +3 -0
- package/dist/chunk-DRHOPOC7.js +3 -0
- package/dist/chunk-HJXRLQOI.js +3 -0
- package/dist/chunk-IDDQR56R.js +7 -0
- package/dist/chunk-JEMLKBH2.js +3 -0
- package/dist/chunk-NYB4ISL3.js +3 -0
- package/dist/chunk-P7OVDUA5.js +3 -0
- package/dist/chunk-PSANHDZM.js +3 -0
- package/dist/chunk-QDWB7QU7.js +3 -0
- package/dist/chunk-RXHNBSER.js +3 -0
- package/dist/chunk-SP5RGDAM.js +3 -0
- package/dist/chunk-TK55FA56.js +3 -0
- package/dist/chunk-UCMNH6Q6.js +3 -0
- package/dist/chunk-UUMHVA7R.js +3 -0
- package/dist/chunk-WWGQFOB2.js +64 -0
- package/dist/chunk-YPRTUS5W.js +3 -0
- package/dist/cli.js +11 -0
- package/dist/clip-state-B6JOX3JE.js +3 -0
- package/dist/cr3-wasm-X6Q4YMUU.js +3 -0
- package/dist/dng-wasm-EAB24KDN.js +3 -0
- package/dist/dpx-wasm-OX2D24ZB.js +3 -0
- package/dist/esm-SFFBP7PS.js +3 -0
- package/dist/exr-wasm-Z6BBPJSN.js +3 -0
- package/dist/h264-JHQCJTWP.js +3 -0
- package/dist/h264-mxf-4M63NBQK.js +3 -0
- package/dist/http.js +4 -0
- package/dist/inspect-6OM4FTVW.js +46 -0
- package/dist/isobmff-XL33CVJR.js +3 -0
- package/dist/mcp.js +13 -0
- package/dist/media_core-VSTO6CS4.js +9 -0
- package/dist/media_core_bg-BKXQLNFA.js +3 -0
- package/dist/media_core_bg-XIM7Y4R3.js +3 -0
- package/dist/mxf-VIANACTI.js +3 -0
- package/dist/onnxruntime-web-stub-PKJ2NZBF.js +3 -0
- package/dist/ops-7HVBBXUQ.js +3 -0
- package/dist/prores-TQEZ3KFH.js +526 -0
- package/dist/r3d-2QCFX7UX.js +3 -0
- package/dist/r3d-AT6NNIY3.js +1025 -0
- package/dist/source-BDJAUQVR.js +3 -0
- package/dist/sscd-sweep-IXM4OD7O.js +3 -0
- package/dist/still-E4HLCCST.js +3 -0
- package/dist/tiff-wasm-XYTQNL2F.js +3 -0
- package/dist/timeline_core-VK2ZWPCO.js +3 -0
- package/dist/timeline_core_bg-QEOVAIWP.js +3 -0
- package/dist/udf_bg-UTQ6BVXX.js +3 -0
- package/dist/wasm/media_core_bg.wasm +0 -0
- package/dist/wasm/udf_bg.wasm +0 -0
- package/dist/wasm-threads/media_core_bg.wasm +0 -0
- package/dist/wav-DXF73Y56.js +3 -0
- package/dist/zod-IPSV75LP.js +3 -0
- package/package.json +41 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var r=null;function t(){return typeof navigator<"u"&&!!navigator.gpu}async function a(){if(!t())return null;try{let e=await navigator.gpu.requestAdapter({powerPreference:"high-performance"});if(!e)return null;let i=await e.requestDevice({requiredLimits:{maxBufferSize:e.limits.maxBufferSize,maxStorageBufferBindingSize:e.limits.maxStorageBufferBindingSize,maxComputeWorkgroupStorageSize:e.limits.maxComputeWorkgroupStorageSize,maxComputeInvocationsPerWorkgroup:e.limits.maxComputeInvocationsPerWorkgroup}}),o=r;return i.lost.then(n=>{console.warn(`[media/gpu] device lost (${n.reason}): ${n.message}`),r===o&&(r=null)}),i}catch(e){return console.warn("[media/gpu] WebGPU unavailable, lanes fall back to WASM:",e),null}}function u(){return r||(r=a()),r}export{u as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
function r(n){let e=-1;for(let o of n)(o.kind==="frame"||o.kind==="gop"||o.kind==="audio")&&o.frame_out!=null&&(e=Math.max(e,o.frame_out));return e+1}function t(n){return n.some(e=>e.kind==="gop")?"gop":n.some(e=>e.kind==="audio")?"second":"frame"}export{r as a,t as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var n=[{codec:"prores",label:"Apple ProRes",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is DC-only 1/8 COLOR (2026-08-05 \u2014 was gray luma; Y+Cb+Cr DC walks, no AC/IDCT) \u2014 the realtime tier for BOTH playback and scrub: full 4K XQ decode is ~170ms/frame + a 35MB RGBA hand-off, which can hold neither 24fps nor a smooth scrub; the parked frame upgrades to full via the standard 160ms park timer (scrubPreview flipped true 2026-08-05 with the colour preview \u2014 the old 'full decode is scrub-fast' held for 2K 422, not 4K XQ). Both wrappers: .mov (sample table) and MXF OP1a (RDD 44, 2026-07-28 \u2014 is_prores_mxf routes the identical icpf bitstream through the walker via decode_prores_mxf; Suite ap4h fixture gated byte-exact vs ffmpeg 10-bit, rust tests/prores_mxf_gate.rs)"},{codec:"prores_raw",label:"Apple ProRes RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is a TRUE DC-only Bayer decode (2026-08-11 \u2014 was full entropy decode + subsample in develop): the DC-DPCM segment is a strict prefix of each tile component's bitstream, so the preview reads just those prefixes (no AC walk, no IDCT \u2014 real work reduction on single-threaded wasm), lands the exact closed-form flat value the full IDCT produces, and runs the SAME ACEScct develop on the 1/8 RGGB grid; Bayer-domain corr vs full block means 1.00000, developed-RGBA gate in tier_parity (aprh \u22650.99; aprn 0.93 floor \u2014 Jensen gap of the strongly-curved Panasonic linearisation, not a decode gap), ~50x native / ~70x serial-wasm-estimate vs Full. Bayer decode byte-exact vs ffmpeg 8.0; develop RE'd against Apple's own VideoToolbox decode \u2192 scene-linear Rec.2020 (decode_prores_raw_rec2020) / ACEScct. matrix=header cam\u2192XYZ; PER-SENSOR linearisation keyed on header fingerprint (Sony a7S III / Panasonic RE'd, joint fallback) fixes milky-black shadow toe \u2192 full-frame display vs Apple 13\u21923 codes (aprh) / 6\u21924 (aprn), oracle-gate 0.64%. Demosaic still bilinear (Apple adaptive; RE'd in oracle/media/prores_raw, deferred). Viewer tiers render ACEScct log (2026-07-26 \u2014 no baked Rec.709/sRGB; PRR has no vendor log curve, ACEScct is the transcode-grade log form)"},{codec:"h264",label:"H.264 / AVC",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"hevc",label:"HEVC / H.265",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"xavc",label:"Sony XAVC-Intra",full:!0,preview:!1,luma:!1,scrubPreview:!1,backend:"webcodecs",notes:"all-intra; already scrub-fast"},{codec:"h264_mxf",label:"H.264 long-GOP (MXF)",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"Camera proxies (Sony CTAPA and kin): H.264 High long-GOP in MXF OP1a. SEPARATE from 'xavc' because XAVC-Intra is all-intra and this is not \u2014 measured on a 1224-frame CTAPA proxy: IBBP, I every 12, but a true RAP (index flag 0x80) only every 48; the intervening I-frames are open-GOP (flag 0x40) and are NOT legal entry points. Decoded by LongGopPlayer: walk the GOP from its RAP, first AU 'key' and the rest 'delta', outputs taken in EMISSION order (WebCodecs owns the B-frame reorder, so the index's temporal_offset is never interpreted). Whole GOP is cached, so any scrub inside those 2s is free. Until 2026-08-10 these files were misidentified as xavc and decoded one isolated AU at a time (submit + flush), so every P/B frame hit a decoder with no reference state, only the leading IDR ever decoded, and the viewer showed frame 0 forever. Gated by oracle/i2o/e2e/mxf-longgop-playback.spec.ts against ffmpeg"},{codec:"r3d",label:"RED R3D",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE RWG/Log3G10 (2026-07-26 \u2014 IPP2 output LUT removed from decoders; display transforms are downstream)"},{codec:"arriraw",label:"ARRIRAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"EVERY STAGE BYTE-EXACT vs the ARRI SDK (2026-07-27): prep, the ADA-7 demosaic (0 of 15,690,240), the LuMaTaLu colour kernel (0 of 31,457,280 \u2014 closed by transcribing the SDK's own f32 op order: the LUT index is fmul-then-fadd not a fused mul_add, the B-spline weights are evaluated expanded with the sixth applied last, and the bicubic accumulates columns before rows), the 1:1 resample (identity) and AfaScaler+BufferScaler (0 of 43,739,136). The shipped master still omits AfaScaler's Rec.709 YCbCr detail and its Jenkins-hash grain \u2014 added looks, not native signal \u2014 so the end-to-end floor gate vs the SDK's DEFAULT output reads 0.16/255; colour is no part of that number. exact AWG4/LogC4 develop (2026-07-21, vs ARRI SDK); preview is colour via the same per-clip develop plan (tier gate corr \u22650.997). Pre-A35 12-bit ALEV-III (Mini/Mini LF) fully wired 2026-07-26: Gen2 develop to native AWG3/LogC3, SDK-gated MAE<0.8/255, probe inner_codec 'arriraw-alev3' \u2192 decode_arriraw12_mxf; other ALEV3 bodies decode flagged calib:parametric-alev3-family-unvalidated"},{codec:"dnxhr",label:"Avid DNxHR / DNxHD",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"DC-only 1/8 preview tier is COLOR (2026-08-05 \u2014 was gray luma) \u2014 playback + scrub ride it (4K/UHD DNxHR full decodes aren't scrub-fast); park upgrades to full"},{codec:"crm",label:"Canon Cinema RAW Light",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview LL tier develops through the SAME tone-exact Canon Log 2 path as Full (2026-07-26 \u2014 replaced the placeholder tone map that drifted -46/255)"},{codec:"braw",label:"Blackmagic RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"per-clip WB develop (bmdf wkel/wtin \u2192 wb_grid tables; Pocket-6K-family sweep-validated); preview is COLOUR-accurate native Gen5 log (gate corr \u22650.996 vs downsampled full). ENTROPY-PROFILE GATED PER FRAME (rust braw::PROFILES): the frame-header ladder selects one of four separately-compiled SDK decoder families AND its dequant table, and it is per-frame rate-control output \u2014 NOT a per-clip constant (the old 'compression base' model was wrong; two encodes off the same PYXIS body carry different ladders). A frame whose exact ladder we have not captured tables for is refused with calib:unsupported-entropy-profile rather than decoded on a neighbouring quantiser. Captured profiles: (0,0,0,1) C013/C060 8\xD78 byte-exact; and the 12\xD712 family (SHIPPED 2026-07-26) \u2014 (1,2,3,4) URSA 12K, plus BOTH PYXIS encodes (0,1,2,4) and (0,0,1,2), which are the same camera at the same raster with quantisers half a step apart. That family is 12\xD712 luma / 12\xD76 chroma, 2 luma + Cb + Cr per unit off one threaded bit-reader; all four walks (full, multithreaded, DC preview, colour preview) are parametric over it. GRAIN + EDGE FILTER MODELLED 2026-07-26 \u2014 the decode is now essentially the SDK's literal output: the synthesized high-frequency PRNG grain is reproduced (scatter map verified 0 mismatches over 76,896 observations across two clips), its per-frame seed turns out to be carried IN the bitstream (16 BE bytes before the first tile) and re-seeded per tile as s1 ^= broadcast16(region<<5|vtile), and the post-IDCT block-edge filter (A*b + B*(a+c) >> 4) is applied. The filter's per-block STRENGTH byte is solved too (2026-07-26): it is transmitted, not derived - each unit ends with a [ctx+0x68]-bit field on its own reader (the skip the walk used to call 'hf_bias' and discard), packing four 2-bit weight selectors per block (bits 7:6/5:4 = the horizontal cut's two 6-px column spans, 3:2/1:0 = the vertical cut's two 6-px row spans); and the four weights are master[ladder[k]] with master[i] = (16-2i, i), so the header ladder IS the deblock strength ramp and no future profile needs a capture for it. BRAW IS BYTE-EXACT (2026-07-26). Frame-gated vs the SDK's own decoded.bin, through BOTH the oracle bitstream and the real .braw container path: all four captures \u2014 C060 (8x8), URSA 12K, and both PYXIS encodes \u2014 now differ from the SDK in ZERO samples, luma and chroma alike, across 208,099,712 luma samples; the gates assert max == 0 rather than a mean bound, because a tolerance cannot tell 'clean' from 'one wrong block in 400,000'. The last drift (11,248 URSA pixels off by one, ~0.014%) was never a modelling gap: the SDK computes an Arai-Agui-Nakajima SCALED DCT \u2014 coefficients premultiplied by s[u]*s[v] = c(k)/(2*cos(k*pi/2N)), then a unit-scale radix-3 x radix-4 butterfly \u2014 so a dense basis multiply is the same function through a DIFFERENT operation graph and rounds differently in f32, which is why f32, f32+FMA and f64 all missed. Both transforms (luma 12x12 @0x6e9c8, chroma 12x6 @0x6fc68) are now the SDK's literal dataflow, machine-transcribed by oracle/media/braw/t12_transcribe.py \u2014 a symbolic byte-slot emulator of the unrolled NEON \u2014 into the generated rust/media-core/src/codecs/braw_t12_idct.rs. The 8x8 family gains the same seed fix (whole-frame grain, no captured constant) AND the same edge filter: it was never a different algorithm, only a different compiled copy (@0x6b6a4) whose ladder (0,0,0,1) resolves to three identities plus one weak tap - C060 Y 1.76 -> 0.003. Also solved by censusing where the residual sat: the SDK runs horizontal before vertical; a vertical cut is governed by the block to its LEFT; the frame's final vertical cut is not filtered (the SDK handles cuts in pairs and drops the pair whose second cut leaves the frame); and the 8x8 byte is a nibble per block (7:6 h / 5:4 v for block 0, 3:2 h / 1:0 v for block 1). Both PYXIS profiles now carry captured grain quantisers (the PARIS original's were read once its volume was remounted). Also gated: the multithreaded walk is byte-identical to single-threaded, and both preview tiers are exact block means of the full decode (corr 1.0000). Still refused: Pocket 6K C040 (2,3,4,4) = a fourth algorithm. See oracle/media/braw/ENTROPY_PROFILE_RE.md"},{codec:"xocn",label:"Sony X-OCN",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE S-Gamut3/S-Log3 (2026-07-26 \u2014 replaced the adaptive display transform); preview = LL-band-only decode (~1/8 per axis, ~90x faster), colour-consistent with Full by construction. Fitted sensors: Burano LT/8K (SBRg), Venice ST (SBRe), VENICE 2 8.6K (SBRf, 2026-07-26 \u2014 decodes via the same parametric geometry, own C0_VENICE2 matrix R\xB2\u22650.9994). X-OCN IS BYTE-EXACT ACROSS MODES (2026-07-27): LT 6K, Venice ST and Burano 8K all decode to ZERO differing samples vs libSonyRawDev's own decoder output \u2014 86,293,760 samples over the three, gated in tests/xocn_variant_gate.rs against hashes of the SDK's planes. Venice ST and 8K previously lost their top and bottom rows (28 and 12 rows; the interiors were already exact) because the band row ranges were formulas in the LL strip count n, read off the LT capture (y0=10, y1=8n-2 and friends) \u2014 those hold only when 8n == h + 12, which is an LT coincidence. The real rule (xocn::phase_chain): the standalone band carries the frame's h rows CENTRED in its 8n coded rows, and every coarser level is the even subset of the level below, so lo = a[k] and y14 = a[k] + n[k] fall out per level and reproduce LT's captured constants exactly. Settled by MEASURING the bitstream \u2014 strips are byte-aligned, so the row count of a strip is the count whose decode consumes its byte size (harness xocnstrip) \u2014 not by sweeping constants. The write-side dy row shift that used to paper over the phase is gone. SBRf/VENICE 2 decodes through the same path but is not yet re-gated byte-exact (fixture on PARIS)"}],o=new Map(n.map(r=>[r.codec,r]));function a(r){let e=(r??"").toLowerCase().trim();return e?e==="aprn"||e==="aprh"?"prores_raw":e==="prores_mxf"||e.startsWith("ap")?"prores":e==="arriraw-alev3"?"arriraw":e==="avc1"||e==="avc3"||e==="h264"?"h264":e.startsWith("hvc")||e.startsWith("hev")||e==="h265"?"hevc":e.startsWith("avd")||e==="dnxh"||e==="dnxhd"?"dnxhr":e==="redcode"?"r3d":o.has(e)?e:null:null}function s(r){let e=(r??"").toLowerCase().trim();if(!e)return null;if(e==="aprn"||e==="aprh"||a(e)==="prores_raw"||e==="ap4h"||e==="ap4x")return 12;if(e.startsWith("ap"))return 10;let t=a(e);return t==="r3d"?16:t==="arriraw"||t==="braw"?12:t==="xocn"?16:t==="crm"?12:/dnxhr.?(hqx|444)/.test(e)?10:null}function i(r,e){if(typeof e!="number")return null;let t=a(r);return t==="h264"?[66,77,88,100].includes(e)?8:e===110?10:null:t==="hevc"?e===1?8:e===2?10:null:null}export{a,s as b,i as c};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{createRequire as Xn}from"module";var $n=Xn("/"),Nr,dn=";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";try{Nr=$n("worker_threads").Worker}catch{}var jn=Nr?function(n,r,t,e,i){var a=!1,o=new Nr(n+dn,{eval:!0}).on("error",function(s){return i(s,null)}).on("message",function(s){return i(null,s)}).on("exit",function(s){s&&!a&&i(new Error("exited with code "+s),null)});return o.postMessage(t,e),o.terminate=function(){return a=!0,Nr.prototype.terminate.call(o)},o}:function(n,r,t,e,i){setImmediate(function(){return i(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)});var a=function(){};return{terminate:a,postMessage:a}},S=Uint8Array,Y=Uint16Array,Zr=Int32Array,mr=new S([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xr=new S([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ur=new S([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),An=function(n,r){for(var t=new Y(31),e=0;e<31;++e)t[e]=r+=1<<n[e-1];for(var i=new Zr(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)i[a]=a-t[e]<<5|e;return{b:t,r:i}},Mn=An(mr,2),en=Mn.b,Wr=Mn.r;en[28]=258,Wr[258]=28;var Sn=An(xr,0),Fn=Sn.b,$r=Sn.r,Ir=new Y(32768);for(I=0;I<32768;++I)tr=(I&43690)>>1|(I&21845)<<1,tr=(tr&52428)>>2|(tr&13107)<<2,tr=(tr&61680)>>4|(tr&3855)<<4,Ir[I]=((tr&65280)>>8|(tr&255)<<8)>>1;var tr,I,$=(function(n,r,t){for(var e=n.length,i=0,a=new Y(r);i<e;++i)n[i]&&++a[n[i]-1];var o=new Y(r);for(i=1;i<r;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(t){s=new Y(1<<r);var l=15-r;for(i=0;i<e;++i)if(n[i])for(var h=i<<4|n[i],f=r-n[i],u=o[n[i]-1]++<<f,v=u|(1<<f)-1;u<=v;++u)s[Ir[u]>>l]=h}else for(s=new Y(e),i=0;i<e;++i)n[i]&&(s[i]=Ir[o[n[i]-1]++]>>15-n[i]);return s}),er=new S(288);for(I=0;I<144;++I)er[I]=8;var I;for(I=144;I<256;++I)er[I]=9;var I;for(I=256;I<280;++I)er[I]=7;var I;for(I=280;I<288;++I)er[I]=8;var I,yr=new S(32);for(I=0;I<32;++I)yr[I]=5;var I,Cn=$(er,9,0),Dn=$(er,9,1),Tn=$(yr,5,0),Un=$(yr,5,1),kr=function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},X=function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},Hr=function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},zr=function(n){return(n+7)/8|0},d=function(n,r,t){return(r==null||r<0)&&(r=0),(t==null||t>n.length)&&(t=n.length),new S(n.subarray(r,t))},st={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},In=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],c=function(n,r,t){var e=new Error(r||In[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,c),!t)throw e;return e},Br=function(n,r,t,e){var i=n.length,a=e?e.length:0;if(!i||r.f&&!r.l)return t||new S(0);var o=!t,s=o||r.i!=2,l=r.i;o&&(t=new S(i*3));var h=function(Dr){var Tr=t.length;if(Dr>Tr){var cr=new S(Math.max(Tr*2,Dr));cr.set(t),t=cr}},f=r.f||0,u=r.p||0,v=r.b||0,M=r.l,m=r.d,z=r.m,p=r.n,x=i*8;do{if(!M){f=X(n,u,1);var F=X(n,u+1,3);if(u+=3,F)if(F==1)M=Dn,m=Un,z=9,p=5;else if(F==2){var B=X(n,u,31)+257,D=X(n,u+10,15)+4,w=B+X(n,u+5,31)+1;u+=14;for(var g=new S(w),C=new S(19),T=0;T<D;++T)C[Ur[T]]=X(n,u+T*3,7);u+=D*3;for(var G=kr(C),H=(1<<G)-1,q=$(C,G,1),T=0;T<w;){var P=q[X(n,u,H)];u+=P&15;var A=P>>4;if(A<16)g[T++]=A;else{var O=0,E=0;for(A==16?(E=3+X(n,u,3),u+=2,O=g[T-1]):A==17?(E=3+X(n,u,7),u+=3):A==18&&(E=11+X(n,u,127),u+=7);E--;)g[T++]=O}}var W=g.subarray(0,B),L=g.subarray(B);z=kr(W),p=kr(L),M=$(W,z,1),m=$(L,p,1)}else c(1);else{var A=zr(u)+4,y=n[A-4]|n[A-3]<<8,Z=A+y;if(Z>i){l&&c(0);break}s&&h(v+y),t.set(n.subarray(A,Z),v),r.b=v+=y,r.p=u=Z*8,r.f=f;continue}if(u>x){l&&c(0);break}}s&&h(v+131072);for(var sr=(1<<z)-1,J=(1<<p)-1,nr=u;;nr=u){var O=M[Hr(n,u)&sr],K=O>>4;if(u+=O&15,u>x){l&&c(0);break}if(O||c(2),K<256)t[v++]=K;else if(K==256){nr=u,M=null;break}else{var Q=K-254;if(K>264){var T=K-257,N=mr[T];Q=X(n,u,(1<<N)-1)+en[T],u+=N}var _=m[Hr(n,u)&J],lr=_>>4;_||c(3),u+=_&15;var L=Fn[lr];if(lr>3){var N=xr[lr];L+=Hr(n,u)&(1<<N)-1,u+=N}if(u>x){l&&c(0);break}s&&h(v+131072);var vr=v+Q;if(v<L){var Gr=a-L,Or=Math.min(L,vr);for(Gr+v<0&&c(3);v<Or;++v)t[v]=e[Gr+v]}for(;v<vr;++v)t[v]=t[v-L]}}r.l=M,r.p=nr,r.b=v,r.f=f,M&&(f=1,r.m=z,r.d=m,r.n=p)}while(!f);return v!=t.length&&o?d(t,0,v):t.subarray(0,v)},rr=function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>8},pr=function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>8,n[e+2]|=t>>16},Lr=function(n,r){for(var t=[],e=0;e<n.length;++e)n[e]&&t.push({s:e,f:n[e]});var i=t.length,a=t.slice();if(!i)return{t:ir,l:0};if(i==1){var o=new S(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(Z,B){return Z.f-B.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],h=0,f=1,u=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};f!=i-1;)s=t[t[h].f<t[u].f?h++:u++],l=t[h!=f&&t[h].f<t[u].f?h++:u++],t[f++]={s:-1,f:s.f+l.f,l:s,r:l};for(var v=a[0].s,e=1;e<i;++e)a[e].s>v&&(v=a[e].s);var M=new Y(v+1),m=Rr(t[f-1],M,0);if(m>r){var e=0,z=0,p=m-r,x=1<<p;for(a.sort(function(B,D){return M[D.s]-M[B.s]||B.f-D.f});e<i;++e){var F=a[e].s;if(M[F]>r)z+=x-(1<<m-M[F]),M[F]=r;else break}for(z>>=p;z>0;){var A=a[e].s;M[A]<r?z-=1<<r-M[A]++-1:++e}for(;e>=0&&z;--e){var y=a[e].s;M[y]==r&&(--M[y],++z)}m=r}return{t:new S(M),l:m}},Rr=function(n,r,t){return n.s==-1?Math.max(Rr(n.l,r,t+1),Rr(n.r,r,t+1)):r[n.s]=t},dr=function(n){for(var r=n.length;r&&!n[--r];);for(var t=new Y(++r),e=0,i=n[0],a=1,o=function(l){t[e++]=l},s=1;s<=r;++s)if(n[s]==i&&s!=r)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=n[s]}return{c:t.subarray(0,e),n:r}},gr=function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},an=function(n,r,t){var e=t.length,i=zr(r+2);n[i]=e&255,n[i+1]=e>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var a=0;a<e;++a)n[i+a+4]=t[a];return(i+4+e)*8},jr=function(n,r,t,e,i,a,o,s,l,h,f){rr(r,f++,t),++i[256];for(var u=Lr(i,15),v=u.t,M=u.l,m=Lr(a,15),z=m.t,p=m.l,x=dr(v),F=x.c,A=x.n,y=dr(z),Z=y.c,B=y.n,D=new Y(19),w=0;w<F.length;++w)++D[F[w]&31];for(var w=0;w<Z.length;++w)++D[Z[w]&31];for(var g=Lr(D,7),C=g.t,T=g.l,G=19;G>4&&!C[Ur[G-1]];--G);var H=h+5<<3,q=gr(i,er)+gr(a,yr)+o,P=gr(i,v)+gr(a,z)+o+14+3*G+gr(D,C)+2*D[16]+3*D[17]+7*D[18];if(l>=0&&H<=q&&H<=P)return an(r,f,n.subarray(l,l+h));var O,E,W,L;if(rr(r,f,1+(P<q)),f+=2,P<q){O=$(v,M,0),E=v,W=$(z,p,0),L=z;var sr=$(C,T,0);rr(r,f,A-257),rr(r,f+5,B-1),rr(r,f+10,G-4),f+=14;for(var w=0;w<G;++w)rr(r,f+3*w,C[Ur[w]]);f+=3*G;for(var J=[F,Z],nr=0;nr<2;++nr)for(var K=J[nr],w=0;w<K.length;++w){var Q=K[w]&31;rr(r,f,sr[Q]),f+=C[Q],Q>15&&(rr(r,f,K[w]>>5&127),f+=K[w]>>12)}}else O=Cn,E=er,W=Tn,L=yr;for(var w=0;w<s;++w){var N=e[w];if(N>255){var Q=N>>18&31;pr(r,f,O[Q+257]),f+=E[Q+257],Q>7&&(rr(r,f,N>>23&31),f+=mr[Q]);var _=N&31;pr(r,f,W[_]),f+=L[_],_>3&&(pr(r,f,N>>5&8191),f+=xr[_])}else pr(r,f,O[N]),f+=E[N]}return pr(r,f,O[256]),f+E[256]},Zn=new Zr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ir=new S(0),Bn=function(n,r,t,e,i,a){var o=a.z||n.length,s=new S(e+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(e,s.length-i),h=a.l,f=(a.r||0)&7;if(r){f&&(l[0]=a.r>>3);for(var u=Zn[r-1],v=u>>13,M=u&8191,m=(1<<t)-1,z=a.p||new Y(32768),p=a.h||new Y(m+1),x=Math.ceil(t/3),F=2*x,A=function(Vr){return(n[Vr]^n[Vr+1]<<x^n[Vr+2]<<F)&m},y=new Zr(25e3),Z=new Y(288),B=new Y(32),D=0,w=0,g=a.i||0,C=0,T=a.w||0,G=0;g+2<o;++g){var H=A(g),q=g&32767,P=p[H];if(z[q]=P,p[H]=q,T<=g){var O=o-g;if((D>7e3||C>24576)&&(O>423||!h)){f=jr(n,l,0,y,Z,B,w,C,G,g-G,f),C=D=w=0,G=g;for(var E=0;E<286;++E)Z[E]=0;for(var E=0;E<30;++E)B[E]=0}var W=2,L=0,sr=M,J=q-P&32767;if(O>2&&H==A(g-J))for(var nr=Math.min(v,O)-1,K=Math.min(32767,g),Q=Math.min(258,O);J<=K&&--sr&&q!=P;){if(n[g+W]==n[g+W-J]){for(var N=0;N<Q&&n[g+N]==n[g+N-J];++N);if(N>W){if(W=N,L=J,N>nr)break;for(var _=Math.min(J,N-2),lr=0,E=0;E<_;++E){var vr=g-J+E&32767,Gr=z[vr],Or=vr-Gr&32767;Or>lr&&(lr=Or,P=vr)}}}q=P,P=z[q],J+=q-P&32767}if(L){y[C++]=268435456|Wr[W]<<18|$r[L];var Dr=Wr[W]&31,Tr=$r[L]&31;w+=mr[Dr]+xr[Tr],++Z[257+Dr],++B[Tr],T=g+W,++D}else y[C++]=n[g],++Z[n[g]]}}for(g=Math.max(g,T);g<o;++g)y[C++]=n[g],++Z[n[g]];f=jr(n,l,h,y,Z,B,w,C,G,g-G,f),h||(a.r=f&7|l[f/8|0]<<3,f-=7,a.h=p,a.p=z,a.i=g,a.w=T)}else{for(var g=a.w||0;g<o+h;g+=65535){var cr=g+65535;cr>=o&&(l[f/8|0]=h,cr=o),f=an(l,f+1,n.subarray(g,cr))}a.i=o}return d(s,0,e+zr(f)+i)},En=(function(){for(var n=new Int32Array(256),r=0;r<256;++r){for(var t=r,e=9;--e;)t=(t&1&&-306674912)^t>>>1;n[r]=t}return n})(),Ar=function(){var n=-1;return{p:function(r){for(var t=n,e=0;e<r.length;++e)t=En[t&255^r[e]]^t>>>8;n=t},d:function(){return~n}}},Kr=function(){var n=1,r=0;return{p:function(t){for(var e=n,i=r,a=t.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=e+=t[o];e=(e&65535)+15*(e>>16),i=(i&65535)+15*(i>>16)}n=e,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|(n&65280)<<8|(r&255)<<8|r>>8}}},hr=function(n,r,t,e,i){if(!i&&(i={l:1},r.dictionary)){var a=r.dictionary.subarray(-32768),o=new S(a.length+n.length);o.set(a),o.set(n,a.length),n=o,i.w=a.length}return Bn(n,r.level==null?6:r.level,r.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+r.mem,t,e,i)},Er=function(n,r){var t={};for(var e in n)t[e]=n[e];for(var e in r)t[e]=r[e];return t},pn=function(n,r,t){for(var e=n(),i=n.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<e.length;++o){var s=e[o],l=a[o];if(typeof s=="function"){r+=";"+l+"=";var h=s.toString();if(s.prototype)if(h.indexOf("[native code]")!=-1){var f=h.indexOf(" ",8)+1;r+=h.slice(f,h.indexOf("(",f))}else{r+=h;for(var u in s.prototype)r+=";"+l+".prototype."+u+"="+s.prototype[u].toString()}else r+=h}else t[l]=s}return r},Pr=[],bn=function(n){var r=[];for(var t in n)n[t].buffer&&r.push((n[t]=new n[t].constructor(n[t])).buffer);return r},qn=function(n,r,t,e){if(!Pr[t]){for(var i="",a={},o=n.length-1,s=0;s<o;++s)i=pn(n[s],i,a);Pr[t]={c:pn(n[o],i,a),e:a}}var l=Er({},Pr[t].e);return jn(Pr[t].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,l,bn(l),e)},Mr=function(){return[S,Y,Zr,mr,xr,Ur,en,Fn,Dn,Un,Ir,In,$,kr,X,Hr,zr,d,c,Br,qr,or,on]},Sr=function(){return[S,Y,Zr,mr,xr,Ur,Wr,$r,Cn,er,Tn,yr,Ir,Zn,ir,$,rr,pr,Lr,Rr,dr,gr,an,jr,zr,d,Bn,hr,Qr,or]},Gn=function(){return[sn,hn,U,Ar,En]},On=function(){return[fn,kn]},Pn=function(){return[un,U,Kr]},Nn=function(){return[ln]},or=function(n){return postMessage(n,[n.buffer])},on=function(n){return n&&{out:n.size&&new S(n.size),dictionary:n.dictionary}},Fr=function(n,r,t,e,i,a){var o=qn(t,e,i,function(s,l){o.terminate(),a(s,l)});return o.postMessage([n,r],r.consume?[n.buffer]:[]),function(){o.terminate()}},j=function(n){return n.ondata=function(r,t){return postMessage([r,t],[r.buffer])},function(r){r.data.length?(n.push(r.data[0],r.data[1]),postMessage([r.data[0].length])):n.flush()}},Cr=function(n,r,t,e,i,a,o){var s,l=qn(n,e,i,function(h,f){h?(l.terminate(),r.ondata.call(r,h)):Array.isArray(f)?f.length==1?(r.queuedSize-=f[0],r.ondrain&&r.ondrain(f[0])):(f[1]&&l.terminate(),r.ondata.call(r,h,f[0],f[1])):o(f)});l.postMessage(t),r.queuedSize=0,r.push=function(h,f){r.ondata||c(5),s&&r.ondata(c(4,0,1),null,!!f),r.queuedSize+=h.length,l.postMessage([h,s=f],[h.buffer])},r.terminate=function(){l.terminate()},a&&(r.flush=function(){l.postMessage([])})},R=function(n,r){return n[r]|n[r+1]<<8},k=function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},Xr=function(n,r){return k(n,r)+k(n,r+4)*4294967296},U=function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},sn=function(n,r){var t=r.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=r.level<2?4:r.level==9?2:0,n[9]=3,r.mtime!=0&&U(n,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),t){n[3]=8;for(var e=0;e<=t.length;++e)n[e+10]=t.charCodeAt(e)}},fn=function(n){(n[0]!=31||n[1]!=139||n[2]!=8)&&c(6,"invalid gzip data");var r=n[3],t=10;r&4&&(t+=(n[10]|n[11]<<8)+2);for(var e=(r>>3&1)+(r>>4&1);e>0;e-=!n[t++]);return t+(r&2)},kn=function(n){var r=n.length;return(n[r-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0},hn=function(n){return 10+(n.filename?n.filename.length+1:0)},un=function(n,r){var t=r.level,e=t==0?0:t<6?1:t==9?3:2;if(n[0]=120,n[1]=e<<6|(r.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,r.dictionary){var i=Kr();i.p(r.dictionary),U(n,2,i.d())}},ln=function(n,r){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&c(6,"invalid zlib data"),(n[1]>>5&1)==+!r&&c(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function ur(n,r){return typeof n=="function"&&(r=n,n={}),this.ondata=r,n}var b=(function(){function n(r,t){if(typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new S(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(r,t){this.ondata(hr(r,this.o,0,0,this.s),t)},n.prototype.push=function(r,t){this.ondata||c(5),this.s.l&&c(4);var e=r.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new S(e&-32768);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;this.b.set(r.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(r.subarray(a),32768),this.s.z=r.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(r,this.s.z),this.s.z+=r.length;this.s.l=t&1,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||c(5),this.s.l&&c(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n})();var _n=(function(){function n(r,t){Cr([Sr,function(){return[j,b]}],this,ur.call(this,r,t),function(e){var i=new b(e.data);onmessage=j(i)},6,1)}return n})();function rt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Sr],function(e){return or(Qr(e.data[0],e.data[1]))},0,t)}function Qr(n,r){return hr(n,r||{},0,0)}var V=(function(){function n(r,t){typeof r=="function"&&(t=r,r={}),this.ondata=t;var e=r&&r.dictionary&&r.dictionary.subarray(-32768);this.s={i:0,b:e?e.length:0},this.o=new S(32768),this.p=new S(0),e&&this.o.set(e)}return n.prototype.e=function(r){if(this.ondata||c(5),this.d&&c(4),!this.p.length)this.p=r;else if(r.length){var t=new S(this.p.length+r.length);t.set(this.p),t.set(r,this.p.length),this.p=t}},n.prototype.c=function(r){this.s.i=+(this.d=r||!1);var t=this.s.b,e=Br(this.p,this.s,this.o);this.ondata(d(e,t,this.s.b),this.d),this.o=d(e,this.s.b-32768),this.s.b=this.o.length,this.p=d(this.p,this.s.p/8|0),this.s.p&=7},n.prototype.push=function(r,t){this.e(r),this.c(t)},n})();var Hn=(function(){function n(r,t){Cr([Mr,function(){return[j,V]}],this,ur.call(this,r,t),function(e){var i=new V(e.data);onmessage=j(i)},7,0)}return n})();function Ln(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Mr],function(e){return or(qr(e.data[0],on(e.data[1])))},1,t)}function qr(n,r){return Br(n,{i:2},r&&r.out,r&&r.dictionary)}var gn=(function(){function n(r,t){this.c=Ar(),this.l=0,this.v=1,b.call(this,r,t)}return n.prototype.push=function(r,t){this.c.p(r),this.l+=r.length,b.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){var e=hr(r,this.o,this.v&&hn(this.o),t&&8,this.s);this.v&&(sn(e,this.o),this.v=0),t&&(U(e,e.length-8,this.c.d()),U(e,e.length-4,this.l)),this.ondata(e,t)},n.prototype.flush=function(){b.prototype.flush.call(this)},n})();var ft=(function(){function n(r,t){Cr([Sr,Gn,function(){return[j,b,gn]}],this,ur.call(this,r,t),function(e){var i=new gn(e.data);onmessage=j(i)},8,1)}return n})();function ht(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Sr,Gn,function(){return[yn]}],function(e){return or(yn(e.data[0],e.data[1]))},2,t)}function yn(n,r){r||(r={});var t=Ar(),e=n.length;t.p(n);var i=hr(n,r,hn(r),8),a=i.length;return sn(i,r),U(i,a-8,t.d()),U(i,a-4,e),i}var br=(function(){function n(r,t){this.v=1,this.r=0,V.call(this,r,t)}return n.prototype.push=function(r,t){if(V.prototype.e.call(this,r),this.r+=r.length,this.v){var e=this.p.subarray(this.v-1),i=e.length>3?fn(e):4;if(i>e.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-e.length);this.p=e.subarray(i),this.v=0}V.prototype.c.call(this,t),this.s.f&&!this.s.l&&!t&&(this.v=zr(this.s.p)+9,this.s={i:0},this.o=new S(0),this.push(new S(0),t))},n})();var nt=(function(){function n(r,t){var e=this;Cr([Mr,On,function(){return[j,V,br]}],this,ur.call(this,r,t),function(i){var a=new br(i.data);a.onmember=function(o){return postMessage(o)},onmessage=j(a)},9,0,function(i){return e.onmember&&e.onmember(i)})}return n})();function tt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Mr,On,function(){return[_r]}],function(e){return or(_r(e.data[0],e.data[1]))},3,t)}function _r(n,r){var t=fn(n);return t+8>n.length&&c(6,"invalid gzip data"),Br(n.subarray(t,-8),{i:2},r&&r.out||new S(kn(n)),r&&r.dictionary)}var wn=(function(){function n(r,t){this.c=Kr(),this.v=1,b.call(this,r,t)}return n.prototype.push=function(r,t){this.c.p(r),b.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){var e=hr(r,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(un(e,this.o),this.v=0),t&&U(e,e.length-4,this.c.d()),this.ondata(e,t)},n.prototype.flush=function(){b.prototype.flush.call(this)},n})();var ut=(function(){function n(r,t){Cr([Sr,Pn,function(){return[j,b,wn]}],this,ur.call(this,r,t),function(e){var i=new wn(e.data);onmessage=j(i)},10,1)}return n})();function lt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Sr,Pn,function(){return[mn]}],function(e){return or(mn(e.data[0],e.data[1]))},4,t)}function mn(n,r){r||(r={});var t=Kr();t.p(n);var e=hr(n,r,r.dictionary?6:2,4);return un(e,r),U(e,e.length-4,t.d()),e}var rn=(function(){function n(r,t){V.call(this,r,t),this.v=r&&r.dictionary?2:1}return n.prototype.push=function(r,t){if(V.prototype.e.call(this,r),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(ln(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&c(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),V.prototype.c.call(this,t)},n})();var et=(function(){function n(r,t){Cr([Mr,Nn,function(){return[j,V,rn]}],this,ur.call(this,r,t),function(e){var i=new rn(e.data);onmessage=j(i)},11,0)}return n})();function it(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),Fr(n,r,[Mr,Nn,function(){return[nn]}],function(e){return or(nn(e.data[0],on(e.data[1])))},5,t)}function nn(n,r){return Br(n.subarray(ln(n,r&&r.dictionary),-4),{i:2},r&&r.out,r&&r.dictionary)}var xn=(function(){function n(r,t){this.o=ur.call(this,r,t)||{},this.G=br,this.I=V,this.Z=rn}return n.prototype.i=function(){var r=this;this.s.ondata=function(t,e){r.ondata(t,e)}},n.prototype.push=function(r,t){if(this.ondata||c(5),this.s)this.s.push(r,t);else{if(this.p&&this.p.length){var e=new S(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length)}else this.p=r;this.p.length>2&&(this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},n})();var vt=(function(){function n(r,t){xn.call(this,r,t),this.queuedSize=0,this.G=nt,this.I=Hn,this.Z=et}return n.prototype.i=function(){var r=this;this.s.ondata=function(t,e,i){r.ondata(t,e,i)},this.s.ondrain=function(t){r.queuedSize-=t,r.ondrain&&r.ondrain(t)}},n.prototype.push=function(r,t){this.queuedSize+=r.length,xn.prototype.push.call(this,r,t)},n})();function ct(n,r,t){return t||(t=r,r={}),typeof t!="function"&&c(7),n[0]==31&&n[1]==139&&n[2]==8?tt(n,r,t):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Ln(n,r,t):it(n,r,t)}function pt(n,r){return n[0]==31&&n[1]==139&&n[2]==8?_r(n,r):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?qr(n,r):nn(n,r)}var vn=function(n,r,t,e){for(var i in n){var a=n[i],o=r+i,s=e;Array.isArray(a)&&(s=Er(e,a[1]),a=a[0]),a instanceof S?t[o]=[a,s]:(t[o+="/"]=[new S(0),s],vn(a,o,t,e))}},zn=typeof TextEncoder<"u"&&new TextEncoder,tn=typeof TextDecoder<"u"&&new TextDecoder,Wn=0;try{tn.decode(ir,{stream:!0}),Wn=1}catch{}var Rn=function(n){for(var r="",t=0;;){var e=n[t++],i=(e>127)+(e>223)+(e>239);if(t+i>n.length)return{s:r,r:d(n,t-1)};i?i==3?(e=((e&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,r+=String.fromCharCode(55296|e>>10,56320|e&1023)):i&1?r+=String.fromCharCode((e&31)<<6|n[t++]&63):r+=String.fromCharCode((e&15)<<12|(n[t++]&63)<<6|n[t++]&63):r+=String.fromCharCode(e)}},gt=(function(){function n(r){this.ondata=r,Wn?this.t=new TextDecoder:this.p=ir}return n.prototype.push=function(r,t){if(this.ondata||c(5),t=!!t,this.t){this.ondata(this.t.decode(r,{stream:!0}),t),t&&(this.t.decode().length&&c(8),this.t=null);return}this.p||c(4);var e=new S(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length);var i=Rn(e),a=i.s,o=i.r;t?(o.length&&c(8),this.p=null):this.p=o,this.ondata(a,t)},n})();var yt=(function(){function n(r){this.ondata=r}return n.prototype.push=function(r,t){this.ondata||c(5),this.d&&c(4),this.ondata(fr(r),this.d=t||!1)},n})();function fr(n,r){if(r){for(var t=new S(n.length),e=0;e<n.length;++e)t[e]=n.charCodeAt(e);return t}if(zn)return zn.encode(n);for(var i=n.length,a=new S(n.length+(n.length>>1)),o=0,s=function(f){a[o++]=f},e=0;e<i;++e){if(o+5>a.length){var l=new S(o+8+(i-e<<1));l.set(a),a=l}var h=n.charCodeAt(e);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|n.charCodeAt(++e)&1023,s(240|h>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|h&63)):(s(224|h>>12),s(128|h>>6&63),s(128|h&63))}return d(a,0,o)}function Yn(n,r){if(r){for(var t="",e=0;e<n.length;e+=16384)t+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return t}else{if(tn)return tn.decode(n);var i=Rn(n),a=i.s,t=i.r;return t.length&&c(8),a}}var Jn=function(n){return n==1?3:n<6?2:n==9?1:0},Kn=function(n,r){return r+30+R(n,r+26)+R(n,r+28)},Qn=function(n,r,t){var e=R(n,r+28),i=Yn(n.subarray(r+46,r+46+e),!(R(n,r+8)&2048)),a=r+46+e,o=k(n,r+20),s=t&&o==4294967295?Vn(n,a):[o,k(n,r+24),k(n,r+42)],l=s[0],h=s[1],f=s[2];return[R(n,r+10),l,h,i,a+R(n,r+30)+R(n,r+32),f]},Vn=function(n,r){for(;R(n,r)!=1;r+=4+R(n,r+2));return[Xr(n,r+12),Xr(n,r+4),Xr(n,r+20)]},ar=function(n){var r=0;if(n)for(var t in n){var e=n[t].length;e>65535&&c(9),r+=e+4}return r},wr=function(n,r,t,e,i,a,o,s){var l=e.length,h=t.extra,f=s&&s.length,u=ar(h);U(n,r,o!=null?33639248:67324752),r+=4,o!=null&&(n[r++]=20,n[r++]=t.os),n[r]=20,r+=2,n[r++]=t.flag<<1|(a<0&&8),n[r++]=i&&8,n[r++]=t.compression&255,n[r++]=t.compression>>8;var v=new Date(t.mtime==null?Date.now():t.mtime),M=v.getFullYear()-1980;if((M<0||M>119)&&c(10),U(n,r,M<<25|v.getMonth()+1<<21|v.getDate()<<16|v.getHours()<<11|v.getMinutes()<<5|v.getSeconds()>>1),r+=4,a!=-1&&(U(n,r,t.crc),U(n,r+4,a<0?-a-2:a),U(n,r+8,t.size)),U(n,r+12,l),U(n,r+14,u),r+=16,o!=null&&(U(n,r,f),U(n,r+6,t.attrs),U(n,r+10,o),r+=14),n.set(e,r),r+=l,u)for(var m in h){var z=h[m],p=z.length;U(n,r,+m),U(n,r+2,p),n.set(z,r+4),r+=4+p}return f&&(n.set(s,r),r+=f),r},cn=function(n,r,t,e,i){U(n,r,101010256),U(n,r+8,t),U(n,r+10,t),U(n,r+12,e),U(n,r+16,i)},Yr=(function(){function n(r){this.filename=r,this.c=Ar(),this.size=0,this.compression=0}return n.prototype.process=function(r,t){this.ondata(null,r,t)},n.prototype.push=function(r,t){this.ondata||c(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},n})();var wt=(function(){function n(r,t){var e=this;t||(t={}),Yr.call(this,r),this.d=new b(t,function(i,a){e.ondata(null,i,a)}),this.compression=8,this.flag=Jn(t.level)}return n.prototype.process=function(r,t){try{this.d.push(r,t)}catch(e){this.ondata(e,null,t)}},n.prototype.push=function(r,t){Yr.prototype.push.call(this,r,t)},n})();var mt=(function(){function n(r,t){var e=this;t||(t={}),Yr.call(this,r),this.d=new _n(t,function(i,a,o){e.ondata(i,a,o)}),this.compression=8,this.flag=Jn(t.level),this.terminate=this.d.terminate}return n.prototype.process=function(r,t){this.d.push(r,t)},n.prototype.push=function(r,t){Yr.prototype.push.call(this,r,t)},n})();var xt=(function(){function n(r){this.ondata=r,this.u=[],this.d=1}return n.prototype.add=function(r){var t=this;if(this.ondata||c(5),this.d&2)this.ondata(c(4+(this.d&1)*8,0,1),null,!1);else{var e=fr(r.filename),i=e.length,a=r.comment,o=a&&fr(a),s=i!=r.filename.length||o&&a.length!=o.length,l=i+ar(r.extra)+30;i>65535&&this.ondata(c(11,0,1),null,!1);var h=new S(l);wr(h,0,r,e,s,-1);var f=[h],u=function(){for(var p=0,x=f;p<x.length;p++){var F=x[p];t.ondata(null,F,!1)}f=[]},v=this.d;this.d=0;var M=this.u.length,m=Er(r,{f:e,u:s,o,t:function(){r.terminate&&r.terminate()},r:function(){if(u(),v){var p=t.u[M+1];p?p.r():t.d=1}v=1}}),z=0;r.ondata=function(p,x,F){if(p)t.ondata(p,x,F),t.terminate();else if(z+=x.length,f.push(x),F){var A=new S(16);U(A,0,134695760),U(A,4,r.crc),U(A,8,z),U(A,12,r.size),f.push(A),m.c=z,m.b=l+z+16,m.crc=r.crc,m.size=r.size,v&&m.r(),v=1}else v&&u()},this.u.push(m)}},n.prototype.end=function(){var r=this;if(this.d&2){this.ondata(c(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},n.prototype.e=function(){for(var r=0,t=0,e=0,i=0,a=this.u;i<a.length;i++){var o=a[i];e+=46+o.f.length+ar(o.extra)+(o.o?o.o.length:0)}for(var s=new S(e+22),l=0,h=this.u;l<h.length;l++){var o=h[l];wr(s,r,o,o.f,o.u,-o.c-2,t,o.o),r+=46+o.f.length+ar(o.extra)+(o.o?o.o.length:0),t+=o.b}cn(s,r,this.u.length,e,t),this.ondata(null,s,!0),this.d=2},n.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var e=t[r];e.t()}this.d=2},n})();function zt(n,r,t){t||(t=r,r={}),typeof t!="function"&&c(7);var e={};vn(n,"",e,r);var i=Object.keys(e),a=i.length,o=0,s=0,l=a,h=new Array(a),f=[],u=function(){for(var p=0;p<f.length;++p)f[p]()},v=function(p,x){Jr(function(){t(p,x)})};Jr(function(){v=t});var M=function(){var p=new S(s+22),x=o,F=s-o;s=0;for(var A=0;A<l;++A){var y=h[A];try{var Z=y.c.length;wr(p,s,y,y.f,y.u,Z);var B=30+y.f.length+ar(y.extra),D=s+B;p.set(y.c,D),wr(p,o,y,y.f,y.u,Z,s,y.m),o+=16+B+(y.m?y.m.length:0),s=D+Z}catch(w){return v(w,null)}}cn(p,o,h.length,F,x),v(null,p)};a||M();for(var m=function(p){var x=i[p],F=e[x],A=F[0],y=F[1],Z=Ar(),B=A.length;Z.p(A);var D=fr(x),w=D.length,g=y.comment,C=g&&fr(g),T=C&&C.length,G=ar(y.extra),H=y.level==0?0:8,q=function(P,O){if(P)u(),v(P,null);else{var E=O.length;h[p]=Er(y,{size:B,crc:Z.d(),c:O,f:D,m:C,u:w!=x.length||C&&g.length!=T,compression:H}),o+=30+w+G+E,s+=76+2*(w+G)+(T||0)+E,--a||M()}};if(w>65535&&q(c(11,0,1),null),!H)q(null,A);else if(B<16e4)try{q(null,Qr(A,y))}catch(P){q(P,null)}else f.push(rt(A,y,q))},z=0;z<l;++z)m(z);return u}function At(n,r){r||(r={});var t={},e=[];vn(n,"",t,r);var i=0,a=0;for(var o in t){var s=t[o],l=s[0],h=s[1],f=h.level==0?0:8,u=fr(o),v=u.length,M=h.comment,m=M&&fr(M),z=m&&m.length,p=ar(h.extra);v>65535&&c(11);var x=f?Qr(l,h):l,F=x.length,A=Ar();A.p(l),e.push(Er(h,{size:l.length,crc:A.d(),c:x,f:u,m,u:v!=o.length||m&&M.length!=z,o:i,compression:f})),i+=30+v+p+F,a+=76+2*(v+p)+(z||0)+F}for(var y=new S(a+22),Z=i,B=a-i,D=0;D<e.length;++D){var u=e[D];wr(y,u.o,u,u.f,u.u,u.c.length);var w=30+u.f.length+ar(u.extra);y.set(u.c,u.o+w),wr(y,i,u,u.f,u.u,u.c.length,u.o,u.m),i+=16+w+(u.m?u.m.length:0)}return cn(y,i,e.length,B,Z),y}var at=(function(){function n(){}return n.prototype.push=function(r,t){this.ondata(null,r,t)},n.compression=0,n})();var Mt=(function(){function n(){var r=this;this.i=new V(function(t,e){r.ondata(null,t,e)})}return n.prototype.push=function(r,t){try{this.i.push(r,t)}catch(e){this.ondata(e,null,t)}},n.compression=8,n})();var St=(function(){function n(r,t){var e=this;t<32e4?this.i=new V(function(i,a){e.ondata(null,i,a)}):(this.i=new Hn(function(i,a,o){e.ondata(i,a,o)}),this.terminate=this.i.terminate)}return n.prototype.push=function(r,t){this.i.terminate&&(r=d(r,0)),this.i.push(r,t)},n.compression=8,n})();var Ft=(function(){function n(r){this.onfile=r,this.k=[],this.o={0:at},this.p=ir}return n.prototype.push=function(r,t){var e=this;if(this.onfile||c(5),this.p||c(4),this.c>0){var i=Math.min(this.c,r.length),a=r.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),r=r.subarray(i),r.length)return this.push(r,t)}else{var o=0,s=0,l=void 0,h=void 0;this.p.length?r.length?(h=new S(this.p.length+r.length),h.set(this.p),h.set(r,this.p.length)):h=this.p:h=r;for(var f=h.length,u=this.c,v=u&&this.d,M=function(){var x,F=k(h,s);if(F==67324752){o=1,l=s,m.d=null,m.c=0;var A=R(h,s+6),y=R(h,s+8),Z=A&2048,B=A&8,D=R(h,s+26),w=R(h,s+28);if(f>s+30+D+w){var g=[];m.k.unshift(g),o=2;var C=k(h,s+18),T=k(h,s+22),G=Yn(h.subarray(s+30,s+=30+D),!Z);C==4294967295?(x=B?[-2]:Vn(h,s),C=x[0],T=x[1]):B&&(C=-1),s+=w,m.c=C;var H,q={name:G,compression:y,start:function(){if(q.ondata||c(5),!C)q.ondata(null,ir,!0);else{var P=e.o[y];P||q.ondata(c(14,"unknown compression type "+y,1),null,!1),H=C<0?new P(G):new P(G,C,T),H.ondata=function(L,sr,J){q.ondata(L,sr,J)};for(var O=0,E=g;O<E.length;O++){var W=E[O];H.push(W,!1)}e.k[0]==g&&e.c?e.d=H:H.push(ir,!0)}},terminate:function(){H&&H.terminate&&H.terminate()}};C>=0&&(q.size=C,q.originalSize=T),m.onfile(q)}return"break"}else if(u){if(F==134695760)return l=s+=12+(u==-2&&8),o=3,m.c=0,"break";if(F==33639248)return l=s-=4,o=3,m.c=0,"break"}},m=this;s<f-4;++s){var z=M();if(z==="break")break}if(this.p=ir,u<0){var p=o?h.subarray(0,l-12-(u==-2&&8)-(k(h,l-16)==134695760&&4)):h.subarray(0,s);v?v.push(p,!!o):this.k[+(o==2)].push(p)}if(o&2)return this.push(h.subarray(s),t);this.p=h.subarray(s)}t&&(this.c&&c(13),this.p=null)},n.prototype.register=function(r){this.o[r.compression]=r},n})();var Jr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(n){n()};function Ct(n,r,t){t||(t=r,r={}),typeof t!="function"&&c(7);var e=[],i=function(){for(var p=0;p<e.length;++p)e[p]()},a={},o=function(p,x){Jr(function(){t(p,x)})};Jr(function(){o=t});for(var s=n.length-22;k(n,s)!=101010256;--s)if(!s||n.length-s>65558)return o(c(13,0,1),null),i;var l=R(n,s+8);if(l){var h=l,f=k(n,s+16),u=f==4294967295||h==65535;if(u){var v=k(n,s-12);u=k(n,v)==101075792,u&&(h=l=k(n,v+32),f=k(n,v+48))}for(var M=r&&r.filter,m=function(p){var x=Qn(n,f,u),F=x[0],A=x[1],y=x[2],Z=x[3],B=x[4],D=x[5],w=Kn(n,D);f=B;var g=function(T,G){T?(i(),o(T,null)):(G&&(a[Z]=G),--l||o(null,a))};if(!M||M({name:Z,size:A,originalSize:y,compression:F}))if(!F)g(null,d(n,w,w+A));else if(F==8){var C=n.subarray(w,w+A);if(y<524288||A>.8*y)try{g(null,qr(C,{out:new S(y)}))}catch(T){g(T,null)}else e.push(Ln(C,{size:y},g))}else g(c(14,"unknown compression type "+F,1),null);else g(null,null)},z=0;z<h;++z)m(z)}else o(null,{});return i}function Dt(n,r){for(var t={},e=n.length-22;k(n,e)!=101010256;--e)(!e||n.length-e>65558)&&c(13);var i=R(n,e+8);if(!i)return{};var a=k(n,e+16),o=a==4294967295||i==65535;if(o){var s=k(n,e-12);o=k(n,s)==101075792,o&&(i=k(n,s+32),a=k(n,s+48))}for(var l=r&&r.filter,h=0;h<i;++h){var f=Qn(n,a,o),u=f[0],v=f[1],M=f[2],m=f[3],z=f[4],p=f[5],x=Kn(n,p);a=z,(!l||l({name:m,size:v,originalSize:M,compression:u}))&&(u?u==8?t[m]=qr(n.subarray(x,x+v),{out:new S(M)}):c(14,"unknown compression type "+u):t[m]=d(n,x,x+v))}return t}export{st as a,b,_n as c,rt as d,Qr as e,V as f,Hn as g,Ln as h,qr as i,gn as j,ft as k,ht as l,yn as m,br as n,nt as o,tt as p,_r as q,wn as r,ut as s,lt as t,mn as u,rn as v,et as w,it as x,nn as y,xn as z,vt as A,ct as B,pt as C,gt as D,yt as E,fr as F,Yn as G,Yr as H,wt as I,mt as J,xt as K,zt as L,At as M,at as N,Mt as O,St as P,Ft as Q,Ct as R,Dt as S};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
function a(e){if(e.length<8)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint32(0,!0),r=t.getUint32(4,!0),u=n*r*4;return e.length<8+u?null:{width:n,height:r,rgba:new Uint8ClampedArray(e.subarray(8,8+u))}}function i(e,t){let n=e[t];return typeof n=="function"?n:void 0}export{a,i as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var a="",o={wasm:{}},e=class{static create(){throw new Error("onnxruntime-web is not available under Deno; use embedSquaresNode")}},r=class{};export{a,o as b,e as c,r as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
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};
|
|
@@ -0,0 +1,7 @@
|
|
|
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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
function f(a){let s=[...a].sort((e,r)=>e.first_frame-r.first_frame),t=[];for(let e of s){let r=t[t.length-1];r&&e.first_frame<=r.last_frame+1?r.last_frame=Math.max(r.last_frame,e.last_frame):t.push({...e})}return t}export{f as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{b as i}from"./chunk-UCMNH6Q6.js";function m(r){return{filename:r.name,fileSize:r.size,async read(e,t){let n=Math.min(e+t,r.size),a;for(let o=0;o<4;o++)try{return new Uint8Array(await r.slice(e,n).arrayBuffer())}catch(s){a=s,await new Promise(l=>setTimeout(l,25*(o+1)))}throw a}}}function f(r,e){return{filename:r,fileSize:e.fileSize,read:(t,n)=>e.read(t,n)}}function u(r){return i(r)?.flavor??null}function d(r){let e=u(r.name);if(!e)throw new Error(`sourceFromFile: unrecognized media format for '${r.name}'`);return{parts:[m(r)],format:e}}function F(r){if(r.length===0)throw new Error("sourceFromFiles: no parts");let e=u(r[0].name);if(!e)throw new Error(`sourceFromFiles: unrecognized media format for '${r[0].name}'`);return{parts:r.map(m),format:e}}function p(r,e){if(e.length===0)throw new Error("sourceFromParts: no parts");return{parts:e,format:r}}export{m as a,f as b,u as c,d,F as e,p as f};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},e=(a,b,c,g)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(g=i(b,d))||g.enumerable});return a},q=(a,b,c)=>(e(a,b,"default"),c&&e(c,b,"default")),r=(a,b,c)=>(c=a!=null?h(k(a)):{},e(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),s=a=>e(f({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f,s as g};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var B=(t,n)=>String.fromCharCode(t[n],t[n+1],t[n+2],t[n+3]),I=t=>t.toString(16).padStart(2,"0");function m(t,n,c,a){let o=new DataView(t.buffer,t.byteOffset,t.byteLength),e=n;for(;e+8<=c;){let s=o.getUint32(e),u=8;if(s===1?(s=Number(o.getBigUint64(e+8)),u=16):s===0&&(s=c-e),B(t,e+4)===a)return[e+u,e+s];if(s<u)break;e+=s}return null}function T(t,n,c,a){let o=[n,c];for(let e of a){if(!o)return null;o=m(t,o[0],o[1],e)}return o}function H(t,n,c){let a=m(t,n[0],n[1],"stts");if(!a)return new Int32Array(0);let o=c.getUint32(a[0]+4),e=[],s=0,u=a[0]+8;for(let r=0;r<o;r++){let f=c.getUint32(u),h=c.getInt32(u+4);for(let l=0;l<f;l++)e.push(s),s+=h;u+=8}let i=e.length,U=m(t,n[0],n[1],"ctts"),g=new Float64Array(i);for(let r=0;r<i;r++)g[r]=e[r];if(U){let r=c.getUint32(U[0]+4),f=U[0]+8,h=0;for(let l=0;l<r&&h<i;l++){let k=c.getUint32(f),w=c.getInt32(f+4);for(let C=0;C<k&&h<i;C++)g[h++]+=w;f+=8}}let b=Array.from({length:i},(r,f)=>f).sort((r,f)=>g[r]-g[f]||r-f),A=new Int32Array(i);for(let r=0;r<i;r++)A[b[r]]=r;return A}function S(t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength),c=m(t,0,t.length,"moov"),[a,o]=c??[0,t.length],e=a;for(;e+8<=o;){let s=n.getUint32(e),u=8;if(s===1?(s=Number(n.getBigUint64(e+8)),u=16):s===0&&(s=o-e),B(t,e+4)==="trak"){let i=T(t,e+u,e+s,["mdia","minf","stbl"]);if(i){let U=m(t,i[0],i[1],"stsd");if(U){let g=U[0]+8,b=B(t,g+4);if(b==="avc1"||b==="avc3"||b==="hvc1"||b==="hev1"){let A=n.getUint32(g),r=g+8+78,f=b.startsWith("hv")||b.startsWith("he"),h=m(t,r,g+A,f?"hvcC":"avcC");if(!h)return null;let l=t.subarray(h[0],h[1]),k=f?"hvc1.1.6.L93.B0":`avc1.${I(l[1])}${I(l[2])}${I(l[3])}`,w=H(t,i,n),C=w.length,x=m(t,i[0],i[1],"stss"),d=[];if(x){let y=n.getUint32(x[0]+4);for(let p=0;p<y;p++)d.push(n.getUint32(x[0]+8+p*4)-1)}else for(let y=0;y<C;y++)d.push(y);return(d.length===0||d[0]!==0)&&d.unshift(0),d.sort((y,p)=>y-p),{codec:k,description:l,keyframes:d,decodeToPres:w}}}}}if(s<u)break;e+=s}return null}export{S as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var l=new Set(["png","jpg","jpeg","tif","tiff","psd","tga","bmp","gif","webp","avif","heic","heif","exr","dpx","pict","pct"]);function r(t){let n=t.split(/[/\\]/).pop()??"",e=n.lastIndexOf(".");return e>0?n.slice(e+1).toLowerCase():""}function i(t){return!!t&&l.has(r(t))}function o(t){return t.content_kind==="still"?!0:t.content_kind!=null?!1:i(t.source_filename)||i(t.target_url)}export{r as a,i as b,o as c};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
function p(e,r,l,m){let u=new DataView(e.buffer,e.byteOffset,e.byteLength),t=r;for(;t+8<=l;){let n=u.getUint32(t),s=String.fromCharCode(e[t+4],e[t+5],e[t+6],e[t+7]),f=8;if(n===1){let g=u.getUint32(t+8),k=u.getUint32(t+12);n=g*2**32+k,f=16}else n===0&&(n=l-t);if(n<f||t+n>l)break;m(s,t+f,t+n),t+=n}}var C=new Set(["moov","trak","mdia","minf","stbl"]);function T(e){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),l=null,m=(t,n)=>{let s={},f=!1,g=(k,d)=>{p(e,k,d,(b,a,S)=>{if(C.has(b)){g(a,S);return}switch(b){case"hdlr":{String.fromCharCode(e[a+8],e[a+9],e[a+10],e[a+11])==="vide"&&(f=!0);break}case"stsd":{let i=a+8;s.codec=String.fromCharCode(e[i+4],e[i+5],e[i+6],e[i+7]),s.width=r.getUint16(i+32),s.height=r.getUint16(i+34);break}case"stsz":{let i=r.getUint32(a+4),c=r.getUint32(a+8),o=[];if(i===0)for(let h=0;h<c;h++)o.push(r.getUint32(a+12+h*4));else for(let h=0;h<c;h++)o.push(i);s.sampleSizes=o;break}case"stco":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++)c.push(r.getUint32(a+8+o*4));s.chunkOffsets=c;break}case"co64":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++){let h=r.getUint32(a+8+o*8),U=r.getUint32(a+12+o*8);c.push(h*2**32+U)}s.chunkOffsets=c;break}case"stsc":{let i=r.getUint32(a+4),c=[];for(let o=0;o<i;o++)c.push({firstChunk:r.getUint32(a+8+o*12),samplesPerChunk:r.getUint32(a+8+o*12+4),descIdx:r.getUint32(a+8+o*12+8)});s.sampleToChunk=c;break}}})};g(t,n),f&&s.chunkOffsets&&s.sampleSizes&&s.sampleToChunk&&(l=s)};if(((t,n)=>{p(e,t,n,(s,f,g)=>{s==="moov"&&p(e,f,g,(k,d,b)=>{k==="trak"&&m(d,b)})})})(0,e.length),!l)throw new Error("could not find a video sample table");return l}function w(e){let r=[],l=0;for(let m=0;m<e.chunkOffsets.length;m++){let u=1;for(let n=0;n<e.sampleToChunk.length;n++)m+1>=e.sampleToChunk[n].firstChunk&&(u=e.sampleToChunk[n].samplesPerChunk);let t=e.chunkOffsets[m];for(let n=0;n<u&&l<e.sampleSizes.length;n++){let s=e.sampleSizes[l];r.push({offset:t,size:s}),t+=s,l++}}return r}export{T as a,w as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
async function s(r){let o=0,i=r.fileSize;for(;o+8<=i;){let e=await r.read(o,Math.min(16,i-o)),n=new DataView(e.buffer,e.byteOffset,e.byteLength),t=n.getUint32(0),a=8;if(t===1?(t=Number(n.getBigUint64(8)),a=16):t===0&&(t=i-o),String.fromCharCode(e[4],e[5],e[6],e[7])==="moov")return r.read(o,t);if(t<a)break;o+=t}throw new Error("moov atom not found (not a QuickTime/ProRes .mov?)")}export{s as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
var r={png:"native",jpg:"native",jpeg:"native",gif:"native",webp:"native",avif:"native",bmp:"native",dpx:"wasm-decoder",tif:"wasm-decoder",tiff:"wasm-decoder",exr:"wasm-decoder",dng:"wasm-decoder",cr3:"wasm-decoder",psd:"none",tga:"none",heic:"none",heif:"none",pict:"none",pct:"none"};function l(e){let t=(e??"").toLowerCase();return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null}var i=[{exts:["mov","mp4","m4v"],family:"isobmff",flavor:"mov",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["crm"],family:"isobmff",flavor:"crm",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["braw"],family:"isobmff",flavor:"braw",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["mxf"],family:"mxf",flavor:"mxf",trimSupported:!0,inspectSupported:!0,protection:"proprietary"},{exts:["wav","wave","bwf"],family:"riff",flavor:"wav",trimSupported:!0,inspectSupported:!0,protection:"public"},{exts:["r3d"],family:"r3d",flavor:"r3d",trimSupported:!0,inspectSupported:!0,protection:"proprietary"},{exts:Object.keys(r),family:"still",flavor:"still",trimSupported:!1,inspectSupported:!0,protection:"public"}];function n(e){return(e.split(".").pop()??"").toLowerCase()}function p(e){let t=n(e);return t?i.find(o=>o.exts.includes(t))??null:null}function s(e){let t=p(e);return!!t&&t.trimSupported}export{l as a,p as b,s as c};
|