@shotstack/cli 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/shotstack.js +42 -42
- package/package.json +1 -1
- package/skills/shotstack/SKILL.md +15 -10
- package/skills/shotstack/references/asset-library.md +2 -0
- package/skills/shotstack/references/beat-sync.md +78 -0
- package/skills/shotstack/references/generation.md +3 -1
- package/skills/shotstack/references/html5-effects.md +109 -0
- package/skills/shotstack/references/html5-snippets.md +20 -19
- package/skills/shotstack/references/html5.md +53 -12
- package/skills/shotstack/references/motion.md +60 -96
- package/skills/shotstack/references/onboarding.md +2 -2
- package/skills/shotstack/shared/agent-core.md +75 -27
package/dist/shotstack.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`).replace(/^/gm," ".repeat(2))}let p=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);if(l.length>0)p=p.concat([t.wrap(l,n,0),""]);let
|
|
4
|
-
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,n=40){let s=new RegExp(`[\\n][${" \\f\\t\\v - \uFEFF"}]+`);if(e.match(s))return e;let i=t-r;if(i<n)return e;let
|
|
2
|
+
import{createRequire as Wa}from"node:module";var Ga=Object.defineProperty;var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ka=(e,t,r)=>{for(var n in t)Ga(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},Ie=Wa(import.meta.url);var je=we(function(Ya){class At extends Error{constructor(e,t,r){super(r);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}class Ar extends At{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Ya.CommanderError=At;Ya.InvalidArgumentError=Ar});var Ke=we(function(ru){var{InvalidArgumentError:eu}=je();class wr{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new eu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(t,r);return t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function tu(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}ru.Argument=wr;ru.humanReadableArgName=tu});var wt=we(function(iu){var{humanReadableArgName:su}=Ke();class zr{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter((n)=>!n._hidden),r=e._getHelpCommand();if(r&&!r._hidden)t.push(r);if(this.sortSubcommands)t.sort((n,o)=>n.name().localeCompare(o.name()));return t}compareOptions(e,t){let r=(n)=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter((n)=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);if(!n&&!o)t.push(r);else if(r.long&&!o)t.push(e.createOption(r.long,r.description));else if(r.short&&!n)t.push(e.createOption(r.short,r.description))}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter((o)=>!o.hidden);t.push(...n)}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleArguments(e){if(e._argsDescription)e.registeredArguments.forEach((t)=>{t.description=t.description||e._argsDescription[t.name()]||""});if(e.registeredArguments.find((t)=>t.description))return e.registeredArguments;return[]}subcommandTerm(e){let t=e.registeredArguments.map((r)=>su(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;if(e._aliases[0])t=t+"|"+e._aliases[0];let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0){if(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean")t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(e.presetArg!==void 0&&e.optional)t.push(`preset: ${JSON.stringify(e.presetArg)}`);if(e.envVar!==void 0)t.push(`env: ${e.envVar}`);if(t.length>0)return`${e.description} (${t.join(", ")})`;return e.description}argumentDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0)t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth||80,o=2,s=2;function i(x,z){if(z){let M=`${x.padEnd(r+2)}${z}`;return t.wrap(M,n-2,r+2)}return x}function c(x){return x.join(`
|
|
3
|
+
`).replace(/^/gm," ".repeat(2))}let p=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);if(l.length>0)p=p.concat([t.wrap(l,n,0),""]);let h=t.visibleArguments(e).map((x)=>i(t.argumentTerm(x),t.argumentDescription(x)));if(h.length>0)p=p.concat(["Arguments:",c(h),""]);let y=t.visibleOptions(e).map((x)=>i(t.optionTerm(x),t.optionDescription(x)));if(y.length>0)p=p.concat(["Options:",c(y),""]);if(this.showGlobalOptions){let x=t.visibleGlobalOptions(e).map((z)=>i(t.optionTerm(z),t.optionDescription(z)));if(x.length>0)p=p.concat(["Global Options:",c(x),""])}let A=t.visibleCommands(e).map((x)=>i(t.subcommandTerm(x),t.subcommandDescription(x)));if(A.length>0)p=p.concat(["Commands:",c(A),""]);return p.join(`
|
|
4
|
+
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,n=40){let s=new RegExp(`[\\n][${" \\f\\t\\v - \uFEFF"}]+`);if(e.match(s))return e;let i=t-r;if(i<n)return e;let c=e.slice(0,r),p=e.slice(r).replace(`\r
|
|
5
5
|
`,`
|
|
6
6
|
`),l=" ".repeat(r),y=`\\s${""}`,A=new RegExp(`
|
|
7
|
-
|.{1,${i-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g"),x=p.match(A)||[];return
|
|
8
|
-
`)return"";return(
|
|
9
|
-
`)}}
|
|
7
|
+
|.{1,${i-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g"),x=p.match(A)||[];return c+x.map((z,M)=>{if(z===`
|
|
8
|
+
`)return"";return(M>0?l:"")+z.trimEnd()}).join(`
|
|
9
|
+
`)}}iu.Help=zr});var zt=we(function(lu){var{InvalidArgumentError:uu}=je();class Sr{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=pu(e);if(this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;if(typeof e==="string")t={[e]:!0};return this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new uu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(t,r);return t},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return cu(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class kr{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((t)=>{if(t.negate)this.negativeOptions.set(t.attributeName(),t);else this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{if(this.positiveOptions.has(r))this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,o=n!==void 0?n:!1;return t.negate===(o===e)}}function cu(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function pu(e){let t,r,n=e.split(/[ |,]+/);if(n.length>1&&!/^[[<]/.test(n[1]))t=n.shift();if(r=n.shift(),!t&&/^-[^-]$/.test(r))t=r,r=void 0;return{shortFlag:t,longFlag:r}}lu.Option=Sr;lu.DualOptions=kr});var Zr=we(function(gu){function mu(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let s=1;if(e[o-1]===t[n-1])s=0;else s=1;if(r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1])r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1)}return r[e.length][t.length]}function hu(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");if(r)e=e.slice(2),t=t.map((i)=>i.slice(2));let n=[],o=3,s=0.4;if(t.forEach((i)=>{if(i.length<=1)return;let c=mu(e,i),p=Math.max(e.length,i.length);if((p-c)/p>s){if(c<o)o=c,n=[i];else if(c===o)n.push(i)}}),n.sort((i,c)=>i.localeCompare(c)),r)n=n.map((i)=>`--${i}`);if(n.length>1)return`
|
|
10
10
|
(Did you mean one of ${n.join(", ")}?)`;if(n.length===1)return`
|
|
11
|
-
(Did you mean ${n[0]}?)`;return""}
|
|
12
|
-
- specify the name in Command constructor or using .name()`);if(t=t||{},t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=!0;return this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new
|
|
13
|
-
Expecting one of '${r.join("', '")}'`);if(this._lifeCycleHooks[e])this._lifeCycleHooks[e].push(t);else this._lifeCycleHooks[e]=[t];return this}exitOverride(e){if(e)this._exitCallback=e;else this._exitCallback=(t)=>{if(t.code!=="commander.executeSubCommandAsync")throw t};return this}_exit(e,t,r){if(this._exitCallback)this._exitCallback(new
|
|
14
|
-
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=(n)=>[n.name()].concat(n.aliases()),r=t(e).find((n)=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");if(!this._findOption(o))this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else if(e.defaultValue!==void 0)this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(o,s,i)=>{if(o==null&&e.presetArg!==void 0)o=e.presetArg;let
|
|
11
|
+
(Did you mean ${n[0]}?)`;return""}gu.suggestSimilar=hu});var Rr=we(function(wu){var xu=Ie("node:events").EventEmitter,ze=Ie("node:child_process"),K=Ie("node:path"),Se=Ie("node:fs"),k=Ie("node:process"),{Argument:yu,humanReadableArgName:bu}=Ke(),{CommanderError:St}=je(),{Help:$u}=wt(),{Option:Or,DualOptions:Au}=zt(),{suggestSimilar:Er}=Zr();class kt extends xu{constructor(e){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:(t)=>k.stdout.write(t),writeErr:(t)=>k.stderr.write(t),getOutHelpWidth:()=>k.stdout.isTTY?k.stdout.columns:void 0,getErrHelpWidth:()=>k.stderr.isTTY?k.stderr.columns:void 0,outputError:(t,r)=>r(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,o=r;if(typeof n==="object"&&n!==null)o=n,n=null;o=o||{};let[,s,i]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);if(n)c.description(n),c._executableHandler=!0;if(o.isDefault)this._defaultCommandName=c._name;if(c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,i)c.arguments(i);if(this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n)return this;return c}createCommand(e){return new kt(e)}createHelp(){return Object.assign(new $u,this.configureHelp())}configureHelp(e){if(e===void 0)return this._helpConfiguration;return this._helpConfiguration=e,this}configureOutput(e){if(e===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,e),this}showHelpAfterError(e=!0){if(typeof e!=="string")e=!!e;return this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
12
|
+
- specify the name in Command constructor or using .name()`);if(t=t||{},t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=!0;return this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new yu(e,t)}argument(e,t,r,n){let o=this.createArgument(e,t);if(typeof r==="function")o.default(n).argParser(r);else o.default(r);return this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach((t)=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,r,n]=e.match(/([^ ]+) *(.*)/),o=t??"display help for command",s=this.createCommand(r);if(s.helpOption(!1),n)s.arguments(n);if(o)s.description(o);return this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,t){if(typeof e!=="object")return this.helpCommand(e,t),this;return this._addImplicitHelpCommand=!0,this._helpCommand=e,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
13
|
+
Expecting one of '${r.join("', '")}'`);if(this._lifeCycleHooks[e])this._lifeCycleHooks[e].push(t);else this._lifeCycleHooks[e]=[t];return this}exitOverride(e){if(e)this._exitCallback=e;else this._exitCallback=(t)=>{if(t.code!=="commander.executeSubCommandAsync")throw t};return this}_exit(e,t,r){if(this._exitCallback)this._exitCallback(new St(e,t,r));k.exit(e)}action(e){let t=(r)=>{let n=this.registeredArguments.length,o=r.slice(0,n);if(this._storeOptionsAsProperties)o[n]=this;else o[n]=this.opts();return o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new Or(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
|
|
14
|
+
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=(n)=>[n.name()].concat(n.aliases()),r=t(e).find((n)=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");if(!this._findOption(o))this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else if(e.defaultValue!==void 0)this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(o,s,i)=>{if(o==null&&e.presetArg!==void 0)o=e.presetArg;let c=this.getOptionValue(r);if(o!==null&&e.parseArg)o=this._callParseArg(e,o,c,s);else if(o!==null&&e.variadic)o=e._concatValue(o,c);if(o==null)if(e.negate)o=!1;else if(e.isBoolean()||e.optional)o=!0;else o="";this.setOptionValueWithSource(r,o,i)};if(this.on("option:"+t,(o)=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),e.envVar)this.on("optionEnv:"+t,(o)=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env")});return this}_optionEx(e,t,r,n,o){if(typeof t==="object"&&t instanceof Or)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,r);if(s.makeOptionMandatory(!!e.mandatory),typeof n==="function")s.default(o).argParser(n);else if(n instanceof RegExp){let i=n;n=(c,p)=>{let l=i.exec(c);return l?l[0]:p},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){if(this._storeOptionsAsProperties)return this[e];return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){if(this._storeOptionsAsProperties)this[e]=t;else this._optionValues[e]=t;return this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach((r)=>{if(r.getOptionValueSource(e)!==void 0)t=r.getOptionValueSource(e)}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){if(k.versions?.electron)t.from="electron";let n=k.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))t.from="eval"}if(e===void 0)e=k.argv;this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":if(k.defaultApp)this._scriptPath=e[1],r=e.slice(2);else r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",r}parse(e,t){let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_executeSubCommand(e,t){t=t.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,h){let y=K.resolve(l,h);if(Se.existsSync(y))return y;if(n.includes(K.extname(h)))return;let A=n.find((x)=>Se.existsSync(`${y}${x}`));if(A)return`${y}${A}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,i=this._executableDir||"";if(this._scriptPath){let l;try{l=Se.realpathSync(this._scriptPath)}catch(h){l=this._scriptPath}i=K.resolve(K.dirname(l),i)}if(i){let l=o(i,s);if(!l&&!e._executableFile&&this._scriptPath){let h=K.basename(this._scriptPath,K.extname(this._scriptPath));if(h!==this._name)l=o(i,`${h}-${e._name}`)}s=l||s}r=n.includes(K.extname(s));let c;if(k.platform!=="win32")if(r)t.unshift(s),t=Pr(k.execArgv).concat(t),c=ze.spawn(k.argv[0],t,{stdio:"inherit"});else c=ze.spawn(s,t,{stdio:"inherit"});else t.unshift(s),t=Pr(k.execArgv).concat(t),c=ze.spawn(k.execPath,t,{stdio:"inherit"});if(!c.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((h)=>{k.on(h,()=>{if(c.killed===!1&&c.exitCode===null)c.kill(h)})});let p=this._exitCallback;c.on("close",(l)=>{if(l=l??1,!p)k.exit(l);else p(new St(l,"commander.executeSubCommandAsync","(close)"))}),c.on("error",(l)=>{if(l.code==="ENOENT"){let h=i?`searched for local subcommand relative to directory '${i}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",y=`'${s}' does not exist
|
|
15
15
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
16
16
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
|
-
- ${
|
|
17
|
+
- ${h}`;throw Error(y)}else if(l.code==="EACCES")throw Error(`'${s}' not executable`);if(!p)k.exit(1);else{let h=new St(1,"commander.executeSubCommandAsync","(error)");h.nestedError=l,p(h)}}),this.runningCommand=c}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);if(!n)this.help({error:!0});let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),o}_dispatchHelpCommand(e){if(!e)this.help();let t=this._findCommand(e);if(t&&!t._executableHandler)t.help();return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((e,t)=>{if(e.required&&this.args[t]==null)this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let e=(r,n,o)=>{let s=n;if(n!==null&&r.parseArg){let i=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,n,o,i)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let o=r.defaultValue;if(r.variadic){if(n<this.args.length){if(o=this.args.slice(n),r.parseArg)o=o.reduce((s,i)=>e(r,i,s),r.defaultValue)}else if(o===void 0)o=[]}else if(n<this.args.length){if(o=this.args[n],r.parseArg)o=e(r,o,r.defaultValue)}t[n]=o}),this.processedArgs=t}_chainOrCall(e,t){if(e&&e.then&&typeof e.then==="function")return e.then(()=>t());return t()}_chainOrCallHooks(e,t){let r=e,n=[];if(this._getCommandAndAncestors().reverse().filter((o)=>o._lifeCycleHooks[t]!==void 0).forEach((o)=>{o._lifeCycleHooks[t].forEach((s)=>{n.push({hookedCommand:o,callback:s})})}),t==="postAction")n.reverse();return n.forEach((o)=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;if(this._lifeCycleHooks[r]!==void 0)this._lifeCycleHooks[r].forEach((o)=>{n=this._chainOrCall(n,()=>o(this,t))});return n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{if(r.unknown.length>0)this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;if(s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent)s=this._chainOrCall(s,()=>{this.parent.emit(o,e,t)});return s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);if(this.listenerCount("command:*"))this.emit("command:*",e,t);else if(this.commands.length)this.unknownCommand();else n(),this._processArguments()}else if(this.commands.length)n(),this.help({error:!0});else n(),this._processArguments()}_findCommand(e){if(!e)return;return this.commands.find((t)=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find((t)=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e)=>{e.options.forEach((t)=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===void 0)e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter((r)=>{let n=r.attributeName();if(this.getOptionValue(n)===void 0)return!1;return this.getOptionValueSource(n)!=="default"});e.filter((r)=>r.conflictsWith.length>0).forEach((r)=>{let n=e.find((o)=>r.conflictsWith.includes(o.attributeName()));if(n)this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e)=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t,o=e.slice();function s(c){return c.length>1&&c[0]==="-"}let i=null;while(o.length){let c=o.shift();if(c==="--"){if(n===r)n.push(c);n.push(...o);break}if(i&&!s(c)){this.emit(`option:${i.name()}`,c);continue}if(i=null,s(c)){let p=this._findOption(c);if(p){if(p.required){let l=o.shift();if(l===void 0)this.optionMissingArgument(p);this.emit(`option:${p.name()}`,l)}else if(p.optional){let l=null;if(o.length>0&&!s(o[0]))l=o.shift();this.emit(`option:${p.name()}`,l)}else this.emit(`option:${p.name()}`);i=p.variadic?p:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let p=this._findOption(`-${c[1]}`);if(p){if(p.required||p.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${p.name()}`,c.slice(2));else this.emit(`option:${p.name()}`),o.unshift(`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let p=c.indexOf("="),l=this._findOption(c.slice(0,p));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,c.slice(p+1));continue}}if(s(c))n=r;if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(c)){if(t.push(c),o.length>0)r.push(...o);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){if(t.push(c),o.length>0)t.push(...o);break}else if(this._defaultCommandName){if(r.push(c),o.length>0)r.push(...o);break}}if(this._passThroughOptions){if(n.push(c),o.length>0)n.push(...o);break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){if(this._outputConfiguration.outputError(`${e}
|
|
18
18
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
19
19
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
20
|
-
`),this.outputHelp({error:!0});let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e)=>{if(e.envVar&&e.envVar in
|
|
21
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,t){if(e===void 0&&t===void 0)return this._description;if(this._description=e,t)this._argsDescription=t;return this}summary(e){if(e===void 0)return this._summary;return this._summary=e,this}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)t=this.commands[this.commands.length-1];if(e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){if(e===void 0)return this._aliases;return e.forEach((t)=>this.alias(t)),this}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map((r)=>
|
|
20
|
+
`),this.outputHelp({error:!0});let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e)=>{if(e.envVar&&e.envVar in k.env){let t=e.attributeName();if(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))if(e.required||e.optional)this.emit(`optionEnv:${e.name()}`,k.env[e.envVar]);else this.emit(`optionEnv:${e.name()}`)}})}_parseOptionsImplied(){let e=new Au(this.options),t=(r)=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((r)=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach((r)=>{Object.keys(r.implied).filter((n)=>!t(n)).forEach((n)=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=(s)=>{let i=s.attributeName(),c=this.getOptionValue(i),p=this.options.find((h)=>h.negate&&i===h.attributeName()),l=this.options.find((h)=>!h.negate&&i===h.attributeName());if(p&&(p.presetArg===void 0&&c===!1||p.presetArg!==void 0&&c===p.presetArg))return p;return l||s},n=(s)=>{let i=r(s),c=i.attributeName();if(this.getOptionValueSource(c)==="env")return`environment variable '${i.envVar}'`;return`option '${i.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter((i)=>i.long).map((i)=>i.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);t=Er(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach((o)=>{if(n.push(o.name()),o.alias())n.push(o.alias())}),t=Er(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
21
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,t){if(e===void 0&&t===void 0)return this._description;if(this._description=e,t)this._argsDescription=t;return this}summary(e){if(e===void 0)return this._summary;return this._summary=e,this}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)t=this.commands[this.commands.length-1];if(e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){if(e===void 0)return this._aliases;return e.forEach((t)=>this.alias(t)),this}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map((r)=>bu(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){if(e===void 0)return this._name;return this._name=e,this}nameFromFilename(e){return this._name=K.basename(e,K.extname(e)),this}executableDir(e){if(e===void 0)return this._executableDir;return this._executableDir=e,this}helpInformation(e){let t=this.createHelp();if(t.helpWidth===void 0)t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},r;if(t.error)r=(n)=>this._outputConfiguration.writeErr(n);else r=(n)=>this._outputConfiguration.writeOut(n);return t.write=e.write||r,t.command=this,t}outputHelp(e){let t;if(typeof e==="function")t=e,e=void 0;let r=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach((o)=>o.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(t){if(n=t(n),typeof n!=="string"&&!Buffer.isBuffer(n))throw Error("outputHelp callback must return a string or a Buffer")}if(r.write(n),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",r),this._getCommandAndAncestors().forEach((o)=>o.emit("afterAllHelp",r))}helpOption(e,t){if(typeof e==="boolean"){if(e)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=k.exitCode||0;if(t===0&&e&&typeof e!=="function"&&e.error)t=1;this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
22
22
|
Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,(o)=>{let s;if(typeof t==="function")s=t({error:o.error,command:o.command});else s=t;if(s)o.write(`${s}
|
|
23
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();if(t&&e.find((n)=>t.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Pr(e){return e.map((t)=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",s;if((s=t.match(/^(--inspect(-brk)?)$/))!==null)r=s[1];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(r=s[1],/^\d+$/.test(s[3]))o=s[3];else n=s[3];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)r=s[1],n=s[3],o=s[4];if(r&&o!=="0")return`${r}=${n}:${parseInt(o)+1}`;return t})}
|
|
24
|
-
`,{mode:384}),await
|
|
25
|
-
`;if(await Tu(Fu(t),{recursive:!0,mode:448}),!await vu(t))await nn(t,"",{mode:384});await Iu(t,n),await qu(t)}async function vu(e){try{return await rn(e),!0}catch{return!1}}async function qu(e){let t=await rn(e).catch(()=>null);if(!t||t.size<=Du)return;let r=await ju(e),n=r.subarray(Math.max(0,r.length-Lu)),o=n.indexOf(10),s=o>=0?n.subarray(o+1):n;await nn(e,s,{mode:384})}var Ju=/^https?:\/\//i,Bu=/(https?:\/\/[^\s'"<>?]+)\?[^\s'"<>]*?(?:Signature|X-Amz-[A-Za-z0-9-]+|x-amz-security-token)=[^\s'"<>]*/gi;function Tt(e){return e.replace(Bu,"$1?[redacted-signed]")}function Hu(e){if(typeof e!=="string")return e;if(e.startsWith("-"))return e;if(Ju.test(e))return Tt(e);if(/[\/\\]/.test(e))return Gu(e);return e}function Gu(e){let t=e.split(/[\/\\]/);return t[t.length-1]||e}function Nt(e){if(typeof e==="string")return Tt(e);if(Array.isArray(e))return e.map(Nt);if(e&&typeof e==="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Nt(n);return t}return e}function Wu(e){let t=JSON.stringify(e);if(t===void 0||t.length<=en)return e;return t.slice(0,en)+"...[truncated]"}async function H(e,t,r){let n=Date.now();try{let o=await r(),s=o.exitCode??0;if(await tn({cmd:e,args:t,exit:s,durationMs:Date.now()-n,renderId:o.renderId,response:o.response}).catch(()=>{}),s!==0)process.exit(s)}catch(o){let s=Ku(o),i=o instanceof ie?o.body:void 0;throw await tn({cmd:e,args:t,exit:s,durationMs:Date.now()-n,response:i,error:Vu(o)}).catch(()=>{}),o}}function Ku(e){if(e instanceof ie)return e.isTransient?2:1;if(e instanceof we||e instanceof ze)return 1;if(e instanceof Error&&e.code==="ENOENT")return 1;return 2}function G(e){let t=process.argv.slice(2),r=t.indexOf(e);return r>=0?t.slice(r+1):t}var Yu=new Set(["done","failed"]),Qu=3000,on=new L("status").description("Poll the status of a Shotstack render").argument("<id>","Render ID returned by `shotstack render`").option("--watch","Poll continuously until the render reaches a terminal state").option("--env <name>",`Environment: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("status",G("status"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=q({apiKey:o,env:n}),i=await It(s,e,r,t.watch===!0),u=i.status==="failed"?1:0;return{renderId:i.id,response:i,exitCode:u}})});async function It(e,t,r,n){while(!0){let s=(await e.get(`/render/${encodeURIComponent(t)}`)).response;if(P(r,s,Xu(s)),!n||Yu.has(s.status))return s;await ec(Qu)}}function Xu(e){let t=[e.status];if(e.url)t.push(e.url);if(e.error)t.push(`error: ${e.error}`);return t.join(" ")}function ec(e){return new Promise((t)=>setTimeout(t,e))}var sn;function m(e,t,r){function n(u,p){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:p,constr:i,traits:new Set},enumerable:!1});if(u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,p);let l=i.prototype,_=Object.keys(l);for(let y=0;y<_.length;y++){let A=_[y];if(!(A in u))u[A]=l[A].bind(u)}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(u){var p;let l=r?.Parent?new s:this;n(l,u),(p=l._zod).deferred??(p.deferred=[]);for(let _ of l._zod.deferred)_();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:(u)=>{if(r?.Parent&&u instanceof r.Parent)return!0;return u?._zod?.traits?.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}var Pm=Symbol("zod_brand");class ae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ie extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(sn=globalThis).__zod_globalConfig??(sn.__zod_globalConfig={});var Se=globalThis.__zod_globalConfig;function X(e){if(e)Object.assign(Se,e);return Se}function Ye(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function je(e,t){if(typeof t==="bigint")return t.toString();return t}function Fe(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function Qe(e){return e===null||e===void 0}function Xe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function un(e,t){let r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}var an=Symbol("evaluating");function O(e,t,r){let n=void 0;Object.defineProperty(e,t,{get(){if(n===an)return;if(n===void 0)n=an,n=r();return n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function de(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ue(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Ft(e){return JSON.stringify(e)}function cn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ke(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var pn=Fe(()=>{if(Se.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function me(e){if(ke(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ke(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Lt(e){if(me(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var ln=new Set(["string","number","symbol"]);function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ne(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function w(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function fn(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var dn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function tc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=ue(e._zod.def,{get shape(){let i={};for(let u in t){if(!(u in r.shape))throw Error(`Unrecognized key: "${u}"`);if(!t[u])continue;i[u]=r.shape[u]}return de(this,"shape",i),i},checks:[]});return ne(e,s)}function rc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=ue(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let u in t){if(!(u in r.shape))throw Error(`Unrecognized key: "${u}"`);if(!t[u])continue;delete i[u]}return de(this,"shape",i),i},checks:[]});return ne(e,s)}function nc(e,t){if(!me(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ue(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return de(this,"shape",s),s}});return ne(e,o)}function oc(e,t){if(!me(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=ue(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return de(this,"shape",n),n}});return ne(e,r)}function sc(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ue(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return de(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ne(e,r)}function ic(e,t,r){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=ue(t._zod.def,{get shape(){let u=t._zod.def.shape,p={...u};if(r)for(let l in r){if(!(l in u))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;p[l]=e?new e({type:"optional",innerType:u[l]}):u[l]}else for(let l in u)p[l]=e?new e({type:"optional",innerType:u[l]}):u[l];return de(this,"shape",p),p},checks:[]});return ne(t,i)}function ac(e,t,r){let n=ue(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;s[i]=new e({type:"nonoptional",innerType:o[i]})}else for(let i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return de(this,"shape",s),s}});return ne(t,n)}function he(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function pe(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ke(e){return typeof e==="string"?e:e?.message}function ee(e,t,r){let n=e.message?e.message:Ke(e.inst?._zod.def?.error?.(e))??Ke(t?.error?.(e))??Ke(r.customError?.(e))??Ke(r.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...u}=e;if(u.path??(u.path=[]),u.message=n,t?.reportInput)u.input=i;return u}function et(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ge(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}var hn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,je,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},tt=m("$ZodError",hn),Ut=m("$ZodError",hn,{Parent:Error});function gn(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function _n(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((u)=>n({issues:u},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let u=[...s,...i.path];if(u.length===0)r._errors.push(t(i));else{let p=r,l=0;while(l<u.length){let _=u[l];if(l!==u.length-1)p[_]=p[_]||{_errors:[]};else p[_]=p[_]||{_errors:[]},p[_]._errors.push(t(i));p=p[_],l++}}}};return n(e),r}var rt=(e)=>(t,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ae;if(i.issues.length){let u=new(o?.Err??e)(i.issues.map((p)=>ee(p,s,X())));throw Dt(u,o?.callee),u}return i.value};var nt=(e)=>async(t,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)i=await i;if(i.issues.length){let u=new(o?.Err??e)(i.issues.map((p)=>ee(p,s,X())));throw Dt(u,o?.callee),u}return i.value};var De=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ae;return s.issues.length?{success:!1,error:new(e??tt)(s.issues.map((i)=>ee(i,o,X())))}:{success:!0,data:s.value}},xn=De(Ut),Le=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>ee(i,o,X())))}:{success:!0,data:s.value}},yn=Le(Ut),bn=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return rt(e)(t,r,o)};var $n=(e)=>(t,r,n)=>rt(e)(t,r,n);var An=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return nt(e)(t,r,o)};var wn=(e)=>async(t,r,n)=>nt(e)(t,r,n);var zn=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return De(e)(t,r,o)};var Sn=(e)=>(t,r,n)=>De(e)(t,r,n);var kn=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Le(e)(t,r,o)};var Zn=(e)=>async(t,r,n)=>Le(e)(t,r,n);var On=/^[cC][0-9a-z]{6,}$/,En=/^[0-9a-z]+$/,Pn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rn=/^[0-9a-vA-V]{20}$/,Cn=/^[A-Za-z0-9]{27}$/,Nn=/^[a-zA-Z0-9_-]{21}$/,Tn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var In=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Mt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var jn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var cc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fn(){return new RegExp(cc,"u")}var Dn=/^(?:(?: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])$/,Ln=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Un=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^[A-Za-z0-9_-]*$/;var vn=/^https?$/,qn=/^\+[1-9]\d{6,14}$/,Jn="(?:(?:\\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])))",Bn=new RegExp(`^${Jn}$`);function Hn(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Gn(e){return new RegExp(`^${Hn(e)}$`)}function Wn(e){let t=Hn({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Jn}T(?:${n})$`)}var Kn=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Yn=/^-?\d+$/,vt=/^-?\d+(?:\.\d+)?$/,Qn=/^(?:true|false)$/i,Xn=/^null$/i;var eo=/^[^A-Z]*$/,to=/^[^a-z]*$/;var K=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ro={number:"number",bigint:"bigint",object:"date"},qt=m("$ZodCheckLessThan",(e,t)=>{K.init(e,t);let r=ro[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jt=m("$ZodCheckGreaterThan",(e,t)=>{K.init(e,t);let r=ro[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),no=m("$ZodCheckMultipleOf",(e,t)=>{K.init(e,t),e._zod.onattach.push((r)=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):un(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),oo=m("$ZodCheckNumberFormat",(e,t)=>{K.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=dn[t.format];e._zod.onattach.push((i)=>{let u=i._zod.bag;if(u.format=t.format,u.minimum=o,u.maximum=s,r)u.pattern=Yn}),e._zod.check=(i)=>{let u=i.value;if(r){if(!Number.isInteger(u)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){if(u>0)i.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else i.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(u<o)i.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(u>s)i.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var so=m("$ZodCheckMaxLength",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Qe(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let o=n.value;if(o.length<=t.maximum)return;let i=et(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),io=m("$ZodCheckMinLength",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Qe(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let o=n.value;if(o.length>=t.minimum)return;let i=et(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ao=m("$ZodCheckLengthEquals",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Qe(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(n)=>{let o=n.value,s=o.length;if(s===t.length)return;let i=et(o),u=s>t.length;n.issues.push({origin:i,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ue=m("$ZodCheckStringFormat",(e,t)=>{var r,n;if(K.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),uo=m("$ZodCheckRegex",(e,t)=>{Ue.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),co=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eo),Ue.init(e,t)}),po=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=to),Ue.init(e,t)}),lo=m("$ZodCheckIncludes",(e,t)=>{K.init(e,t);let r=ce(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),fo=m("$ZodCheckStartsWith",(e,t)=>{K.init(e,t);let r=new RegExp(`^${ce(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mo=m("$ZodCheckEndsWith",(e,t)=>{K.init(e,t);let r=new RegExp(`.*${ce(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ho=m("$ZodCheckOverwrite",(e,t)=>{K.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Bt{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
23
|
+
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();if(t&&e.find((n)=>t.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Pr(e){return e.map((t)=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",s;if((s=t.match(/^(--inspect(-brk)?)$/))!==null)r=s[1];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(r=s[1],/^\d+$/.test(s[3]))o=s[3];else n=s[3];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)r=s[1],n=s[3],o=s[4];if(r&&o!=="0")return`${r}=${n}:${parseInt(o)+1}`;return t})}wu.Command=kt});var Ot={};Ka(Ot,{program:()=>Ir,createCommand:()=>jr,createOption:()=>Fr,createArgument:()=>Dr,Command:()=>Lr,Option:()=>Ur,Argument:()=>Mr,Help:()=>vr,CommanderError:()=>Vr,InvalidArgumentError:()=>qr,InvalidOptionArgumentError:()=>Jr},{program:(Qd)=>Ir=Qd,createCommand:(Qd)=>jr=Qd,createOption:(Qd)=>Fr=Qd,createArgument:(Qd)=>Dr=Qd,Command:(Qd)=>Lr=Qd,Option:(Qd)=>Ur=Qd,Argument:(Qd)=>Mr=Qd,Help:(Qd)=>vr=Qd,CommanderError:(Qd)=>Vr=Qd,InvalidArgumentError:(Qd)=>qr=Qd,InvalidOptionArgumentError:(Qd)=>Jr=Qd});var{Argument:Cr}=Ke(),{Command:Zt}=Rr(),{CommanderError:Su,InvalidArgumentError:Nr}=je(),{Help:ku}=wt(),{Option:Tr}=zt();var Ir=new Zt,jr=(e)=>new Zt(e),Fr=(e,t)=>new Tr(e,t),Dr=(e,t)=>new Cr(e,t),Lr=Zt,Ur=Tr,Mr=Cr,vr=ku,Vr=Su,qr=Nr,Jr=Nr;var{program:em,createCommand:tm,createArgument:rm,createOption:nm,CommanderError:om,InvalidArgumentError:We,InvalidOptionArgumentError:sm,Command:F,Argument:im,Option:am,Help:um}=Ot;import{readFile as Of}from"node:fs/promises";import{resolve as Ef}from"node:path";var Br={name:"@shotstack/cli",version:"0.12.0",description:"Command-line interface for the Shotstack video rendering API.",license:"Apache-2.0",homepage:"https://github.com/shotstack/shotstack-cli",repository:{type:"git",url:"git+https://github.com/shotstack/shotstack-cli.git"},bugs:{url:"https://github.com/shotstack/shotstack-cli/issues"},type:"module",bin:{shotstack:"dist/shotstack.js"},files:["dist/shotstack.js","skills"],scripts:{start:"bun run src/index.ts",build:"bun build src/index.ts --target=node --minify --outfile=dist/shotstack.js --banner='#!/usr/bin/env node' && chmod +x dist/shotstack.js",prepack:"bun run build",typecheck:"tsc --noEmit",test:"bun test"},dependencies:{"@shotstack/schemas":"^1.22.0",commander:"^12.1.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"latest",typescript:"^5.6.0"}};var Fe=Br.version,Hr=`shotstack-cli/${Fe} (${process.platform}-${process.arch})`;class ee extends Error{status;body;constructor(e,t,r){super(r);this.status=e;this.body=t;this.name="ApiError"}get isTransient(){return this.status>=500||this.status===429}}function V(e){let t=e.env.baseUrl.replace(/\/$/,"");async function r(n,o,s){let i=await fetch(`${t}${o}`,{method:n,headers:{...e.apiKey!==void 0?{"x-api-key":e.apiKey}:{},"x-shotstack-origin":"cli","x-shotstack-environment":e.env.name,"user-agent":Hr,...s!==void 0?{"content-type":"application/json"}:{}},body:s!==void 0?JSON.stringify(s):void 0}),c=await i.text(),p=c?Ou(c):void 0;if(!i.ok)throw new ee(i.status,p??c,`${n} ${o} → ${i.status} ${i.statusText}`);return p}return{post:(n,o)=>r("POST",n,o),put:(n,o)=>r("PUT",n,o),get:(n)=>r("GET",n),del:(n)=>r("DELETE",n)}}function Ou(e){try{return JSON.parse(e)}catch{return e}}import{mkdir as Eu,writeFile as Pu,chmod as Ru}from"node:fs/promises";import{readFileSync as Cu}from"node:fs";import{join as Et,dirname as Nu}from"node:path";import{homedir as Gr}from"node:os";function ke(){if(process.platform==="win32"){let e=process.env.APPDATA??Et(Gr(),"AppData","Roaming");return Et(e,"shotstack","credentials.json")}return Et(Gr(),".shotstack","credentials.json")}function Pt(e){try{let t=JSON.parse(Cu(e,"utf8"));if(t&&typeof t==="object"&&!Array.isArray(t))return t}catch{}return{}}function Kr(e,t=ke()){return Pt(t)[e]?.trim()||void 0}async function Wr(e,t,r=ke()){let n=Pt(r);n[e]=t.trim(),await Rt(r,n)}async function Yr(e,t=ke()){let r=Pt(t);if(!(e in r))return!1;return delete r[e],await Rt(t,r),!0}async function Qr(e=ke()){await Rt(e,{})}async function Rt(e,t){await Eu(Nu(e),{recursive:!0,mode:448}),await Pu(e,JSON.stringify(t,null,2)+`
|
|
24
|
+
`,{mode:384}),await Ru(e,384).catch(()=>{})}class ue extends Error{constructor(e){let t=e?` for env "${e}"`:"",r=e?`shotstack login --env ${e}`:"shotstack login";super(`No Shotstack API key found${t}. Run \`${r}\` to save one, or set SHOTSTACK_API_KEY. Get a key at https://shotstack.io.`);this.name="MissingApiKeyError"}}function q(e,t){let r=process.env.SHOTSTACK_API_KEY?.trim();if(r)return r;let n=Kr(e,t);if(n)return n;throw new ue(e)}var R=["dev","stage","v1"];class Ze extends Error{constructor(e){super(`Invalid environment "${e}". Use one of: ${R.join(", ")}.`);this.name="InvalidEnvError"}}function me(e){let t=e??process.env.SHOTSTACK_ENV?.trim()??"v1";if(!Iu(t))throw new Ze(t);return t}function J(e,t="edit"){let r=Tu(t);if(r)return{name:"custom",baseUrl:r};let n=me(e);return{name:n,baseUrl:`https://api.shotstack.io/${t}/${n}`}}function Tu(e){return(e==="ingest"?process.env.SHOTSTACK_INGEST_BASE_URL:process.env.SHOTSTACK_API_BASE_URL)?.trim()||void 0}function Iu(e){return R.includes(e)}function C(e){if(e==="json")return"json";return"text"}function E(e,t,r){if(e==="json")console.log(JSON.stringify(t));else console.log(r)}import{mkdir as ju,appendFile as Fu,stat as rn,readFile as Du,writeFile as nn}from"node:fs/promises";import{join as Ct,dirname as Lu}from"node:path";import{homedir as Xr}from"node:os";var Uu=1e6,Mu=500000,en=2000;function Ye(){if(process.platform==="win32"){let e=process.env.APPDATA??Ct(Xr(),"AppData","Roaming");return Ct(e,"shotstack","log.jsonl")}return Ct(Xr(),".shotstack","log.jsonl")}function vu(e,t=new Date){let r={ts:t.toISOString(),cmd:e.cmd,args:e.args.map(Ku),exit:e.exit,durationMs:e.durationMs};if(e.renderId)r.renderId=e.renderId;if(e.response!==void 0)r.response=Yu(Nt(e.response));if(e.error)r.error=Vu(e.error);return r}function Vu(e){return{name:e.name,message:typeof e.message==="string"?Tt(e.message):String(e.message)}}function qu(e){if(e instanceof Error)return{name:e.name,message:e.message};if(e===void 0||e===null)return;return{name:"Unknown",message:String(e)}}async function tn(e,t=Ye()){let r=vu(e),n=JSON.stringify(r)+`
|
|
25
|
+
`;if(await ju(Lu(t),{recursive:!0,mode:448}),!await Ju(t))await nn(t,"",{mode:384});await Fu(t,n),await Bu(t)}async function Ju(e){try{return await rn(e),!0}catch{return!1}}async function Bu(e){let t=await rn(e).catch(()=>null);if(!t||t.size<=Uu)return;let r=await Du(e),n=r.subarray(Math.max(0,r.length-Mu)),o=n.indexOf(10),s=o>=0?n.subarray(o+1):n;await nn(e,s,{mode:384})}var Hu=/^https?:\/\//i,Gu=/(https?:\/\/[^\s'"<>?]+)\?[^\s'"<>]*?(?:Signature|X-Amz-[A-Za-z0-9-]+|x-amz-security-token)=[^\s'"<>]*/gi;function Tt(e){return e.replace(Gu,"$1?[redacted-signed]")}function Ku(e){if(typeof e!=="string")return e;if(e.startsWith("-"))return e;if(Hu.test(e))return Tt(e);if(/[\/\\]/.test(e))return Wu(e);return e}function Wu(e){let t=e.split(/[\/\\]/);return t[t.length-1]||e}function Nt(e){if(typeof e==="string")return Tt(e);if(Array.isArray(e))return e.map(Nt);if(e&&typeof e==="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Nt(n);return t}return e}function Yu(e){let t=JSON.stringify(e);if(t===void 0||t.length<=en)return e;return t.slice(0,en)+"...[truncated]"}async function B(e,t,r){let n=Date.now();try{let o=await r(),s=o.exitCode??0;if(await tn({cmd:e,args:t,exit:s,durationMs:Date.now()-n,renderId:o.renderId,response:o.response}).catch(()=>{}),s!==0)process.exit(s)}catch(o){let s=Qu(o),i=o instanceof ee?o.body:void 0;throw await tn({cmd:e,args:t,exit:s,durationMs:Date.now()-n,response:i,error:qu(o)}).catch(()=>{}),o}}function Qu(e){if(e instanceof ee)return e.isTransient?2:1;if(e instanceof ue||e instanceof Ze)return 1;if(e instanceof Error&&e.code==="ENOENT")return 1;return 2}function H(e){let t=process.argv.slice(2),r=t.indexOf(e);return r>=0?t.slice(r+1):t}var Xu=new Set(["done","failed"]),ec=3000,on=new F("status").description("Poll the status of a Shotstack render").argument("<id>","Render ID returned by `shotstack render`").option("--watch","Poll continuously until the render reaches a terminal state").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("status",H("status"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=V({apiKey:o,env:n}),i=await It(s,e,r,t.watch===!0),c=i.status==="failed"?1:0;return{renderId:i.id,response:i,exitCode:c}})});async function It(e,t,r,n){while(!0){let s=(await e.get(`/render/${encodeURIComponent(t)}`)).response;if(E(r,s,tc(s)),!n||Xu.has(s.status))return s;await rc(ec)}}function tc(e){let t=[e.status];if(e.url)t.push(e.url);if(e.error)t.push(`error: ${e.error}`);return t.join(" ")}function rc(e){return new Promise((t)=>setTimeout(t,e))}var sn;function m(e,t,r){function n(c,p){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:p,constr:i,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,p);let l=i.prototype,h=Object.keys(l);for(let y=0;y<h.length;y++){let A=h[y];if(!(A in c))c[A]=l[A].bind(c)}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(c){var p;let l=r?.Parent?new s:this;n(l,c),(p=l._zod).deferred??(p.deferred=[]);for(let h of l._zod.deferred)h();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:(c)=>{if(r?.Parent&&c instanceof r.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}var Dm=Symbol("zod_brand");class ae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class De extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(sn=globalThis).__zod_globalConfig??(sn.__zod_globalConfig={});var Oe=globalThis.__zod_globalConfig;function te(e){if(e)Object.assign(Oe,e);return Oe}function Xe(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Le(e,t){if(typeof t==="bigint")return t.toString();return t}function Ue(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function et(e){return e===null||e===void 0}function tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function un(e,t){let r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}var an=Symbol("evaluating");function P(e,t,r){let n=void 0;Object.defineProperty(e,t,{get(){if(n===an)return;if(n===void 0)n=an,n=r();return n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function he(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ce(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Ft(e){return JSON.stringify(e)}function cn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var pn=Ue(()=>{if(Oe.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ge(e){if(Ee(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Ee(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Lt(e){if(ge(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var ln=new Set(["string","number","symbol"]);function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function se(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function w(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function fn(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var dn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function nc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=ce(e._zod.def,{get shape(){let i={};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;i[c]=r.shape[c]}return he(this,"shape",i),i},checks:[]});return se(e,s)}function oc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=ce(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete i[c]}return he(this,"shape",i),i},checks:[]});return se(e,s)}function sc(e,t){if(!ge(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ce(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return he(this,"shape",s),s}});return se(e,o)}function ic(e,t){if(!ge(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=ce(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return he(this,"shape",n),n}});return se(e,r)}function ac(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ce(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return se(e,r)}function uc(e,t,r){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=ce(t._zod.def,{get shape(){let c=t._zod.def.shape,p={...c};if(r)for(let l in r){if(!(l in c))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;p[l]=e?new e({type:"optional",innerType:c[l]}):c[l]}else for(let l in c)p[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return he(this,"shape",p),p},checks:[]});return se(t,i)}function cc(e,t,r){let n=ce(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;s[i]=new e({type:"nonoptional",innerType:o[i]})}else for(let i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return he(this,"shape",s),s}});return se(t,n)}function _e(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function le(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Qe(e){return typeof e==="string"?e:e?.message}function re(e,t,r){let n=e.message?e.message:Qe(e.inst?._zod.def?.error?.(e))??Qe(t?.error?.(e))??Qe(r.customError?.(e))??Qe(r.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...c}=e;if(c.path??(c.path=[]),c.message=n,t?.reportInput)c.input=i;return c}function rt(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function xe(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}var hn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Le,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},nt=m("$ZodError",hn),Ut=m("$ZodError",hn,{Parent:Error});function gn(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function _n(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((c)=>n({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let p=r,l=0;while(l<c.length){let h=c[l];if(l!==c.length-1)p[h]=p[h]||{_errors:[]};else p[h]=p[h]||{_errors:[]},p[h]._errors.push(t(i));p=p[h],l++}}}};return n(e),r}var ot=(e)=>(t,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ae;if(i.issues.length){let c=new(o?.Err??e)(i.issues.map((p)=>re(p,s,te())));throw Dt(c,o?.callee),c}return i.value};var st=(e)=>async(t,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)i=await i;if(i.issues.length){let c=new(o?.Err??e)(i.issues.map((p)=>re(p,s,te())));throw Dt(c,o?.callee),c}return i.value};var Me=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ae;return s.issues.length?{success:!1,error:new(e??nt)(s.issues.map((i)=>re(i,o,te())))}:{success:!0,data:s.value}},xn=Me(Ut),ve=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>re(i,o,te())))}:{success:!0,data:s.value}},yn=ve(Ut),bn=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ot(e)(t,r,o)};var $n=(e)=>(t,r,n)=>ot(e)(t,r,n);var An=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return st(e)(t,r,o)};var wn=(e)=>async(t,r,n)=>st(e)(t,r,n);var zn=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Me(e)(t,r,o)};var Sn=(e)=>(t,r,n)=>Me(e)(t,r,n);var kn=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ve(e)(t,r,o)};var Zn=(e)=>async(t,r,n)=>ve(e)(t,r,n);var On=/^[cC][0-9a-z]{6,}$/,En=/^[0-9a-z]+$/,Pn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rn=/^[0-9a-vA-V]{20}$/,Cn=/^[A-Za-z0-9]{27}$/,Nn=/^[a-zA-Z0-9_-]{21}$/,Tn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var In=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Mt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var jn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var lc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fn(){return new RegExp(lc,"u")}var Dn=/^(?:(?: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])$/,Ln=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Un=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vt=/^[A-Za-z0-9_-]*$/;var Vn=/^https?$/,qn=/^\+[1-9]\d{6,14}$/,Jn="(?:(?:\\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])))",Bn=new RegExp(`^${Jn}$`);function Hn(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Gn(e){return new RegExp(`^${Hn(e)}$`)}function Kn(e){let t=Hn({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Jn}T(?:${n})$`)}var Wn=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Yn=/^-?\d+$/,Vt=/^-?\d+(?:\.\d+)?$/,Qn=/^(?:true|false)$/i,Xn=/^null$/i;var eo=/^[^A-Z]*$/,to=/^[^a-z]*$/;var Y=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ro={number:"number",bigint:"bigint",object:"date"},qt=m("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);let r=ro[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jt=m("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);let r=ro[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),no=m("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push((r)=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):un(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),oo=m("$ZodCheckNumberFormat",(e,t)=>{Y.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=dn[t.format];e._zod.onattach.push((i)=>{let c=i._zod.bag;if(c.format=t.format,c.minimum=o,c.maximum=s,r)c.pattern=Yn}),e._zod.check=(i)=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<o)i.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>s)i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var so=m("$ZodCheckMaxLength",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!et(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let o=n.value;if(o.length<=t.maximum)return;let i=rt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),io=m("$ZodCheckMinLength",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!et(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let o=n.value;if(o.length>=t.minimum)return;let i=rt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ao=m("$ZodCheckLengthEquals",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!et(o)&&o.length!==void 0}),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(n)=>{let o=n.value,s=o.length;if(s===t.length)return;let i=rt(o),c=s>t.length;n.issues.push({origin:i,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ve=m("$ZodCheckStringFormat",(e,t)=>{var r,n;if(Y.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),uo=m("$ZodCheckRegex",(e,t)=>{Ve.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),co=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eo),Ve.init(e,t)}),po=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=to),Ve.init(e,t)}),lo=m("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);let r=pe(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),fo=m("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);let r=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mo=m("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);let r=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ho=m("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Bt{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
26
26
|
`).filter((s)=>s),n=Math.min(...r.map((s)=>s.length-s.trimStart().length)),o=r.map((s)=>s.slice(n)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[""]).map((o)=>` ${o}`)];return new e(...t,n.join(`
|
|
27
|
-
`))}}var _o={major:4,minor:4,patch:3};var T=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_o;let n=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,u,p)=>{let l=he(i),_;for(let y of u){if(y._zod.def.when){if(mn(i))continue;if(!y._zod.def.when(i))continue}else if(l)continue;let A=i.issues.length,x=y._zod.check(i);if(x instanceof Promise&&p?.async===!1)throw new ae;if(_||x instanceof Promise)_=(_??Promise.resolve()).then(async()=>{if(await x,i.issues.length===A)return;if(!l)l=he(i,A)});else{if(i.issues.length===A)continue;if(!l)l=he(i,A)}}if(_)return _.then(()=>i);return i},s=(i,u,p)=>{if(he(i))return i.aborted=!0,i;let l=o(u,n,p);if(l instanceof Promise){if(p.async===!1)throw new ae;return l.then((_)=>e._zod.parse(_,p))}return e._zod.parse(l,p)};e._zod.run=(i,u)=>{if(u.skipChecks)return e._zod.parse(i,u);if(u.direction==="backward"){let l=e._zod.parse({value:i.value,issues:[]},{...u,skipChecks:!0});if(l instanceof Promise)return l.then((_)=>s(_,i,u));return s(l,i,u)}let p=e._zod.parse(i,u);if(p instanceof Promise){if(u.async===!1)throw new ae;return p.then((l)=>o(l,n,u))}return o(p,n,u)}}O(e,"~standard",()=>({validate:(o)=>{try{let s=xn(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return yn(e,o).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),at=m("$ZodString",(e,t)=>{T.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Kn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),j=m("$ZodStringFormat",(e,t)=>{Ue.init(e,t),at.init(e,t)}),ko=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=In),j.init(e,t)}),Zo=m("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mt(n))}else t.pattern??(t.pattern=Mt());j.init(e,t)}),Oo=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=jn),j.init(e,t)}),Eo=m("$ZodURL",(e,t)=>{j.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===vn.source){if(!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}}let o=new URL(n);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(o.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(t.normalize)r.value=o.href;else r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Po=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fn()),j.init(e,t)}),Ro=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Nn),j.init(e,t)}),Co=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=On),j.init(e,t)}),No=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=En),j.init(e,t)}),To=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pn),j.init(e,t)}),Io=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rn),j.init(e,t)}),jo=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cn),j.init(e,t)}),Fo=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Wn(t)),j.init(e,t)}),Do=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bn),j.init(e,t)}),Lo=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gn(t)),j.init(e,t)}),Uo=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Tn),j.init(e,t)}),Mo=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dn),j.init(e,t),e._zod.bag.format="ipv4"}),Vo=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ln),j.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var vo=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Un),j.init(e,t)}),qo=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mn),j.init(e,t),e._zod.check=(r)=>{let n=r.value.split("/");try{if(n.length!==2)throw Error();let[o,s]=n;if(!s)throw Error();let i=Number(s);if(`${i}`!==s)throw Error();if(i<0||i>128)throw Error();new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Jo(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Bo=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vn),j.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(Jo(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function pc(e){if(!Vt.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Jo(r)}var Ho=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vt),j.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(pc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Go=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qn),j.init(e,t)});function lc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Wo=m("$ZodJWT",(e,t)=>{j.init(e,t),e._zod.check=(r)=>{if(lc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Gt=m("$ZodNumber",(e,t)=>{T.init(e,t),e._zod.pattern=e._zod.bag.pattern??vt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ko=m("$ZodNumberFormat",(e,t)=>{oo.init(e,t),Gt.init(e,t)}),Yo=m("$ZodBoolean",(e,t)=>{T.init(e,t),e._zod.pattern=Qn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Qo=m("$ZodNull",(e,t)=>{T.init(e,t),e._zod.pattern=Xn,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;if(o===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var Xo=m("$ZodUnknown",(e,t)=>{T.init(e,t),e._zod.parse=(r)=>r}),es=m("$ZodNever",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),ts=m("$ZodVoid",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(typeof o>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}});function xo(e,t,r){if(e.issues.length)t.issues.push(...pe(r,e.issues));t.value[r]=e.value}var rs=m("$ZodArray",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let u=o[i],p=t.element._zod.run({value:u,issues:[]},n);if(p instanceof Promise)s.push(p.then((l)=>xo(l,r,i)));else xo(p,r,i)}if(s.length)return Promise.all(s).then(()=>r);return r}});function it(e,t,r,n,o,s){let i=r in n;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...pe(r,e.issues))}if(!i&&!o){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i)t.value[r]=void 0}else t.value[r]=e.value}function ns(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let r=fn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function os(e,t,r,n,o,s){let i=[],u=o.keySet,p=o.catchall._zod,l=p.def.type,_=p.optin==="optional",y=p.optout==="optional";for(let A in t){if(A==="__proto__")continue;if(u.has(A))continue;if(l==="never"){i.push(A);continue}let x=p.run({value:t[A],issues:[]},n);if(x instanceof Promise)e.push(x.then((z)=>it(z,r,A,t,_,y)));else it(x,r,A,t,_,y)}if(i.length)r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var fc=m("$ZodObject",(e,t)=>{if(T.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:()=>{let p={...u};return Object.defineProperty(t,"shape",{value:p}),p}})}let n=Fe(()=>ns(t));O(e._zod,"propValues",()=>{let u=t.shape,p={};for(let l in u){let _=u[l]._zod;if(_.values){p[l]??(p[l]=new Set);for(let y of _.values)p[l].add(y)}}return p});let o=ke,s=t.catchall,i;e._zod.parse=(u,p)=>{i??(i=n.value);let l=u.value;if(!o(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;u.value={};let _=[],y=i.shape;for(let A of i.keys){let x=y[A],z=x._zod.optin==="optional",U=x._zod.optout==="optional",E=x._zod.run({value:l[A],issues:[]},p);if(E instanceof Promise)_.push(E.then((oe)=>it(oe,u,A,l,z,U)));else it(E,u,A,l,z,U)}if(!s)return _.length?Promise.all(_).then(()=>u):u;return os(_,l,u,p,n.value,e)}}),ss=m("$ZodObjectJIT",(e,t)=>{fc.init(e,t);let r=e._zod.parse,n=Fe(()=>ns(t)),o=(A)=>{let x=new Bt(["shape","payload","ctx"]),z=n.value,U=(re)=>{let M=Ft(re);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};x.write("const input = payload.value;");let E=Object.create(null),oe=0;for(let re of z.keys)E[re]=`key_${oe++}`;x.write("const newResult = {};");for(let re of z.keys){let M=E[re],W=Ft(re),br=A[re],$r=br?._zod?.optin==="optional",Ja=br?._zod?.optout==="optional";if(x.write(`const ${M} = ${U(re)};`),$r&&Ja)x.write(`
|
|
28
|
-
if (${
|
|
27
|
+
`))}}var _o={major:4,minor:4,patch:3};var j=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_o;let n=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,c,p)=>{let l=_e(i),h;for(let y of c){if(y._zod.def.when){if(mn(i))continue;if(!y._zod.def.when(i))continue}else if(l)continue;let A=i.issues.length,x=y._zod.check(i);if(x instanceof Promise&&p?.async===!1)throw new ae;if(h||x instanceof Promise)h=(h??Promise.resolve()).then(async()=>{if(await x,i.issues.length===A)return;if(!l)l=_e(i,A)});else{if(i.issues.length===A)continue;if(!l)l=_e(i,A)}}if(h)return h.then(()=>i);return i},s=(i,c,p)=>{if(_e(i))return i.aborted=!0,i;let l=o(c,n,p);if(l instanceof Promise){if(p.async===!1)throw new ae;return l.then((h)=>e._zod.parse(h,p))}return e._zod.parse(l,p)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let l=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((h)=>s(h,i,c));return s(l,i,c)}let p=e._zod.parse(i,c);if(p instanceof Promise){if(c.async===!1)throw new ae;return p.then((l)=>o(l,n,c))}return o(p,n,c)}}P(e,"~standard",()=>({validate:(o)=>{try{let s=xn(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return yn(e,o).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),ct=m("$ZodString",(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Wn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),D=m("$ZodStringFormat",(e,t)=>{Ve.init(e,t),ct.init(e,t)}),ko=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=In),D.init(e,t)}),Zo=m("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mt(n))}else t.pattern??(t.pattern=Mt());D.init(e,t)}),Oo=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=jn),D.init(e,t)}),Eo=m("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===Vn.source){if(!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}}let o=new URL(n);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(o.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(t.normalize)r.value=o.href;else r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Po=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fn()),D.init(e,t)}),Ro=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Nn),D.init(e,t)}),Co=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=On),D.init(e,t)}),No=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=En),D.init(e,t)}),To=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pn),D.init(e,t)}),Io=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rn),D.init(e,t)}),jo=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cn),D.init(e,t)}),Fo=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Kn(t)),D.init(e,t)}),Do=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bn),D.init(e,t)}),Lo=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gn(t)),D.init(e,t)}),Uo=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Tn),D.init(e,t)}),Mo=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dn),D.init(e,t),e._zod.bag.format="ipv4"}),vo=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ln),D.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var Vo=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Un),D.init(e,t)}),qo=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mn),D.init(e,t),e._zod.check=(r)=>{let n=r.value.split("/");try{if(n.length!==2)throw Error();let[o,s]=n;if(!s)throw Error();let i=Number(s);if(`${i}`!==s)throw Error();if(i<0||i>128)throw Error();new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Jo(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Bo=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=vn),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(Jo(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function fc(e){if(!vt.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Jo(r)}var Ho=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=vt),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(fc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Go=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qn),D.init(e,t)});function dc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Ko=m("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=(r)=>{if(dc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Gt=m("$ZodNumber",(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??Vt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Wo=m("$ZodNumberFormat",(e,t)=>{oo.init(e,t),Gt.init(e,t)}),Yo=m("$ZodBoolean",(e,t)=>{j.init(e,t),e._zod.pattern=Qn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Qo=m("$ZodNull",(e,t)=>{j.init(e,t),e._zod.pattern=Xn,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;if(o===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var Xo=m("$ZodUnknown",(e,t)=>{j.init(e,t),e._zod.parse=(r)=>r}),es=m("$ZodNever",(e,t)=>{j.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),ts=m("$ZodVoid",(e,t)=>{j.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(typeof o>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}});function xo(e,t,r){if(e.issues.length)t.issues.push(...le(r,e.issues));t.value[r]=e.value}var rs=m("$ZodArray",(e,t)=>{j.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let c=o[i],p=t.element._zod.run({value:c,issues:[]},n);if(p instanceof Promise)s.push(p.then((l)=>xo(l,r,i)));else xo(p,r,i)}if(s.length)return Promise.all(s).then(()=>r);return r}});function ut(e,t,r,n,o,s){let i=r in n;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...le(r,e.issues))}if(!i&&!o){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i)t.value[r]=void 0}else t.value[r]=e.value}function ns(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let r=fn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function os(e,t,r,n,o,s){let i=[],c=o.keySet,p=o.catchall._zod,l=p.def.type,h=p.optin==="optional",y=p.optout==="optional";for(let A in t){if(A==="__proto__")continue;if(c.has(A))continue;if(l==="never"){i.push(A);continue}let x=p.run({value:t[A],issues:[]},n);if(x instanceof Promise)e.push(x.then((z)=>ut(z,r,A,t,h,y)));else ut(x,r,A,t,h,y)}if(i.length)r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var mc=m("$ZodObject",(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let p={...c};return Object.defineProperty(t,"shape",{value:p}),p}})}let n=Ue(()=>ns(t));P(e._zod,"propValues",()=>{let c=t.shape,p={};for(let l in c){let h=c[l]._zod;if(h.values){p[l]??(p[l]=new Set);for(let y of h.values)p[l].add(y)}}return p});let o=Ee,s=t.catchall,i;e._zod.parse=(c,p)=>{i??(i=n.value);let l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let h=[],y=i.shape;for(let A of i.keys){let x=y[A],z=x._zod.optin==="optional",M=x._zod.optout==="optional",N=x._zod.run({value:l[A],issues:[]},p);if(N instanceof Promise)h.push(N.then((ie)=>ut(ie,c,A,l,z,M)));else ut(N,c,A,l,z,M)}if(!s)return h.length?Promise.all(h).then(()=>c):c;return os(h,l,c,p,n.value,e)}}),ss=m("$ZodObjectJIT",(e,t)=>{mc.init(e,t);let r=e._zod.parse,n=Ue(()=>ns(t)),o=(A)=>{let x=new Bt(["shape","payload","ctx"]),z=n.value,M=(oe)=>{let v=Ft(oe);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};x.write("const input = payload.value;");let N=Object.create(null),ie=0;for(let oe of z.keys)N[oe]=`key_${ie++}`;x.write("const newResult = {};");for(let oe of z.keys){let v=N[oe],W=Ft(oe),br=A[oe],$r=br?._zod?.optin==="optional",Ha=br?._zod?.optout==="optional";if(x.write(`const ${v} = ${M(oe)};`),$r&&Ha)x.write(`
|
|
28
|
+
if (${v}.issues.length) {
|
|
29
29
|
if (${W} in input) {
|
|
30
|
-
payload.issues = payload.issues.concat(${
|
|
30
|
+
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
|
|
31
31
|
...iss,
|
|
32
32
|
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
33
33
|
})));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
if (${
|
|
37
|
+
if (${v}.value === undefined) {
|
|
38
38
|
if (${W} in input) {
|
|
39
39
|
newResult[${W}] = undefined;
|
|
40
40
|
}
|
|
41
41
|
} else {
|
|
42
|
-
newResult[${W}] = ${
|
|
42
|
+
newResult[${W}] = ${v}.value;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
`);else if(!$r)x.write(`
|
|
46
|
-
const ${
|
|
47
|
-
if (${
|
|
48
|
-
payload.issues = payload.issues.concat(${
|
|
46
|
+
const ${v}_present = ${W} in input;
|
|
47
|
+
if (${v}.issues.length) {
|
|
48
|
+
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
|
|
49
49
|
...iss,
|
|
50
50
|
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
51
51
|
})));
|
|
52
52
|
}
|
|
53
|
-
if (!${
|
|
53
|
+
if (!${v}_present && !${v}.issues.length) {
|
|
54
54
|
payload.issues.push({
|
|
55
55
|
code: "invalid_type",
|
|
56
56
|
expected: "nonoptional",
|
|
@@ -59,38 +59,38 @@ Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,(o)=>{l
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
if (${
|
|
63
|
-
if (${
|
|
62
|
+
if (${v}_present) {
|
|
63
|
+
if (${v}.value === undefined) {
|
|
64
64
|
newResult[${W}] = undefined;
|
|
65
65
|
} else {
|
|
66
|
-
newResult[${W}] = ${
|
|
66
|
+
newResult[${W}] = ${v}.value;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
`);else x.write(`
|
|
71
|
-
if (${
|
|
72
|
-
payload.issues = payload.issues.concat(${
|
|
71
|
+
if (${v}.issues.length) {
|
|
72
|
+
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
|
|
73
73
|
...iss,
|
|
74
74
|
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
75
75
|
})));
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
if (${
|
|
78
|
+
if (${v}.value === undefined) {
|
|
79
79
|
if (${W} in input) {
|
|
80
80
|
newResult[${W}] = undefined;
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
|
-
newResult[${W}] = ${
|
|
83
|
+
newResult[${W}] = ${v}.value;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");let qa=x.compile();return(re,M)=>qa(A,re,M)},s,i=ke,u=!Se.jitless,l=u&&pn.value,_=t.catchall,y;e._zod.parse=(A,x)=>{y??(y=n.value);let z=A.value;if(!i(z))return A.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),A;if(u&&l&&x?.async===!1&&x.jitless!==!0){if(!s)s=o(t.shape);if(A=s(A,x),!_)return A;return os([],z,A,x,y,e)}return r(A,x)}});function yo(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter((s)=>!he(s));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>ee(i,n,X())))}),t}var Wt=m("$ZodUnion",(e,t)=>{T.init(e,t),O(e._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),O(e._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),O(e._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),O(e._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((o)=>o._zod.pattern);return new RegExp(`^(${n.map((o)=>Xe(o.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let u of t.options){let p=u._zod.run({value:n.value,issues:[]},o);if(p instanceof Promise)i.push(p),s=!0;else{if(p.issues.length===0)return p;i.push(p)}}if(!s)return yo(i,n,e,o);return Promise.all(i).then((u)=>yo(u,n,e,o))}});var is=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Wt.init(e,t);let r=e._zod.parse;O(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[u,p]of Object.entries(i)){if(!o[u])o[u]=new Set;for(let l of p)o[u].add(l)}}return o});let n=Fe(()=>{let o=t.options,s=new Map;for(let i of o){let u=i._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let p of u){if(s.has(p))throw Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!ke(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let u=n.value.get(i?.[t.discriminator]);if(u)return u._zod.run(o,s);if(t.unionFallback||s.direction==="backward")return r(o,s);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:i,path:[t.discriminator],inst:e}),o}}),as=m("$ZodIntersection",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([p,l])=>bo(r,p,l));return bo(r,s,i)}});function Ht(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(me(e)&&me(t)){let r=Object.keys(t),n=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),o={...e,...t};for(let s of n){let i=Ht(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=Ht(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function bo(e,t,r){let n=new Map,o;for(let u of t.issues)if(u.code==="unrecognized_keys"){o??(o=u);for(let p of u.keys){if(!n.has(p))n.set(p,{});n.get(p).l=!0}}else e.issues.push(u);for(let u of r.issues)if(u.code==="unrecognized_keys")for(let p of u.keys){if(!n.has(p))n.set(p,{});n.get(p).r=!0}else e.issues.push(u);let s=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(s.length&&o)e.issues.push({...o,keys:s});if(he(e))return e;let i=Ht(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var us=m("$ZodRecord",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!me(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],i=t.keyType._zod.values;if(i){r.value={};let u=new Set;for(let l of i)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){u.add(typeof l==="number"?l.toString():l);let _=t.keyType._zod.run({value:l,issues:[]},n);if(_ instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(_.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:_.issues.map((x)=>ee(x,n,X())),input:l,path:[l],inst:e});continue}let y=_.value,A=t.valueType._zod.run({value:o[l],issues:[]},n);if(A instanceof Promise)s.push(A.then((x)=>{if(x.issues.length)r.issues.push(...pe(l,x.issues));r.value[y]=x.value}));else{if(A.issues.length)r.issues.push(...pe(l,A.issues));r.value[y]=A.value}}let p;for(let l in o)if(!u.has(l))p=p??[],p.push(l);if(p&&p.length>0)r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:p})}else{r.value={};for(let u of Reflect.ownKeys(o)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(o,u))continue;let p=t.keyType._zod.run({value:u,issues:[]},n);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&vt.test(u)&&p.issues.length){let y=t.keyType._zod.run({value:Number(u),issues:[]},n);if(y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(y.issues.length===0)p=y}if(p.issues.length){if(t.mode==="loose")r.value[u]=o[u];else r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map((y)=>ee(y,n,X())),input:u,path:[u],inst:e});continue}let _=t.valueType._zod.run({value:o[u],issues:[]},n);if(_ instanceof Promise)s.push(_.then((y)=>{if(y.issues.length)r.issues.push(...pe(u,y.issues));r.value[p.value]=y.value}));else{if(_.issues.length)r.issues.push(...pe(u,_.issues));r.value[p.value]=_.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var cs=m("$ZodEnum",(e,t)=>{T.init(e,t);let r=Ye(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter((o)=>ln.has(typeof o)).map((o)=>typeof o==="string"?ce(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let i=o.value;if(n.has(i))return o;return o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),ps=m("$ZodLiteral",(e,t)=>{if(T.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?ce(n):n?ce(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;if(r.has(s))return n;return n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var ls=m("$ZodTransform",(e,t)=>{T.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ie(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new ae;return r.value=o,r.fallback=!0,r}});function $o(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var Kt=m("$ZodOptional",(e,t)=>{T.init(e,t),e._zod.optin="optional",e._zod.optout="optional",O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),O(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xe(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=r.value,s=t.innerType._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>$o(i,o));return $o(s,o)}if(r.value===void 0)return r;return t.innerType._zod.run(r,n)}}),fs=m("$ZodExactOptional",(e,t)=>{Kt.init(e,t),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ds=m("$ZodNullable",(e,t)=>{T.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xe(r.source)}|null)$`):void 0}),O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),ms=m("$ZodDefault",(e,t)=>{T.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>Ao(s,t));return Ao(o,t)}});function Ao(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var hs=m("$ZodPrefault",(e,t)=>{T.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),gs=m("$ZodNonOptional",(e,t)=>{T.init(e,t),O(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>wo(s,e));return wo(o,e)}});function wo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var _s=m("$ZodCatch",(e,t)=>{T.init(e,t),e._zod.optin="optional",O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>{if(r.value=s.value,s.issues.length)r.value=t.catchValue({...r,error:{issues:s.issues.map((i)=>ee(i,n,X()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>ee(s,n,X()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var Yt=m("$ZodPipe",(e,t)=>{T.init(e,t),O(e._zod,"values",()=>t.in._zod.values),O(e._zod,"optin",()=>t.in._zod.optin),O(e._zod,"optout",()=>t.out._zod.optout),O(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>st(i,t.in,n));return st(s,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>st(s,t.out,n));return st(o,t.out,n)}});function st(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var xs=m("$ZodPreprocess",(e,t)=>{Yt.init(e,t)}),ys=m("$ZodReadonly",(e,t)=>{T.init(e,t),O(e._zod,"propValues",()=>t.innerType._zod.propValues),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"optin",()=>t.innerType?._zod?.optin),O(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(zo);return zo(o)}});function zo(e){return e.value=Object.freeze(e.value),e}var bs=m("$ZodCustom",(e,t)=>{K.init(e,t),T.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((s)=>So(s,r,n,e));So(o,r,n,e);return}});function So(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(ge(o))}}var $s,Km=Symbol("ZodOutput"),Ym=Symbol("ZodInput");class As{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function dc(){return new As}($s=globalThis).__zod_globalRegistry??($s.__zod_globalRegistry=dc());var _e=globalThis.__zod_globalRegistry;function ws(e,t){return new e({type:"string",...w(t)})}function zs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function Qt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function Ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(t)})}function Zs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(t)})}function Os(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function Es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function Ps(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function Rs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function Cs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function Ns(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function Ts(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function Is(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function js(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function Fs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function Ds(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function Ls(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function Us(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function Ms(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function Vs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function vs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function qs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function Js(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function Bs(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function Hs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Gs(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Ws(e,t){return new e({type:"number",checks:[],...w(t)})}function Ks(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Ys(e,t){return new e({type:"boolean",...w(t)})}function Qs(e,t){return new e({type:"null",...w(t)})}function Xs(e){return new e({type:"unknown"})}function ei(e,t){return new e({type:"never",...w(t)})}function ti(e,t){return new e({type:"void",...w(t)})}function ut(e,t){return new qt({check:"less_than",...w(t),value:e,inclusive:!1})}function Me(e,t){return new qt({check:"less_than",...w(t),value:e,inclusive:!0})}function ct(e,t){return new Jt({check:"greater_than",...w(t),value:e,inclusive:!1})}function Ve(e,t){return new Jt({check:"greater_than",...w(t),value:e,inclusive:!0})}function pt(e,t){return new no({check:"multiple_of",...w(t),value:e})}function lt(e,t){return new so({check:"max_length",...w(t),maximum:e})}function Ze(e,t){return new io({check:"min_length",...w(t),minimum:e})}function ft(e,t){return new ao({check:"length_equals",...w(t),length:e})}function Xt(e,t){return new uo({check:"string_format",format:"regex",...w(t),pattern:e})}function er(e){return new co({check:"string_format",format:"lowercase",...w(e)})}function tr(e){return new po({check:"string_format",format:"uppercase",...w(e)})}function rr(e,t){return new lo({check:"string_format",format:"includes",...w(t),includes:e})}function nr(e,t){return new fo({check:"string_format",format:"starts_with",...w(t),prefix:e})}function or(e,t){return new mo({check:"string_format",format:"ends_with",...w(t),suffix:e})}function fe(e){return new ho({check:"overwrite",tx:e})}function sr(e){return fe((t)=>t.normalize(e))}function ir(){return fe((e)=>e.trim())}function ar(){return fe((e)=>e.toLowerCase())}function ur(){return fe((e)=>e.toUpperCase())}function cr(){return fe((e)=>cn(e))}function ri(e,t,r){return new e({type:"array",element:t,...w(r)})}function ni(e,t,r){return new e({type:"custom",check:"custom",fn:t,...w(r)})}function oi(e,t){let r=mc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(ge(o,n.value,r._zod.def));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(ge(s))}},e(n.value,n)),t);return r}function mc(e,t){let r=new K({check:"custom",...w(t)});return r._zod.check=e,r}function pr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??_e,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function v(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let u=e._zod.toJSONSchema?.();if(u)i.schema=u;else{let _={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,_);else{let A=i.schema,x=t.processors[o.type];if(!x)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,A,_)}let y=e._zod.parent;if(y){if(!i.ref)i.ref=y;v(y,t,_),t.seen.get(y).isParent=!0}}let p=t.metadataRegistry.get(e);if(p)Object.assign(i.schema,p);if(t.io==="input"&&Y(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(n=i.schema).default??(n.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function lr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of e.seen.entries()){let u=e.metadataRegistry.get(i[0])?.id;if(u){let p=n.get(u);if(p&&p!==i[0])throw Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,i[0])}}let o=(i)=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let y=e.external.registry.get(i[0])?.id,A=e.external.uri??((z)=>z);if(y)return{ref:A(y)};let x=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=x,{defId:x,ref:`${A("__shared")}#/${u}/${x}`}}if(i[1]===r)return{ref:"#"};let l=`${"#"}/${u}/`,_=i[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:l+_}},s=(i)=>{if(i[1].schema.$ref)return;let u=i[1],{ref:p,defId:l}=o(i);if(u.def={...u.schema},l)u.defId=l;let _=u.schema;for(let y in _)delete _[y];_.$ref=p};if(e.cycles==="throw")for(let i of e.seen.entries()){let u=i[1];if(u.cycle)throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
86
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");let Ba=x.compile();return(oe,v)=>Ba(A,oe,v)},s,i=Ee,c=!Oe.jitless,l=c&&pn.value,h=t.catchall,y;e._zod.parse=(A,x)=>{y??(y=n.value);let z=A.value;if(!i(z))return A.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),A;if(c&&l&&x?.async===!1&&x.jitless!==!0){if(!s)s=o(t.shape);if(A=s(A,x),!h)return A;return os([],z,A,x,y,e)}return r(A,x)}});function yo(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter((s)=>!_e(s));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>re(i,n,te())))}),t}var Kt=m("$ZodUnion",(e,t)=>{j.init(e,t),P(e._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),P(e._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),P(e._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),P(e._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((o)=>o._zod.pattern);return new RegExp(`^(${n.map((o)=>tt(o.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let c of t.options){let p=c._zod.run({value:n.value,issues:[]},o);if(p instanceof Promise)i.push(p),s=!0;else{if(p.issues.length===0)return p;i.push(p)}}if(!s)return yo(i,n,e,o);return Promise.all(i).then((c)=>yo(c,n,e,o))}});var is=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kt.init(e,t);let r=e._zod.parse;P(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,p]of Object.entries(i)){if(!o[c])o[c]=new Set;for(let l of p)o[c].add(l)}}return o});let n=Ue(()=>{let o=t.options,s=new Map;for(let i of o){let c=i._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let p of c){if(s.has(p))throw Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!Ee(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let c=n.value.get(i?.[t.discriminator]);if(c)return c._zod.run(o,s);if(t.unionFallback||s.direction==="backward")return r(o,s);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:i,path:[t.discriminator],inst:e}),o}}),as=m("$ZodIntersection",(e,t)=>{j.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([p,l])=>bo(r,p,l));return bo(r,s,i)}});function Ht(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ge(e)&&ge(t)){let r=Object.keys(t),n=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),o={...e,...t};for(let s of n){let i=Ht(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=Ht(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function bo(e,t,r){let n=new Map,o;for(let c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(let p of c.keys){if(!n.has(p))n.set(p,{});n.get(p).l=!0}}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let p of c.keys){if(!n.has(p))n.set(p,{});n.get(p).r=!0}else e.issues.push(c);let s=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o)e.issues.push({...o,keys:s});if(_e(e))return e;let i=Ht(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var us=m("$ZodRecord",(e,t)=>{j.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ge(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],i=t.keyType._zod.values;if(i){r.value={};let c=new Set;for(let l of i)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){c.add(typeof l==="number"?l.toString():l);let h=t.keyType._zod.run({value:l,issues:[]},n);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map((x)=>re(x,n,te())),input:l,path:[l],inst:e});continue}let y=h.value,A=t.valueType._zod.run({value:o[l],issues:[]},n);if(A instanceof Promise)s.push(A.then((x)=>{if(x.issues.length)r.issues.push(...le(l,x.issues));r.value[y]=x.value}));else{if(A.issues.length)r.issues.push(...le(l,A.issues));r.value[y]=A.value}}let p;for(let l in o)if(!c.has(l))p=p??[],p.push(l);if(p&&p.length>0)r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:p})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(o,c))continue;let p=t.keyType._zod.run({value:c,issues:[]},n);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&Vt.test(c)&&p.issues.length){let y=t.keyType._zod.run({value:Number(c),issues:[]},n);if(y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(y.issues.length===0)p=y}if(p.issues.length){if(t.mode==="loose")r.value[c]=o[c];else r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map((y)=>re(y,n,te())),input:c,path:[c],inst:e});continue}let h=t.valueType._zod.run({value:o[c],issues:[]},n);if(h instanceof Promise)s.push(h.then((y)=>{if(y.issues.length)r.issues.push(...le(c,y.issues));r.value[p.value]=y.value}));else{if(h.issues.length)r.issues.push(...le(c,h.issues));r.value[p.value]=h.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var cs=m("$ZodEnum",(e,t)=>{j.init(e,t);let r=Xe(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter((o)=>ln.has(typeof o)).map((o)=>typeof o==="string"?pe(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let i=o.value;if(n.has(i))return o;return o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),ps=m("$ZodLiteral",(e,t)=>{if(j.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?pe(n):n?pe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;if(r.has(s))return n;return n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var ls=m("$ZodTransform",(e,t)=>{j.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new De(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new ae;return r.value=o,r.fallback=!0,r}});function $o(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var Wt=m("$ZodOptional",(e,t)=>{j.init(e,t),e._zod.optin="optional",e._zod.optout="optional",P(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),P(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${tt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=r.value,s=t.innerType._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>$o(i,o));return $o(s,o)}if(r.value===void 0)return r;return t.innerType._zod.run(r,n)}}),fs=m("$ZodExactOptional",(e,t)=>{Wt.init(e,t),P(e._zod,"values",()=>t.innerType._zod.values),P(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ds=m("$ZodNullable",(e,t)=>{j.init(e,t),P(e._zod,"optin",()=>t.innerType._zod.optin),P(e._zod,"optout",()=>t.innerType._zod.optout),P(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${tt(r.source)}|null)$`):void 0}),P(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),ms=m("$ZodDefault",(e,t)=>{j.init(e,t),e._zod.optin="optional",P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>Ao(s,t));return Ao(o,t)}});function Ao(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var hs=m("$ZodPrefault",(e,t)=>{j.init(e,t),e._zod.optin="optional",P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),gs=m("$ZodNonOptional",(e,t)=>{j.init(e,t),P(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>wo(s,e));return wo(o,e)}});function wo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var _s=m("$ZodCatch",(e,t)=>{j.init(e,t),e._zod.optin="optional",P(e._zod,"optout",()=>t.innerType._zod.optout),P(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>{if(r.value=s.value,s.issues.length)r.value=t.catchValue({...r,error:{issues:s.issues.map((i)=>re(i,n,te()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>re(s,n,te()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var Yt=m("$ZodPipe",(e,t)=>{j.init(e,t),P(e._zod,"values",()=>t.in._zod.values),P(e._zod,"optin",()=>t.in._zod.optin),P(e._zod,"optout",()=>t.out._zod.optout),P(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>at(i,t.in,n));return at(s,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>at(s,t.out,n));return at(o,t.out,n)}});function at(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var xs=m("$ZodPreprocess",(e,t)=>{Yt.init(e,t)}),ys=m("$ZodReadonly",(e,t)=>{j.init(e,t),P(e._zod,"propValues",()=>t.innerType._zod.propValues),P(e._zod,"values",()=>t.innerType._zod.values),P(e._zod,"optin",()=>t.innerType?._zod?.optin),P(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(zo);return zo(o)}});function zo(e){return e.value=Object.freeze(e.value),e}var bs=m("$ZodCustom",(e,t)=>{Y.init(e,t),j.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((s)=>So(s,r,n,e));So(o,r,n,e);return}});function So(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(xe(o))}}var $s,oh=Symbol("ZodOutput"),sh=Symbol("ZodInput");class As{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function hc(){return new As}($s=globalThis).__zod_globalRegistry??($s.__zod_globalRegistry=hc());var ye=globalThis.__zod_globalRegistry;function ws(e,t){return new e({type:"string",...w(t)})}function zs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function Qt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function Ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(t)})}function Zs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(t)})}function Os(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function Es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function Ps(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function Rs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function Cs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function Ns(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function Ts(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function Is(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function js(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function Fs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function Ds(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function Ls(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function Us(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function Ms(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function vs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function Vs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function qs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function Js(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function Bs(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function Hs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Gs(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Ks(e,t){return new e({type:"number",checks:[],...w(t)})}function Ws(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Ys(e,t){return new e({type:"boolean",...w(t)})}function Qs(e,t){return new e({type:"null",...w(t)})}function Xs(e){return new e({type:"unknown"})}function ei(e,t){return new e({type:"never",...w(t)})}function ti(e,t){return new e({type:"void",...w(t)})}function pt(e,t){return new qt({check:"less_than",...w(t),value:e,inclusive:!1})}function qe(e,t){return new qt({check:"less_than",...w(t),value:e,inclusive:!0})}function lt(e,t){return new Jt({check:"greater_than",...w(t),value:e,inclusive:!1})}function Je(e,t){return new Jt({check:"greater_than",...w(t),value:e,inclusive:!0})}function ft(e,t){return new no({check:"multiple_of",...w(t),value:e})}function dt(e,t){return new so({check:"max_length",...w(t),maximum:e})}function Pe(e,t){return new io({check:"min_length",...w(t),minimum:e})}function mt(e,t){return new ao({check:"length_equals",...w(t),length:e})}function Xt(e,t){return new uo({check:"string_format",format:"regex",...w(t),pattern:e})}function er(e){return new co({check:"string_format",format:"lowercase",...w(e)})}function tr(e){return new po({check:"string_format",format:"uppercase",...w(e)})}function rr(e,t){return new lo({check:"string_format",format:"includes",...w(t),includes:e})}function nr(e,t){return new fo({check:"string_format",format:"starts_with",...w(t),prefix:e})}function or(e,t){return new mo({check:"string_format",format:"ends_with",...w(t),suffix:e})}function de(e){return new ho({check:"overwrite",tx:e})}function sr(e){return de((t)=>t.normalize(e))}function ir(){return de((e)=>e.trim())}function ar(){return de((e)=>e.toLowerCase())}function ur(){return de((e)=>e.toUpperCase())}function cr(){return de((e)=>cn(e))}function ri(e,t,r){return new e({type:"array",element:t,...w(r)})}function ni(e,t,r){return new e({type:"custom",check:"custom",fn:t,...w(r)})}function oi(e,t){let r=gc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(xe(o,n.value,r._zod.def));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(xe(s))}},e(n.value,n)),t);return r}function gc(e,t){let r=new Y({check:"custom",...w(t)});return r._zod.check=e,r}function pr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??ye,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function G(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let h={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{let A=i.schema,x=t.processors[o.type];if(!x)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,A,h)}let y=e._zod.parent;if(y){if(!i.ref)i.ref=y;G(y,t,h),t.seen.get(y).isParent=!0}}let p=t.metadataRegistry.get(e);if(p)Object.assign(i.schema,p);if(t.io==="input"&&Q(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(n=i.schema).default??(n.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function lr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let p=n.get(c);if(p&&p!==i[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,i[0])}}let o=(i)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let y=e.external.registry.get(i[0])?.id,A=e.external.uri??((z)=>z);if(y)return{ref:A(y)};let x=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=x,{defId:x,ref:`${A("__shared")}#/${c}/${x}`}}if(i[1]===r)return{ref:"#"};let l=`${"#"}/${c}/`,h=i[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:l+h}},s=(i)=>{if(i[1].schema.$ref)return;let c=i[1],{ref:p,defId:l}=o(i);if(c.def={...c.schema},l)c.defId=l;let h=c.schema;for(let y in h)delete h[y];h.$ref=p};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
87
87
|
|
|
88
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let u=i[1];if(t===i[0]){s(i);continue}if(e.external){let l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(u.cycle){s(i);continue}if(u.count>1){if(e.reused==="ref"){s(i);continue}}}}function fr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(u)=>{let p=e.seen.get(u);if(p.ref===null)return;let l=p.def??p.schema,_={...l},y=p.ref;if(p.ref=null,y){n(y);let x=e.seen.get(y),z=x.schema;if(z.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(z);else Object.assign(l,z);if(Object.assign(l,_),u._zod.parent===y)for(let E in l){if(E==="$ref"||E==="allOf")continue;if(!(E in _))delete l[E]}if(z.$ref&&x.def)for(let E in l){if(E==="$ref"||E==="allOf")continue;if(E in x.def&&JSON.stringify(l[E])===JSON.stringify(x.def[E]))delete l[E]}}let A=u._zod.parent;if(A&&A!==y){n(A);let x=e.seen.get(A);if(x?.schema.$ref){if(l.$ref=x.schema.$ref,x.def)for(let z in l){if(z==="$ref"||z==="allOf")continue;if(z in x.def&&JSON.stringify(l[z])===JSON.stringify(x.def[z]))delete l[z]}}}e.override({zodSchema:u,jsonSchema:l,path:p.path??[]})};for(let u of[...e.seen.entries()].reverse())n(u[0]);let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Object.assign(o,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&o.id===s)delete o.id;let i=e.external?.defs??{};for(let u of e.seen.entries()){let p=u[1];if(p.def&&p.defId){if(p.def.id===p.defId)delete p.def.id;i[p.defId]=p.def}}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:ve(t,"input",e.processors),output:ve(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch(u){throw Error("Error converting schema to JSON.")}}function Y(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Y(n.element,r);if(n.type==="set")return Y(n.valueType,r);if(n.type==="lazy")return Y(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Y(n.innerType,r);if(n.type==="intersection")return Y(n.left,r)||Y(n.right,r);if(n.type==="record"||n.type==="map")return Y(n.keyType,r)||Y(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Y(n.in,r)||Y(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(Y(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Y(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Y(o,r))return!0;if(n.rest&&Y(n.rest,r))return!0;return!1}return!1}var si=(e,t={})=>(r)=>{let n=pr({...r,processors:t});return v(e,n),lr(n,e),fr(n,e)},ve=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:s}=n??{},i=pr({...o??{},target:s,io:t,processors:r});return v(e,i),lr(i,e),fr(i,e)};var hc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ii=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:u,patterns:p,contentEncoding:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof i==="number")o.maxLength=i;if(u){if(o.format=hc[u]??u,o.format==="")delete o.format;if(u==="time")delete o.format}if(l)o.contentEncoding=l;if(p&&p.size>0){let _=[...p];if(_.length===1)o.pattern=_[0].source;else if(_.length>1)o.allOf=[..._.map((y)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))]}},ai=(e,t,r,n)=>{let o=r,{minimum:s,maximum:i,format:u,multipleOf:p,exclusiveMaximum:l,exclusiveMinimum:_}=e._zod.bag;if(typeof u==="string"&&u.includes("int"))o.type="integer";else o.type="number";let y=typeof _==="number"&&_>=(s??Number.NEGATIVE_INFINITY),A=typeof l==="number"&&l<=(i??Number.POSITIVE_INFINITY),x=t.target==="draft-04"||t.target==="openapi-3.0";if(y)if(x)o.minimum=_,o.exclusiveMinimum=!0;else o.exclusiveMinimum=_;else if(typeof s==="number")o.minimum=s;if(A)if(x)o.maximum=l,o.exclusiveMaximum=!0;else o.exclusiveMaximum=l;else if(typeof i==="number")o.maximum=i;if(typeof p==="number")o.multipleOf=p},ui=(e,t,r,n)=>{r.type="boolean"};var ci=(e,t,r,n)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var pi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},li=(e,t,r,n)=>{r.not={}};var fi=(e,t,r,n)=>{};var di=(e,t,r,n)=>{let o=e._zod.def,s=Ye(o.entries);if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},mi=(e,t,r,n)=>{let o=e._zod.def,s=[];for(let i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(i));else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}};var hi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var gi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var _i=(e,t,r,n)=>{let o=r,s=e._zod.def,{minimum:i,maximum:u}=e._zod.bag;if(typeof i==="number")o.minItems=i;if(typeof u==="number")o.maxItems=u;o.type="array",o.items=v(s.element,t,{...n,path:[...n.path,"items"]})},xi=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object",o.properties={};let i=s.shape;for(let l in i)o.properties[l]=v(i[l],t,{...n,path:[...n.path,"properties",l]});let u=new Set(Object.keys(i)),p=new Set([...u].filter((l)=>{let _=s.shape[l]._zod;if(t.io==="input")return _.optin===void 0;else return _.optout===void 0}));if(p.size>0)o.required=Array.from(p);if(s.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")o.additionalProperties=!1}else if(s.catchall)o.additionalProperties=v(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},yi=(e,t,r,n)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((u,p)=>v(u,t,{...n,path:[...n.path,s?"oneOf":"anyOf",p]}));if(s)r.oneOf=i;else r.anyOf=i},bi=(e,t,r,n)=>{let o=e._zod.def,s=v(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=v(o.right,t,{...n,path:[...n.path,"allOf",1]}),u=(l)=>("allOf"in l)&&Object.keys(l).length===1,p=[...u(s)?s.allOf:[s],...u(i)?i.allOf:[i]];r.allOf=p};var $i=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object";let i=s.keyType,p=i._zod.bag?.patterns;if(s.mode==="loose"&&p&&p.size>0){let _=v(s.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let y of p)o.patternProperties[y.source]=_}else{if(t.target==="draft-07"||t.target==="draft-2020-12")o.propertyNames=v(s.keyType,t,{...n,path:[...n.path,"propertyNames"]});o.additionalProperties=v(s.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let l=i._zod.values;if(l){let _=[...l].filter((y)=>typeof y==="string"||typeof y==="number");if(_.length>0)o.required=_}},Ai=(e,t,r,n)=>{let o=e._zod.def,s=v(o.innerType,t,n),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=o.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},wi=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType},zi=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Si=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);if(s.ref=o.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(o.defaultValue))},ki=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},Zi=(e,t,r,n)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;v(i,t,n);let u=t.seen.get(e);u.ref=i},Oi=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0};var dr=(e,t,r,n)=>{let o=e._zod.def;v(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType};var Ac=m("ZodISODateTime",(e,t)=>{Fo.init(e,t),D.init(e,t)});function Ei(e){return Js(Ac,e)}var wc=m("ZodISODate",(e,t)=>{Do.init(e,t),D.init(e,t)});function Pi(e){return Bs(wc,e)}var zc=m("ZodISOTime",(e,t)=>{Lo.init(e,t),D.init(e,t)});function Ri(e){return Hs(zc,e)}var Sc=m("ZodISODuration",(e,t)=>{Uo.init(e,t),D.init(e,t)});function Ci(e){return Gs(Sc,e)}var Oc=(e,t)=>{tt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>_n(e,r)},flatten:{value:(r)=>gn(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,je,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,je,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Q=m("ZodError",Oc,{Parent:Error});var Ni=rt(Q),Ti=nt(Q),Ii=De(Q),ji=Le(Q),Fi=bn(Q),Di=$n(Q),Li=An(Q),Ui=wn(Q),Mi=zn(Q),Vi=Sn(Q),vi=kn(Q),qi=Zn(Q);var Ji=new WeakMap;function qe(e,t,r){let n=Object.getPrototypeOf(e),o=Ji.get(n);if(!o)o=new Set,Ji.set(n,o);if(o.has(t))return;o.add(t);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let u=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:u}),u},set(u){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:u})}})}}var F=m("ZodType",(e,t)=>(T.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ve(e,"input"),output:ve(e,"output")}}),e.toJSONSchema=si(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Ni(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ii(e,r,n),e.parseAsync=async(r,n)=>Ti(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ji(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Fi(e,r,n),e.decode=(r,n)=>Di(e,r,n),e.encodeAsync=async(r,n)=>Li(e,r,n),e.decodeAsync=async(r,n)=>Ui(e,r,n),e.safeEncode=(r,n)=>Mi(e,r,n),e.safeDecode=(r,n)=>Vi(e,r,n),e.safeEncodeAsync=async(r,n)=>vi(e,r,n),e.safeDecodeAsync=async(r,n)=>qi(e,r,n),qe(e,"ZodType",{check(...r){let n=this.def;return this.clone(ue(n,{checks:[...n.checks??[],...r.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return ne(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check($p(r,n))},superRefine(r,n){return this.check(Ap(r,n))},overwrite(r){return this.check(fe(r))},optional(){return a(this)},exactOptional(){return up(this)},nullable(){return Wi(this)},nullish(){return a(Wi(this))},nonoptional(r){return mp(this,r)},array(){return C(this)},or(r){return f([this,r])},and(r){return op(this,r)},transform(r){return Ki(this,ta(r))},default(r){return lp(this,r)},prefault(r){return dp(this,r)},catch(r){return gp(this,r)},pipe(r){return Ki(this,r)},readonly(){return yp(this)},describe(r){let n=this.clone();return _e.add(n,{description:r}),n},meta(...r){if(r.length===0)return _e.get(this);let n=this.clone();return _e.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return _e.get(e)?.description},configurable:!0}),e)),Yi=m("_ZodString",(e,t)=>{at.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ii(e,n,o,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,qe(e,"_ZodString",{regex(...n){return this.check(Xt(...n))},includes(...n){return this.check(rr(...n))},startsWith(...n){return this.check(nr(...n))},endsWith(...n){return this.check(or(...n))},min(...n){return this.check(Ze(...n))},max(...n){return this.check(lt(...n))},length(...n){return this.check(ft(...n))},nonempty(...n){return this.check(Ze(1,...n))},lowercase(n){return this.check(er(n))},uppercase(n){return this.check(tr(n))},trim(){return this.check(ir())},normalize(...n){return this.check(sr(...n))},toLowerCase(){return this.check(ar())},toUpperCase(){return this.check(ur())},slugify(){return this.check(cr())}})}),Pc=m("ZodString",(e,t)=>{at.init(e,t),Yi.init(e,t),e.email=(r)=>e.check(zs(Rc,r)),e.url=(r)=>e.check(Es(Cc,r)),e.jwt=(r)=>e.check(qs(Hc,r)),e.emoji=(r)=>e.check(Ps(Nc,r)),e.guid=(r)=>e.check(Qt(Bi,r)),e.uuid=(r)=>e.check(Ss(mt,r)),e.uuidv4=(r)=>e.check(ks(mt,r)),e.uuidv6=(r)=>e.check(Zs(mt,r)),e.uuidv7=(r)=>e.check(Os(mt,r)),e.nanoid=(r)=>e.check(Rs(Tc,r)),e.guid=(r)=>e.check(Qt(Bi,r)),e.cuid=(r)=>e.check(Cs(Ic,r)),e.cuid2=(r)=>e.check(Ns(jc,r)),e.ulid=(r)=>e.check(Ts(Fc,r)),e.base64=(r)=>e.check(Ms(qc,r)),e.base64url=(r)=>e.check(Vs(Jc,r)),e.xid=(r)=>e.check(Is(Dc,r)),e.ksuid=(r)=>e.check(js(Lc,r)),e.ipv4=(r)=>e.check(Fs(Uc,r)),e.ipv6=(r)=>e.check(Ds(Mc,r)),e.cidrv4=(r)=>e.check(Ls(Vc,r)),e.cidrv6=(r)=>e.check(Us(vc,r)),e.e164=(r)=>e.check(vs(Bc,r)),e.datetime=(r)=>e.check(Ei(r)),e.date=(r)=>e.check(Pi(r)),e.time=(r)=>e.check(Ri(r)),e.duration=(r)=>e.check(Ci(r))});function c(e){return ws(Pc,e)}var D=m("ZodStringFormat",(e,t)=>{j.init(e,t),Yi.init(e,t)}),Rc=m("ZodEmail",(e,t)=>{Oo.init(e,t),D.init(e,t)});var Bi=m("ZodGUID",(e,t)=>{ko.init(e,t),D.init(e,t)});var mt=m("ZodUUID",(e,t)=>{Zo.init(e,t),D.init(e,t)});var Cc=m("ZodURL",(e,t)=>{Eo.init(e,t),D.init(e,t)});var Nc=m("ZodEmoji",(e,t)=>{Po.init(e,t),D.init(e,t)});var Tc=m("ZodNanoID",(e,t)=>{Ro.init(e,t),D.init(e,t)});var Ic=m("ZodCUID",(e,t)=>{Co.init(e,t),D.init(e,t)});var jc=m("ZodCUID2",(e,t)=>{No.init(e,t),D.init(e,t)});var Fc=m("ZodULID",(e,t)=>{To.init(e,t),D.init(e,t)});var Dc=m("ZodXID",(e,t)=>{Io.init(e,t),D.init(e,t)});var Lc=m("ZodKSUID",(e,t)=>{jo.init(e,t),D.init(e,t)});var Uc=m("ZodIPv4",(e,t)=>{Mo.init(e,t),D.init(e,t)});var Mc=m("ZodIPv6",(e,t)=>{Vo.init(e,t),D.init(e,t)});var Vc=m("ZodCIDRv4",(e,t)=>{vo.init(e,t),D.init(e,t)});var vc=m("ZodCIDRv6",(e,t)=>{qo.init(e,t),D.init(e,t)});var qc=m("ZodBase64",(e,t)=>{Bo.init(e,t),D.init(e,t)});var Jc=m("ZodBase64URL",(e,t)=>{Ho.init(e,t),D.init(e,t)});var Bc=m("ZodE164",(e,t)=>{Go.init(e,t),D.init(e,t)});var Hc=m("ZodJWT",(e,t)=>{Wo.init(e,t),D.init(e,t)});var Qi=m("ZodNumber",(e,t)=>{Gt.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ai(e,n,o,s),qe(e,"ZodNumber",{gt(n,o){return this.check(ct(n,o))},gte(n,o){return this.check(Ve(n,o))},min(n,o){return this.check(Ve(n,o))},lt(n,o){return this.check(ut(n,o))},lte(n,o){return this.check(Me(n,o))},max(n,o){return this.check(Me(n,o))},int(n){return this.check(Hi(n))},safe(n){return this.check(Hi(n))},positive(n){return this.check(ct(0,n))},nonnegative(n){return this.check(Ve(0,n))},negative(n){return this.check(ut(0,n))},nonpositive(n){return this.check(Me(0,n))},multipleOf(n,o){return this.check(pt(n,o))},step(n,o){return this.check(pt(n,o))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function h(e){return Ws(Qi,e)}var Gc=m("ZodNumberFormat",(e,t)=>{Ko.init(e,t),Qi.init(e,t)});function Hi(e){return Ks(Gc,e)}var Wc=m("ZodBoolean",(e,t)=>{Yo.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ui(e,r,n,o)});function R(e){return Ys(Wc,e)}var Kc=m("ZodNull",(e,t)=>{Qo.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ci(e,r,n,o)});function Oe(e){return Qs(Kc,e)}var Yc=m("ZodUnknown",(e,t)=>{Xo.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fi(e,r,n,o)});function k(){return Xs(Yc)}var Qc=m("ZodNever",(e,t)=>{es.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>li(e,r,n,o)});function S(e){return ei(Qc,e)}var Xc=m("ZodVoid",(e,t)=>{ts.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pi(e,r,n,o)});function hr(e){return ti(Xc,e)}var ep=m("ZodArray",(e,t)=>{rs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_i(e,r,n,o),e.element=t.element,qe(e,"ZodArray",{min(r,n){return this.check(Ze(r,n))},nonempty(r){return this.check(Ze(1,r))},max(r,n){return this.check(lt(r,n))},length(r,n){return this.check(ft(r,n))},unwrap(){return this.element}})});function C(e,t){return ri(ep,e,t)}var tp=m("ZodObject",(e,t)=>{ss.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xi(e,r,n,o),O(e,"shape",()=>t.shape),qe(e,"ZodObject",{keyof(){return b(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:k()})},loose(){return this.clone({...this._zod.def,catchall:k()})},strict(){return this.clone({...this._zod.def,catchall:S()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return nc(this,r)},safeExtend(r){return oc(this,r)},merge(r){return sc(this,r)},pick(r){return tc(this,r)},omit(r){return rc(this,r)},partial(...r){return ic(ra,this,r[0])},required(...r){return ac(na,this,r[0])}})});function d(e,t){let r={type:"object",shape:e??{},...w(t)};return new tp(r)}var Xi=m("ZodUnion",(e,t)=>{Wt.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yi(e,r,n,o),e.options=t.options});function f(e,t){return new Xi({type:"union",options:e,...w(t)})}var rp=m("ZodDiscriminatedUnion",(e,t)=>{Xi.init(e,t),is.init(e,t)});function ea(e,t,r){return new rp({type:"union",options:t,discriminator:e,...w(r)})}var np=m("ZodIntersection",(e,t)=>{as.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bi(e,r,n,o)});function op(e,t){return new np({type:"intersection",left:e,right:t})}var Gi=m("ZodRecord",(e,t)=>{us.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Ee(e,t,r){if(!t||!t._zod)return new Gi({type:"record",keyType:c(),valueType:e,...w(t)});return new Gi({type:"record",keyType:e,valueType:t,...w(r)})}var mr=m("ZodEnum",(e,t)=>{cs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,o,s)=>di(e,n,o,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new mr({...t,checks:[],...w(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new mr({...t,checks:[],...w(o),entries:s})}});function b(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new mr({type:"enum",entries:r,...w(t)})}var sp=m("ZodLiteral",(e,t)=>{ps.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Z(e,t){return new sp({type:"literal",values:Array.isArray(e)?e:[e],...w(t)})}var ip=m("ZodTransform",(e,t)=>{ls.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ie(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(ge(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ge(i))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((s)=>(r.value=s,r.fallback=!0,r));return r.value=o,r.fallback=!0,r}});function ta(e){return new ip({type:"transform",transform:e})}var ra=m("ZodOptional",(e,t)=>{Kt.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function a(e){return new ra({type:"optional",innerType:e})}var ap=m("ZodExactOptional",(e,t)=>{fs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function up(e){return new ap({type:"optional",innerType:e})}var cp=m("ZodNullable",(e,t)=>{ds.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ai(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Wi(e){return new cp({type:"nullable",innerType:e})}var pp=m("ZodDefault",(e,t)=>{ms.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lp(e,t){return new pp({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Lt(t)}})}var fp=m("ZodPrefault",(e,t)=>{hs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Si(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function dp(e,t){return new fp({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Lt(t)}})}var na=m("ZodNonOptional",(e,t)=>{gs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function mp(e,t){return new na({type:"nonoptional",innerType:e,...w(t)})}var hp=m("ZodCatch",(e,t)=>{_s.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ki(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gp(e,t){return new hp({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var oa=m("ZodPipe",(e,t)=>{Yt.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zi(e,r,n,o),e.in=t.in,e.out=t.out});function Ki(e,t){return new oa({type:"pipe",in:e,out:t})}var _p=m("ZodPreprocess",(e,t)=>{oa.init(e,t),xs.init(e,t)}),xp=m("ZodReadonly",(e,t)=>{ys.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yp(e){return new xp({type:"readonly",innerType:e})}var bp=m("ZodCustom",(e,t)=>{bs.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hi(e,r,n,o)});function $p(e,t={}){return ni(bp,e,t)}function Ap(e,t){return oi(e,t)}function g(e,t){return new _p({type:"pipe",in:ta(e),out:t})}var Pe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var sa;(function(e){})(sa||(sa={}));var jg=k(),Fg=k(),Dg=k(),Lg=k(),Ug=k(),Mg=k(),Vg=k(),vg=k(),qg=k(),Jg=k(),Bg=k(),Hg=k(),Gg=k(),Wg=k(),Kg=k(),Yg=k(),Qg=k(),Xg=k(),e_=k(),zp=d({color:a(c()),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Sp=d({family:a(c()),color:a(c()),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:a(c()),strokeWidth:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var kp=d({top:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Zp=d({type:b(["caption"]),src:c().min(1).regex(/\S/),font:a(Sp),background:a(zp),margin:a(kp),trim:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),speed:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Op=d({color:f([c().regex(/^#[0-9a-fA-F]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),threshold:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(0).lte(250)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),halo:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(0).lte(250)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var ht=d({top:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),bottom:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Ep=d({host:c(),cpCode:c(),path:a(f([c(),Oe()])),filename:a(f([c(),Oe()]))}).strict(),Pp=d({provider:Z("akamai-netstorage"),options:a(Ep)}).strict(),Rp=d({accountName:c(),container:c(),prefix:a(f([c(),Oe()])),filename:a(f([c(),Oe()]))}).strict(),Cp=d({provider:Z("azure-blob-storage"),options:a(Rp)}).strict(),Np=d({bucket:c(),prefix:a(c()),filename:a(c())}).strict();var Tp=d({provider:Z("google-cloud-storage"),options:a(Np)}).strict();var Ip=d({folderId:a(c()),filename:a(c())}).strict();var jp=d({provider:Z("google-drive"),options:a(Ip)}).strict();var Fp=d({playbackPolicy:a(C(b(["public","signed"]))),passthrough:a(c().max(255))}).strict();var Dp=d({provider:Z("mux"),options:a(Fp)}).strict();var Lp=d({region:c(),bucket:c(),prefix:a(c()),filename:a(c()),acl:a(c())}).strict();var Up=d({provider:Z("s3"),options:a(Lp)}).strict();var Mp=d({provider:Z("shotstack"),exclude:a(R())}).strict();var Vp=d({title:a(c().max(150)),privacyLevel:a(b(["public","friends","private"])),disableDuet:a(R()).default(!1),disableStitch:a(R()).default(!1),disableComment:a(R()).default(!1)}).strict(),vp=d({provider:Z("tiktok"),options:a(Vp)}).strict(),qp=d({view:a(b(["anybody","nobody","contacts","password","unlisted"])),embed:a(b(["public","private","whitelist"])),comments:a(b(["anybody","nobody","contacts"])),download:a(R()),add:a(R())}).strict();var Jp=d({name:a(c()),description:a(c()),privacy:a(qp),folderUri:a(c())}).strict();var Bp=d({provider:Z("vimeo"),options:a(Jp)}).strict();var gr=ea("provider",[Mp,Dp,Up,Tp,jp,Bp,vp,Pp,Cp]);var Hp=d({horizontal:a(R()),vertical:a(R())}).strict();var Gp=d({src:c()}).strict();var Wp=d({type:b(["image","video","audio"]),prompt:c().min(1).max(4000).regex(/\S/),model:a(c()),options:a(Ee(c(),k()))}).strict();var Kp=d({model:c(),type:b(["image","video","audio"]),name:a(c()),description:a(c()),options:a(Ee(c(),k())),available:a(R()),unavailableReason:a(b(["AiCapabilityNotIncluded","AiDisabled","AiAccessUnavailable"]))}).strict();var ia=d({asset:Wp,length:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gt(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Yp=d({type:b(["html5"]),html:c().max(1e6),css:a(c().max(500000)),js:a(c().max(500000))}).strict();var Qp=d({type:b(["html"]),html:c(),css:a(c()),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:a(c()),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"]))}).strict();var Xp=d({type:b(["image"]),src:a(c().min(1).regex(/\S/)),prompt:a(c().max(4000)),model:a(c()),options:a(Ee(c(),k())),crop:a(ht)}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Pe.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var el=d({type:b(["image-to-video"]),src:c().min(1),prompt:a(c()),aspectRatio:a(b(["1:1","4:3","16:9","9:16","3:4","21:9","9:21"])),speed:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:a(ht)}).strict();var tl=d({preset:b(["conference","interview","lecture","meeting","mobile_phone","music","podcast","studio","voice_over"])}).strict();var rl=d({provider:c().default("dolby"),options:tl}).strict();var nl=d({enhancement:Z("dolbyEnhancement_DolbyEnhancement")}).strict().and(rl);var ol=d({audio:a(nl)}).strict();var sl=d({status:c(),title:c(),detail:c()}).strict();var t_=d({errors:C(sl)}).strict();var il=d({type:c(),id:c()}).strict();var r_=d({data:il}).strict();var al=d({id:c(),url:c(),expires:c()}).strict();var ul=d({type:c(),id:c(),attributes:al}).strict();var n_=d({data:ul}).strict();var cl=d({speed:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),preservePitch:a(R())}).strict();var pl=d({format:a(b(["srt","vtt"]))}).strict();var ll=d({type:b(["luma"]),src:c().min(1).regex(/\S/),trim:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var aa=d({find:c(),replace:k()}).strict();var fl=d({capture:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var dl=d({start:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var ml=d({id:c(),owner:c(),region:a(c()),renderId:a(c()),providerId:a(c()),filename:a(c()),url:a(c()),status:b(["importing","ready","failed","deleted"]),created:a(c()),updated:a(c())}).strict();var ua=d({type:c(),attributes:ml}).strict();var o_=d({data:C(ua)}).strict();var s_=d({data:ua}).strict();var i_=d({error:c(),code:a(c()),available:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var a_=d({error:d({name:b(["UnknownGenerationModel","WithdrawnGenerationModel"]),message:c()})}).strict();var u_=d({models:C(Kp)}).strict();var c_=d({credits:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),ceiling:R()}).strict();var p_=d({id:c(),status:b(["queued","processing","done","failed"]),url:a(c()),error:a(c())}).strict();var l_=d({success:R(),message:c(),response:Ee(c(),k())}).strict();var hl=d({message:c(),id:c()}).strict();var f_=d({success:R(),message:c(),response:hl}).strict();var gl=d({id:c(),name:c(),created:a(c()),updated:a(c())}).strict();var _l=d({owner:c(),templates:C(gl)}).strict();var d_=d({success:R(),message:c(),response:_l}).strict();var xl=d({message:c(),id:c()}).strict();var m_=d({success:R(),message:c(),response:xl}).strict();var yl=d({family:a(c()),weight:a(k()).default("400"),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(1).lte(500)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:a(b(["none","underline","line-through"]))}).strict();var bl=d({style:b(["karaoke","highlight","pop","fade","slide","bounce","typewriter","none"]),direction:a(b(["left","right","up","down"]))}).strict();var $l=d({family:a(c()).default("Roboto"),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(500)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:a(k()).default("400"),style:a(b(["normal","italic"])),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),ca=d({horizontal:a(b(["left","center","right"])),vertical:a(b(["top","middle","bottom"]))}).strict();var Al=d({preset:b(["fadeIn","slideIn","typewriter","ascend","shift","movingLetters"]),duration:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0.1).lte(30)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),style:a(b(["character","word"])),direction:a(b(["left","right","up","down"]))}).strict();var pa=d({color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),borderRadius:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wrap:a(R()).default(!1),padding:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(0).lte(200)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var la=d({width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),radius:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict();var fa=d({type:a(b(["linear","radial"])),angle:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(360)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),stops:C(d({offset:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),color:f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])})).min(2)}).strict();var wl=d({letterSpacing:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:a(b(["none","uppercase","lowercase","capitalize"])),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(1).lte(500)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:a(b(["none","underline","line-through"])),gradient:a(fa)}).strict(),da=d({top:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),right:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),bottom:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),left:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict();var _r=d({offsetX:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),offsetY:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),blur:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5)}).strict();var gt=d({width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1)}).strict();var zl=d({font:a(yl),stroke:a(f([gt,b(["none"])])),shadow:a(f([_r,b(["none"])]))}).strict();var Sl=d({type:b(["rich-caption"]),src:c().min(1),font:a($l),style:a(wl),stroke:a(gt),shadow:a(_r),background:a(pa),border:a(la),padding:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),da])),align:a(ca),active:a(zl),animation:a(bl)}).strict();var kl=d({family:a(c()).default("Open Sans"),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(500)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:a(k()).default("400"),style:a(b(["normal","italic"])),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:a(gt)}).strict();var Zl=d({letterSpacing:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wordSpacing:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:a(b(["none","uppercase","lowercase","capitalize"])),textDecoration:a(b(["none","underline","line-through"])),gradient:a(fa)}).strict();var Ol=d({type:b(["rich-text"]),text:c().max(5000),font:a(kl),style:a(Zl),stroke:a(gt),shadow:a(_r),background:a(pa),border:a(la),padding:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),da])),align:a(ca),animation:a(Al)}).strict();var El=d({id:a(c()),owner:a(c()),status:a(b(["queued","failed"])),created:a(c())}).strict();var Pl=d({type:a(c()),attributes:a(El)}).strict();var h_=d({data:Pl}).strict();var Rl=d({url:c(),id:c(),destinations:C(gr)}).strict();var Cl=d({type:b(["shape"]),shape:b(["rectangle","circle","line"]),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fill:a(d({color:a(c()),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),stroke:a(d({color:a(c()),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),rectangle:a(d({width:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),height:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),cornerRadius:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),circle:a(d({radius:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])})),line:a(d({length:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),thickness:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}))}).strict();var ma=d({width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(4096)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(4096)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var ha=d({format:a(b(["mp4","webm","mov","avi","mkv","ogv","wmv","avif","gif","mp3","wav","jpg","png","webp","tif"])),size:a(ma),fit:a(b(["cover","contain","crop"])),resolution:a(b(["preview","mobile","sd","hd","fhd"])),quality:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(100)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([Z(12),Z(15),Z(23.976),Z(24),Z(25),Z(29.97),Z(30),Z(48),Z(50),Z(59.94),Z(60)])),speed:a(cl),keyframeInterval:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int().gte(1).lte(300)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fixOffset:a(R()),fixRotation:a(R()),enhance:a(ol),filename:a(c())}).strict();var Nl=d({renditions:a(C(ha)),transcription:a(pl)}).strict();var Tl=d({id:c(),status:a(b(["queued","importing","ready","failed","deleted","overwritten"])),url:a(c()),executionTime:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),transformation:a(ha),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Il=d({renditions:a(C(Tl))}).strict();var jl=d({id:c(),owner:c(),input:a(c()),source:a(c()),status:a(b(["queued","importing","ready","failed","deleted","overwritten"])),outputs:a(Il),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),created:a(c()),updated:a(c())}).strict();var ga=d({type:c(),id:c(),attributes:jl}).strict();var g_=d({data:C(ga)}).strict();var __=d({data:ga}).strict();var Fl=d({url:a(c()),outputs:a(Nl),destinations:a(gr),callback:a(c())}).strict();var Dl=d({src:c().min(1).regex(/\S/),effect:a(b(["fadeIn","fadeOut","fadeInFadeOut"])),volume:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Ll=d({type:b(["svg"]),src:c().min(1).max(500000)}).strict();var Ul=d({id:c(),merge:a(C(aa))}).strict();var Ml=d({horizontal:a(b(["left","center","right"])),vertical:a(b(["top","center","bottom"]))}).strict();var Vl=d({preset:b(["typewriter"]),duration:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0.1).lte(30)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),vl=d({color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(100)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),wrap:a(R())}).strict();var ql=d({family:a(c()),color:a(c()),opacity:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),weight:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Jl=d({width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),color:a(f([c().regex(/^#[A-Fa-f0-9]{6}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),Bl=d({type:b(["text"]),text:c(),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),font:a(ql),background:a(vl),alignment:a(Ml),stroke:a(Jl),animation:a(Vl),ellipsis:a(c())}).strict().superRefine((e,t)=>{if(e.background&&e.background.wrap===!0)t.addIssue({code:Pe.custom,message:'background.wrap is only supported on rich-text and rich-caption assets. For type "text", migrate to type "rich-text" to use this feature.',path:["background","wrap"]})});var Hl=d({type:b(["text-to-image"]),prompt:c(),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().int()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:a(ht)}).strict();var Gl=d({capture:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),scale:f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var Wl=d({format:b(["mp4","gif","mp3","jpg","png","bmp"]),resolution:a(b(["preview","mobile","sd","hd","1080","4k"])),aspectRatio:a(b(["16:9","9:16","1:1","4:5","4:3"])),size:a(ma),fps:a(f([Z(12),Z(15),Z(23.976),Z(24),Z(25),Z(29.97),Z(30),Z(48),Z(50),Z(59.94),Z(60)])),scaleTo:a(b(["preview","mobile","sd","hd","1080","4k"])),quality:a(b(["verylow","low","medium","high","veryhigh"])),repeat:a(R()),mute:a(R()),range:a(dl),poster:a(fl),thumbnail:a(Gl),destinations:a(C(gr))}).strict().superRefine((e,t)=>{var r=e.format==="mp3";if(!r&&e.size!=null&&(e.size.width==null||e.size.height==null)){t.addIssue({code:Pe.custom,path:["size"],message:"size requires both width and height"});return}var n=typeof e.resolution==="string",o=e.size!=null&&e.size.width!=null&&e.size.height!=null;if(!r&&!n&&!o)t.addIssue({code:Pe.custom,message:'output requires either "resolution" or "size" (with width and height)'})});var Kl=d({in:a(b(["none","fade","fadeSlow","fadeFast","reveal","revealSlow","revealFast","wipeLeft","wipeLeftSlow","wipeLeftFast","wipeRight","wipeRightSlow","wipeRightFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast","carouselLeft","carouselLeftSlow","carouselLeftFast","carouselRight","carouselRightSlow","carouselRightFast","carouselUp","carouselUpSlow","carouselUpFast","carouselDown","carouselDownSlow","carouselDownFast","shuffleTopRight","shuffleTopRightSlow","shuffleTopRightFast","shuffleRightTop","shuffleRightTopSlow","shuffleRightTopFast","shuffleRightBottom","shuffleRightBottomSlow","shuffleRightBottomFast","shuffleBottomRight","shuffleBottomRightSlow","shuffleBottomRightFast","shuffleBottomLeft","shuffleBottomLeftSlow","shuffleBottomLeftFast","shuffleLeftBottom","shuffleLeftBottomSlow","shuffleLeftBottomFast","shuffleLeftTop","shuffleLeftTopSlow","shuffleLeftTopFast","shuffleTopLeft","shuffleTopLeftSlow","shuffleTopLeftFast","zoom"])),out:a(b(["none","fade","fadeSlow","fadeFast","reveal","revealSlow","revealFast","wipeLeft","wipeLeftSlow","wipeLeftFast","wipeRight","wipeRightSlow","wipeRightFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast","carouselLeft","carouselLeftSlow","carouselLeftFast","carouselRight","carouselRightSlow","carouselRightFast","carouselUp","carouselUpSlow","carouselUpFast","carouselDown","carouselDownSlow","carouselDownFast","shuffleTopRight","shuffleTopRightSlow","shuffleTopRightFast","shuffleRightTop","shuffleRightTopSlow","shuffleRightTopFast","shuffleRightBottom","shuffleRightBottomSlow","shuffleRightBottomFast","shuffleBottomRight","shuffleBottomRightSlow","shuffleBottomRightFast","shuffleBottomLeft","shuffleBottomLeftSlow","shuffleBottomLeftFast","shuffleLeftBottom","shuffleLeftBottomSlow","shuffleLeftBottomFast","shuffleLeftTop","shuffleLeftTopSlow","shuffleLeftTopFast","shuffleTopLeft","shuffleTopLeftSlow","shuffleTopLeftFast","zoom"]))}).strict();var te=d({from:a(k()),to:a(k()),start:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),interpolation:a(b(["linear","bezier","constant"])),easing:a(b(["ease","easeIn","easeOut","easeInOut","easeInQuad","easeInCubic","easeInQuart","easeInQuint","easeInSine","easeInExpo","easeInCirc","easeInBack","easeOutQuad","easeOutCubic","easeOutQuart","easeOutQuint","easeOutSine","easeOutExpo","easeOutCirc","easeOutBack","easeInOutQuad","easeInOutCubic","easeInOutQuart","easeInOutQuint","easeInOutSine","easeInOutExpo","easeInOutCirc","easeInOutBack"]))}).strict();var Yl=d({type:b(["audio"]),src:a(c().min(1).regex(/\S/)),prompt:a(c().max(4000)),model:a(c()),options:a(Ee(c(),k())),trim:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),speed:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"]))}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Pe.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var _a=d({x:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(-10).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),y:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(-10).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)]))}).strict();var Ql=d({angle:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(-360).lte(360)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)]))}).strict();var Xl=d({x:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(-100).lte(100)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),y:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(-100).lte(100)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)]))}).strict();var ef=d({type:b(["text-to-speech"]),text:c(),voice:c(),language:a(c()),newscaster:a(R()).default(!1),trim:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),speed:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"]))}).strict();var tf=d({type:b(["title"]),text:c(),style:a(b(["minimal","blockbuster","vogue","sketchy","skinny","chunk","chunkLight","marker","future","subtitle"])),color:a(c()),size:a(b(["xx-small","x-small","small","medium","large","x-large","xx-large"])),background:a(c()),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:a(_a)}).strict();var rf=d({rotate:a(Ql),skew:a(Xl),flip:a(Hp)}).strict();var nf=d({type:b(["video"]),src:a(c().min(1).regex(/\S/)),prompt:a(c().max(4000)),model:a(c()),options:a(Ee(c(),k())),transcode:a(R()),trim:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(1)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),volumeEffect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"])),speed:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0).lte(10)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),crop:a(ht),chromaKey:a(Op)}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Pe.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var of=ea("type",[nf,Xp,Bl,Ol,Yl,ll,Zp,Sl,Qp,Yp,tf,Cl,Ll,Hl,el,ef]);var sf=d({id:a(c()),asset:of,start:f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),f([c().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])]),length:f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(0)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),f([c().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])]),fit:a(b(["cover","contain","crop","none"])),scale:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),width:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(1).lte(3840)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h().gte(1).lte(2160)),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:a(_a),transition:a(Kl),effect:a(b(["zoomIn","zoomInSlow","zoomInFast","zoomOut","zoomOutSlow","zoomOutFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast"])),filter:a(b(["none","blur","boost","contrast","darken","greyscale","lighten","muted","negative"])),opacity:a(f([f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),C(te)])),transform:a(rf),alias:a(f([c().regex(/^[A-Za-z0-9_-]+$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var af=sf.transform((e)=>{if(e.asset&&typeof e.asset==="object"&&"type"in e.asset){if(e.asset.type==="rich-text"){let{fit:r,...n}=e;return n}}return e}),uf=d({clips:C(af).min(1)}).strict();var cf=d({soundtrack:a(Dl),background:a(c()),fonts:a(C(Gp)),tracks:C(uf).min(1),cache:a(R())}).strict();var Je=d({timeline:cf,output:Wl,merge:a(C(aa)),callback:a(c()),disk:a(b(["local","mount"])),instance:a(b(["s1","s2","a1"]))}).strict(),xa=Je,pf=d({id:c(),owner:c(),plan:a(c()),status:b(["queued","fetching","preprocessing","rendering","generating","saving","done","failed"]),error:a(c()),duration:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),renderTime:a(f([g((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},h()),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),url:a(c()),poster:a(f([c(),Oe()])),thumbnail:a(f([c(),Oe()])),data:a(Je),created:a(c()),updated:a(c())}).strict();var x_=d({success:R(),message:c(),response:pf}).strict();var lf=d({id:c(),name:c(),owner:c(),template:Je}).strict();var y_=d({success:R(),message:c(),response:lf}).strict();var ya=d({name:c(),template:a(Je)}).strict();var b_=d({body:Je,path:a(S()),query:a(S())}).strict();var $_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(d({data:a(R()),merged:a(R())}))}).strict();var A_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var w_=d({body:ya,path:a(S()),query:a(S())}).strict();var z_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),S_=hr(),k_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var Z_=d({body:ya,path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var O_=d({body:Ul,path:a(S()),query:a(S())}).strict();var E_=d({body:a(S()),path:d({url:c()}),query:a(S())}).strict();var P_=d({body:ia,path:a(S()),query:a(S()),headers:a(d({"Idempotency-Key":a(c())}))}).strict();var R_=d({body:ia,path:a(S()),query:a(S())}).strict();var C_=d({body:a(S()),path:d({id:c()}),query:a(S())}).strict();var N_=d({body:a(S()),path:a(S()),query:a(d({expand:a(b(["options"]))}))}).strict();var T_=d({body:a(S()),path:d({id:c()}),query:a(S())}).strict();var I_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),j_=hr(),F_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var D_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var L_=d({body:Rl,path:a(S()),query:a(S())}).strict();var U_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var M_=d({body:Fl,path:a(S()),query:a(S())}).strict();var V_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),v_=hr(),q_=d({body:a(S()),path:d({id:f([c().regex(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/),c().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var J_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var ff={alignment:"align",duration:"length",transitions:"transition",name:"family"},ba={"align.vertical":{center:"middle"},fit:{cover:"crop"}},df=new Set(["arapey","clear sans","clearsans","didact gothic","didactgothic","montserrat","movlette","notoemoji","open sans","opensans","permanent marker","permanentmarker","roboto","sue ellen francisco","sueellenfrancisco","uni neue","unineue","work sans","worksans"]),mf=/-(?:(?:Extra(?:Light|Bold)|SemiBold|Regular|Medium|Light|Black|Bold|Thin|Heavy)(?:Italic|Oblique)?|(?:Italic|Oblique))$/i,hf=new Set(["image","video","audio","luma"]);function Re(e){let t=[],r=xa.safeParse(e);if(!r.success)for(let o of $f(r.error))t.push({...o,level:"error"});for(let o of gf(e))t.push(o);return{ok:!t.some((o)=>(o.level??"error")==="error"),issues:t}}function xe(e){let t=e.filter((o)=>(o.level??"error")==="error"),r=e.filter((o)=>o.level==="warning"),n=[];if(t.length){let o=r.length?`, ${r.length} warning${xr(r.length)}`:"";n.push(`✗ Edit JSON failed validation (${t.length} error${xr(t.length)}${o}):`)}else n.push(`⚠ Edit JSON valid, with ${r.length} warning${xr(r.length)}:`);for(let o of e){let s=(o.level??"error")==="error"?"✗":"⚠",i=o.suggestion?` (did you mean '${o.suggestion}'?)`:"";n.push(` ${s} ${o.path||"<root>"}: ${o.message}${i}`)}return n.join(`
|
|
89
|
-
`)}function xr(e){return e===1?"":"s"}function
|
|
90
|
-
`).filter((i)=>i.trim().length>0).slice(-e).reverse(),s=[];for(let i of o)try{s.push(JSON.parse(i))}catch{}return s}function
|
|
91
|
-
`)}var za=80,
|
|
92
|
-
`):"No sources.";return
|
|
93
|
-
`):"No templates found";return
|
|
94
|
-
`)}function
|
|
95
|
-
`)}var
|
|
96
|
-
`),t(s.trim())}),r=!0})}var
|
|
88
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1){if(e.reused==="ref"){s(i);continue}}}}function fr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let p=e.seen.get(c);if(p.ref===null)return;let l=p.def??p.schema,h={...l},y=p.ref;if(p.ref=null,y){n(y);let x=e.seen.get(y),z=x.schema;if(z.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(z);else Object.assign(l,z);if(Object.assign(l,h),c._zod.parent===y)for(let N in l){if(N==="$ref"||N==="allOf")continue;if(!(N in h))delete l[N]}if(z.$ref&&x.def)for(let N in l){if(N==="$ref"||N==="allOf")continue;if(N in x.def&&JSON.stringify(l[N])===JSON.stringify(x.def[N]))delete l[N]}}let A=c._zod.parent;if(A&&A!==y){n(A);let x=e.seen.get(A);if(x?.schema.$ref){if(l.$ref=x.schema.$ref,x.def)for(let z in l){if(z==="$ref"||z==="allOf")continue;if(z in x.def&&JSON.stringify(l[z])===JSON.stringify(x.def[z]))delete l[z]}}}e.override({zodSchema:c,jsonSchema:l,path:p.path??[]})};for(let c of[...e.seen.entries()].reverse())n(c[0]);let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&o.id===s)delete o.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let p=c[1];if(p.def&&p.defId){if(p.def.id===p.defId)delete p.def.id;i[p.defId]=p.def}}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Be(t,"input",e.processors),output:Be(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function Q(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Q(n.element,r);if(n.type==="set")return Q(n.valueType,r);if(n.type==="lazy")return Q(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Q(n.innerType,r);if(n.type==="intersection")return Q(n.left,r)||Q(n.right,r);if(n.type==="record"||n.type==="map")return Q(n.keyType,r)||Q(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Q(n.in,r)||Q(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(Q(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Q(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Q(o,r))return!0;if(n.rest&&Q(n.rest,r))return!0;return!1}return!1}var si=(e,t={})=>(r)=>{let n=pr({...r,processors:t});return G(e,n),lr(n,e),fr(n,e)},Be=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:s}=n??{},i=pr({...o??{},target:s,io:t,processors:r});return G(e,i),lr(i,e),fr(i,e)};var _c={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ii=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:c,patterns:p,contentEncoding:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof i==="number")o.maxLength=i;if(c){if(o.format=_c[c]??c,o.format==="")delete o.format;if(c==="time")delete o.format}if(l)o.contentEncoding=l;if(p&&p.size>0){let h=[...p];if(h.length===1)o.pattern=h[0].source;else if(h.length>1)o.allOf=[...h.map((y)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))]}},ai=(e,t,r,n)=>{let o=r,{minimum:s,maximum:i,format:c,multipleOf:p,exclusiveMaximum:l,exclusiveMinimum:h}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))o.type="integer";else o.type="number";let y=typeof h==="number"&&h>=(s??Number.NEGATIVE_INFINITY),A=typeof l==="number"&&l<=(i??Number.POSITIVE_INFINITY),x=t.target==="draft-04"||t.target==="openapi-3.0";if(y)if(x)o.minimum=h,o.exclusiveMinimum=!0;else o.exclusiveMinimum=h;else if(typeof s==="number")o.minimum=s;if(A)if(x)o.maximum=l,o.exclusiveMaximum=!0;else o.exclusiveMaximum=l;else if(typeof i==="number")o.maximum=i;if(typeof p==="number")o.multipleOf=p},ui=(e,t,r,n)=>{r.type="boolean"};var ci=(e,t,r,n)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var pi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},li=(e,t,r,n)=>{r.not={}};var fi=(e,t,r,n)=>{};var di=(e,t,r,n)=>{let o=e._zod.def,s=Xe(o.entries);if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},mi=(e,t,r,n)=>{let o=e._zod.def,s=[];for(let i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(i));else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}};var hi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var gi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var _i=(e,t,r,n)=>{let o=r,s=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;if(typeof i==="number")o.minItems=i;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=G(s.element,t,{...n,path:[...n.path,"items"]})},xi=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object",o.properties={};let i=s.shape;for(let l in i)o.properties[l]=G(i[l],t,{...n,path:[...n.path,"properties",l]});let c=new Set(Object.keys(i)),p=new Set([...c].filter((l)=>{let h=s.shape[l]._zod;if(t.io==="input")return h.optin===void 0;else return h.optout===void 0}));if(p.size>0)o.required=Array.from(p);if(s.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")o.additionalProperties=!1}else if(s.catchall)o.additionalProperties=G(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},yi=(e,t,r,n)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((c,p)=>G(c,t,{...n,path:[...n.path,s?"oneOf":"anyOf",p]}));if(s)r.oneOf=i;else r.anyOf=i},bi=(e,t,r,n)=>{let o=e._zod.def,s=G(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=G(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(l)=>("allOf"in l)&&Object.keys(l).length===1,p=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=p};var $i=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object";let i=s.keyType,p=i._zod.bag?.patterns;if(s.mode==="loose"&&p&&p.size>0){let h=G(s.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let y of p)o.patternProperties[y.source]=h}else{if(t.target==="draft-07"||t.target==="draft-2020-12")o.propertyNames=G(s.keyType,t,{...n,path:[...n.path,"propertyNames"]});o.additionalProperties=G(s.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let l=i._zod.values;if(l){let h=[...l].filter((y)=>typeof y==="string"||typeof y==="number");if(h.length>0)o.required=h}},Ai=(e,t,r,n)=>{let o=e._zod.def,s=G(o.innerType,t,n),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=o.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},wi=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType},zi=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Si=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);if(s.ref=o.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(o.defaultValue))},ki=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},Zi=(e,t,r,n)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;G(i,t,n);let c=t.seen.get(e);c.ref=i},Oi=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0};var dr=(e,t,r,n)=>{let o=e._zod.def;G(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType};var zc=m("ZodISODateTime",(e,t)=>{Fo.init(e,t),U.init(e,t)});function Ei(e){return Js(zc,e)}var Sc=m("ZodISODate",(e,t)=>{Do.init(e,t),U.init(e,t)});function Pi(e){return Bs(Sc,e)}var kc=m("ZodISOTime",(e,t)=>{Lo.init(e,t),U.init(e,t)});function Ri(e){return Hs(kc,e)}var Zc=m("ZodISODuration",(e,t)=>{Uo.init(e,t),U.init(e,t)});function Ci(e){return Gs(Zc,e)}var Pc=(e,t)=>{nt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>_n(e,r)},flatten:{value:(r)=>gn(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Le,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Le,2)}},isEmpty:{get(){return e.issues.length===0}}})};var X=m("ZodError",Pc,{Parent:Error});var Ni=ot(X),Ti=st(X),Ii=Me(X),ji=ve(X),Fi=bn(X),Di=$n(X),Li=An(X),Ui=wn(X),Mi=zn(X),vi=Sn(X),Vi=kn(X),qi=Zn(X);var Ji=new WeakMap;function He(e,t,r){let n=Object.getPrototypeOf(e),o=Ji.get(n);if(!o)o=new Set,Ji.set(n,o);if(o.has(t))return;o.add(t);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}var L=m("ZodType",(e,t)=>(j.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Be(e,"input"),output:Be(e,"output")}}),e.toJSONSchema=si(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Ni(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ii(e,r,n),e.parseAsync=async(r,n)=>Ti(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ji(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Fi(e,r,n),e.decode=(r,n)=>Di(e,r,n),e.encodeAsync=async(r,n)=>Li(e,r,n),e.decodeAsync=async(r,n)=>Ui(e,r,n),e.safeEncode=(r,n)=>Mi(e,r,n),e.safeDecode=(r,n)=>vi(e,r,n),e.safeEncodeAsync=async(r,n)=>Vi(e,r,n),e.safeDecodeAsync=async(r,n)=>qi(e,r,n),He(e,"ZodType",{check(...r){let n=this.def;return this.clone(ce(n,{checks:[...n.checks??[],...r.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return se(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(wp(r,n))},superRefine(r,n){return this.check(zp(r,n))},overwrite(r){return this.check(de(r))},optional(){return a(this)},exactOptional(){return pp(this)},nullable(){return Ki(this)},nullish(){return a(Ki(this))},nonoptional(r){return gp(this,r)},array(){return I(this)},or(r){return f([this,r])},and(r){return ip(this,r)},transform(r){return Wi(this,ta(r))},default(r){return dp(this,r)},prefault(r){return hp(this,r)},catch(r){return xp(this,r)},pipe(r){return Wi(this,r)},readonly(){return $p(this)},describe(r){let n=this.clone();return ye.add(n,{description:r}),n},meta(...r){if(r.length===0)return ye.get(this);let n=this.clone();return ye.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return ye.get(e)?.description},configurable:!0}),e)),Yi=m("_ZodString",(e,t)=>{ct.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ii(e,n,o,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,He(e,"_ZodString",{regex(...n){return this.check(Xt(...n))},includes(...n){return this.check(rr(...n))},startsWith(...n){return this.check(nr(...n))},endsWith(...n){return this.check(or(...n))},min(...n){return this.check(Pe(...n))},max(...n){return this.check(dt(...n))},length(...n){return this.check(mt(...n))},nonempty(...n){return this.check(Pe(1,...n))},lowercase(n){return this.check(er(n))},uppercase(n){return this.check(tr(n))},trim(){return this.check(ir())},normalize(...n){return this.check(sr(...n))},toLowerCase(){return this.check(ar())},toUpperCase(){return this.check(ur())},slugify(){return this.check(cr())}})}),Cc=m("ZodString",(e,t)=>{ct.init(e,t),Yi.init(e,t),e.email=(r)=>e.check(zs(Nc,r)),e.url=(r)=>e.check(Es(Tc,r)),e.jwt=(r)=>e.check(qs(Kc,r)),e.emoji=(r)=>e.check(Ps(Ic,r)),e.guid=(r)=>e.check(Qt(Bi,r)),e.uuid=(r)=>e.check(Ss(gt,r)),e.uuidv4=(r)=>e.check(ks(gt,r)),e.uuidv6=(r)=>e.check(Zs(gt,r)),e.uuidv7=(r)=>e.check(Os(gt,r)),e.nanoid=(r)=>e.check(Rs(jc,r)),e.guid=(r)=>e.check(Qt(Bi,r)),e.cuid=(r)=>e.check(Cs(Fc,r)),e.cuid2=(r)=>e.check(Ns(Dc,r)),e.ulid=(r)=>e.check(Ts(Lc,r)),e.base64=(r)=>e.check(Ms(Bc,r)),e.base64url=(r)=>e.check(vs(Hc,r)),e.xid=(r)=>e.check(Is(Uc,r)),e.ksuid=(r)=>e.check(js(Mc,r)),e.ipv4=(r)=>e.check(Fs(vc,r)),e.ipv6=(r)=>e.check(Ds(Vc,r)),e.cidrv4=(r)=>e.check(Ls(qc,r)),e.cidrv6=(r)=>e.check(Us(Jc,r)),e.e164=(r)=>e.check(Vs(Gc,r)),e.datetime=(r)=>e.check(Ei(r)),e.date=(r)=>e.check(Pi(r)),e.time=(r)=>e.check(Ri(r)),e.duration=(r)=>e.check(Ci(r))});function u(e){return ws(Cc,e)}var U=m("ZodStringFormat",(e,t)=>{D.init(e,t),Yi.init(e,t)}),Nc=m("ZodEmail",(e,t)=>{Oo.init(e,t),U.init(e,t)});var Bi=m("ZodGUID",(e,t)=>{ko.init(e,t),U.init(e,t)});var gt=m("ZodUUID",(e,t)=>{Zo.init(e,t),U.init(e,t)});var Tc=m("ZodURL",(e,t)=>{Eo.init(e,t),U.init(e,t)});var Ic=m("ZodEmoji",(e,t)=>{Po.init(e,t),U.init(e,t)});var jc=m("ZodNanoID",(e,t)=>{Ro.init(e,t),U.init(e,t)});var Fc=m("ZodCUID",(e,t)=>{Co.init(e,t),U.init(e,t)});var Dc=m("ZodCUID2",(e,t)=>{No.init(e,t),U.init(e,t)});var Lc=m("ZodULID",(e,t)=>{To.init(e,t),U.init(e,t)});var Uc=m("ZodXID",(e,t)=>{Io.init(e,t),U.init(e,t)});var Mc=m("ZodKSUID",(e,t)=>{jo.init(e,t),U.init(e,t)});var vc=m("ZodIPv4",(e,t)=>{Mo.init(e,t),U.init(e,t)});var Vc=m("ZodIPv6",(e,t)=>{vo.init(e,t),U.init(e,t)});var qc=m("ZodCIDRv4",(e,t)=>{Vo.init(e,t),U.init(e,t)});var Jc=m("ZodCIDRv6",(e,t)=>{qo.init(e,t),U.init(e,t)});var Bc=m("ZodBase64",(e,t)=>{Bo.init(e,t),U.init(e,t)});var Hc=m("ZodBase64URL",(e,t)=>{Ho.init(e,t),U.init(e,t)});var Gc=m("ZodE164",(e,t)=>{Go.init(e,t),U.init(e,t)});var Kc=m("ZodJWT",(e,t)=>{Ko.init(e,t),U.init(e,t)});var Qi=m("ZodNumber",(e,t)=>{Gt.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ai(e,n,o,s),He(e,"ZodNumber",{gt(n,o){return this.check(lt(n,o))},gte(n,o){return this.check(Je(n,o))},min(n,o){return this.check(Je(n,o))},lt(n,o){return this.check(pt(n,o))},lte(n,o){return this.check(qe(n,o))},max(n,o){return this.check(qe(n,o))},int(n){return this.check(Hi(n))},safe(n){return this.check(Hi(n))},positive(n){return this.check(lt(0,n))},nonnegative(n){return this.check(Je(0,n))},negative(n){return this.check(pt(0,n))},nonpositive(n){return this.check(qe(0,n))},multipleOf(n,o){return this.check(ft(n,o))},step(n,o){return this.check(ft(n,o))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function g(e){return Ks(Qi,e)}var Wc=m("ZodNumberFormat",(e,t)=>{Wo.init(e,t),Qi.init(e,t)});function Hi(e){return Ws(Wc,e)}var Yc=m("ZodBoolean",(e,t)=>{Yo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ui(e,r,n,o)});function T(e){return Ys(Yc,e)}var Qc=m("ZodNull",(e,t)=>{Qo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ci(e,r,n,o)});function Re(e){return Qs(Qc,e)}var Xc=m("ZodUnknown",(e,t)=>{Xo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fi(e,r,n,o)});function Z(){return Xs(Xc)}var ep=m("ZodNever",(e,t)=>{es.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>li(e,r,n,o)});function S(e){return ei(ep,e)}var tp=m("ZodVoid",(e,t)=>{ts.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pi(e,r,n,o)});function hr(e){return ti(tp,e)}var rp=m("ZodArray",(e,t)=>{rs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_i(e,r,n,o),e.element=t.element,He(e,"ZodArray",{min(r,n){return this.check(Pe(r,n))},nonempty(r){return this.check(Pe(1,r))},max(r,n){return this.check(dt(r,n))},length(r,n){return this.check(mt(r,n))},unwrap(){return this.element}})});function I(e,t){return ri(rp,e,t)}var np=m("ZodObject",(e,t)=>{ss.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xi(e,r,n,o),P(e,"shape",()=>t.shape),He(e,"ZodObject",{keyof(){return b(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:S()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return sc(this,r)},safeExtend(r){return ic(this,r)},merge(r){return ac(this,r)},pick(r){return nc(this,r)},omit(r){return oc(this,r)},partial(...r){return uc(ra,this,r[0])},required(...r){return cc(na,this,r[0])}})});function d(e,t){let r={type:"object",shape:e??{},...w(t)};return new np(r)}var Xi=m("ZodUnion",(e,t)=>{Kt.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yi(e,r,n,o),e.options=t.options});function f(e,t){return new Xi({type:"union",options:e,...w(t)})}var op=m("ZodDiscriminatedUnion",(e,t)=>{Xi.init(e,t),is.init(e,t)});function ea(e,t,r){return new op({type:"union",options:t,discriminator:e,...w(r)})}var sp=m("ZodIntersection",(e,t)=>{as.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bi(e,r,n,o)});function ip(e,t){return new sp({type:"intersection",left:e,right:t})}var Gi=m("ZodRecord",(e,t)=>{us.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Ce(e,t,r){if(!t||!t._zod)return new Gi({type:"record",keyType:u(),valueType:e,...w(t)});return new Gi({type:"record",keyType:e,valueType:t,...w(r)})}var mr=m("ZodEnum",(e,t)=>{cs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,s)=>di(e,n,o,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new mr({...t,checks:[],...w(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new mr({...t,checks:[],...w(o),entries:s})}});function b(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new mr({type:"enum",entries:r,...w(t)})}var ap=m("ZodLiteral",(e,t)=>{ps.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function O(e,t){return new ap({type:"literal",values:Array.isArray(e)?e:[e],...w(t)})}var up=m("ZodTransform",(e,t)=>{ls.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new De(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(xe(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(xe(i))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((s)=>(r.value=s,r.fallback=!0,r));return r.value=o,r.fallback=!0,r}});function ta(e){return new up({type:"transform",transform:e})}var ra=m("ZodOptional",(e,t)=>{Wt.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function a(e){return new ra({type:"optional",innerType:e})}var cp=m("ZodExactOptional",(e,t)=>{fs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function pp(e){return new cp({type:"optional",innerType:e})}var lp=m("ZodNullable",(e,t)=>{ds.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ai(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ki(e){return new lp({type:"nullable",innerType:e})}var fp=m("ZodDefault",(e,t)=>{ms.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dp(e,t){return new fp({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Lt(t)}})}var mp=m("ZodPrefault",(e,t)=>{hs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Si(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hp(e,t){return new mp({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Lt(t)}})}var na=m("ZodNonOptional",(e,t)=>{gs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function gp(e,t){return new na({type:"nonoptional",innerType:e,...w(t)})}var _p=m("ZodCatch",(e,t)=>{_s.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ki(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xp(e,t){return new _p({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var oa=m("ZodPipe",(e,t)=>{Yt.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zi(e,r,n,o),e.in=t.in,e.out=t.out});function Wi(e,t){return new oa({type:"pipe",in:e,out:t})}var yp=m("ZodPreprocess",(e,t)=>{oa.init(e,t),xs.init(e,t)}),bp=m("ZodReadonly",(e,t)=>{ys.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function $p(e){return new bp({type:"readonly",innerType:e})}var Ap=m("ZodCustom",(e,t)=>{bs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hi(e,r,n,o)});function wp(e,t={}){return ni(Ap,e,t)}function zp(e,t){return oi(e,t)}function _(e,t){return new yp({type:"pipe",in:ta(e),out:t})}var Ne={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var sa;(function(e){})(sa||(sa={}));var qg=Z(),Jg=Z(),Bg=Z(),Hg=Z(),Gg=Z(),Kg=Z(),Wg=Z(),Yg=Z(),Qg=Z(),Xg=Z(),e_=Z(),t_=Z(),r_=Z(),n_=Z(),o_=Z(),s_=Z(),i_=Z(),a_=Z(),u_=Z(),kp=d({color:a(u()),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Zp=d({family:a(u()),color:a(u()),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:a(u()),strokeWidth:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Op=d({top:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Ep=d({type:b(["caption"]),src:u().min(1).regex(/\S/),font:a(Zp),background:a(kp),margin:a(Op),trim:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),speed:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Pp=d({color:f([u().regex(/^#[0-9a-fA-F]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),threshold:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(0).lte(250)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),halo:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(0).lte(250)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var _t=d({top:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),bottom:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Rp=d({host:u(),cpCode:u(),path:a(f([u(),Re()])),filename:a(f([u(),Re()]))}).strict(),Cp=d({provider:O("akamai-netstorage"),options:a(Rp)}).strict(),Np=d({accountName:u(),container:u(),prefix:a(f([u(),Re()])),filename:a(f([u(),Re()]))}).strict(),Tp=d({provider:O("azure-blob-storage"),options:a(Np)}).strict(),Ip=d({bucket:u(),prefix:a(u()),filename:a(u())}).strict();var jp=d({provider:O("google-cloud-storage"),options:a(Ip)}).strict();var Fp=d({folderId:a(u()),filename:a(u())}).strict();var Dp=d({provider:O("google-drive"),options:a(Fp)}).strict();var Lp=d({playbackPolicy:a(I(b(["public","signed"]))),passthrough:a(u().max(255))}).strict();var Up=d({provider:O("mux"),options:a(Lp)}).strict();var Mp=d({region:u(),bucket:u(),prefix:a(u()),filename:a(u()),acl:a(u())}).strict();var vp=d({provider:O("s3"),options:a(Mp)}).strict();var Vp=d({provider:O("shotstack"),exclude:a(T())}).strict();var qp=d({title:a(u().max(150)),privacyLevel:a(b(["public","friends","private"])),disableDuet:a(T()).default(!1),disableStitch:a(T()).default(!1),disableComment:a(T()).default(!1)}).strict(),Jp=d({provider:O("tiktok"),options:a(qp)}).strict(),Bp=d({view:a(b(["anybody","nobody","contacts","password","unlisted"])),embed:a(b(["public","private","whitelist"])),comments:a(b(["anybody","nobody","contacts"])),download:a(T()),add:a(T())}).strict();var Hp=d({name:a(u()),description:a(u()),privacy:a(Bp),folderUri:a(u())}).strict();var Gp=d({provider:O("vimeo"),options:a(Hp)}).strict();var gr=ea("provider",[Vp,Up,vp,jp,Dp,Gp,Jp,Cp,Tp]);var Kp=d({horizontal:a(T()),vertical:a(T())}).strict();var Wp=d({src:u()}).strict();var Yp=d({type:b(["image","video","audio"]),prompt:u().min(1).max(4000).regex(/\S/),model:a(u()),options:a(Ce(u(),Z()))}).strict();var Qp=d({model:u(),type:b(["image","video","audio"]),name:a(u()),description:a(u()),options:a(Ce(u(),Z())),available:a(T()),unavailableReason:a(b(["AiCapabilityNotIncluded","AiDisabled","AiAccessUnavailable"]))}).strict();var ia=d({asset:Yp,length:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gt(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Xp=d({type:b(["html5"]),html:u().max(1e6),css:a(u().max(500000)),js:a(u().max(500000))}).strict();var el=d({type:b(["html"]),html:u(),css:a(u()),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:a(u()),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"]))}).strict();var tl=d({type:b(["image"]),src:a(u().min(1).regex(/\S/)),prompt:a(u().max(4000)),model:a(u()),options:a(Ce(u(),Z())),crop:a(_t)}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Ne.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var rl=d({type:b(["image-to-video"]),src:u().min(1),prompt:a(u()),aspectRatio:a(b(["1:1","4:3","16:9","9:16","3:4","21:9","9:21"])),speed:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:a(_t)}).strict();var nl=d({preset:b(["conference","interview","lecture","meeting","mobile_phone","music","podcast","studio","voice_over"])}).strict();var ol=d({provider:u().default("dolby"),options:nl}).strict();var sl=d({enhancement:O("dolbyEnhancement_DolbyEnhancement")}).strict().and(ol);var il=d({audio:a(sl)}).strict();var al=d({status:u(),title:u(),detail:u()}).strict();var c_=d({errors:I(al)}).strict();var ul=d({type:u(),id:u()}).strict();var p_=d({data:ul}).strict();var cl=d({id:u(),url:u(),expires:u()}).strict();var pl=d({type:u(),id:u(),attributes:cl}).strict();var l_=d({data:pl}).strict();var ll=d({speed:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),preservePitch:a(T())}).strict();var fl=d({format:a(b(["srt","vtt"]))}).strict();var dl=d({type:b(["luma"]),src:u().min(1).regex(/\S/),trim:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var aa=d({find:u(),replace:Z()}).strict();var ml=d({capture:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var hl=d({start:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var gl=d({id:u(),owner:u(),region:a(u()),renderId:a(u()),providerId:a(u()),filename:a(u()),url:a(u()),status:b(["importing","ready","failed","deleted"]),created:a(u()),updated:a(u())}).strict();var ua=d({type:u(),attributes:gl}).strict();var f_=d({data:I(ua)}).strict();var d_=d({data:ua}).strict();var m_=d({error:u(),code:a(u()),available:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var h_=d({error:d({name:b(["UnknownGenerationModel","WithdrawnGenerationModel"]),message:u()})}).strict();var g_=d({models:I(Qp)}).strict();var __=d({credits:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),ceiling:T()}).strict();var x_=d({id:u(),status:b(["queued","processing","done","failed"]),url:a(u()),error:a(u())}).strict();var y_=d({success:T(),message:u(),response:Ce(u(),Z())}).strict();var _l=d({message:u(),id:u()}).strict();var b_=d({success:T(),message:u(),response:_l}).strict();var xl=d({id:u(),name:u(),created:a(u()),updated:a(u())}).strict();var yl=d({owner:u(),templates:I(xl)}).strict();var $_=d({success:T(),message:u(),response:yl}).strict();var bl=d({message:u(),id:u()}).strict();var A_=d({success:T(),message:u(),response:bl}).strict();var $l=d({family:a(u()),weight:a(Z()).default("400"),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(1).lte(500)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:a(b(["none","underline","line-through"]))}).strict();var Al=d({style:b(["karaoke","highlight","pop","fade","slide","bounce","typewriter","none"]),direction:a(b(["left","right","up","down"]))}).strict();var wl=d({family:a(u()).default("Roboto"),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(500)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:a(Z()).default("400"),style:a(b(["normal","italic"])),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),ca=d({horizontal:a(b(["left","center","right"])),vertical:a(b(["top","middle","bottom"]))}).strict();var zl=d({preset:b(["fadeIn","slideIn","typewriter","ascend","shift","movingLetters"]),duration:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0.1).lte(30)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),style:a(b(["character","word"])),direction:a(b(["left","right","up","down"]))}).strict();var pa=d({color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),borderRadius:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wrap:a(T()).default(!1),padding:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(0).lte(200)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var la=d({width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),radius:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict();var fa=d({type:a(b(["linear","radial"])),angle:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(360)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),stops:I(d({offset:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),color:f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])})).min(2)}).strict();var Sl=d({letterSpacing:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:a(b(["none","uppercase","lowercase","capitalize"])),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(1).lte(500)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:a(b(["none","underline","line-through"])),gradient:a(fa)}).strict(),da=d({top:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),right:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),bottom:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),left:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict();var _r=d({offsetX:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),offsetY:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),blur:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5)}).strict();var xt=d({width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1)}).strict();var kl=d({font:a($l),stroke:a(f([xt,b(["none"])])),shadow:a(f([_r,b(["none"])]))}).strict();var Zl=d({type:b(["rich-caption"]),src:u().min(1),font:a(wl),style:a(Sl),stroke:a(xt),shadow:a(_r),background:a(pa),border:a(la),padding:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),da])),align:a(ca),active:a(kl),animation:a(Al)}).strict();var Ol=d({family:a(u()).default("Open Sans"),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(500)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:a(Z()).default("400"),style:a(b(["normal","italic"])),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:a(xt)}).strict();var El=d({letterSpacing:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wordSpacing:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:a(b(["none","uppercase","lowercase","capitalize"])),textDecoration:a(b(["none","underline","line-through"])),gradient:a(fa)}).strict();var Pl=d({type:b(["rich-text"]),text:u().max(5000),font:a(Ol),style:a(El),stroke:a(xt),shadow:a(_r),background:a(pa),border:a(la),padding:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),da])),align:a(ca),animation:a(zl)}).strict();var Rl=d({id:a(u()),owner:a(u()),status:a(b(["queued","failed"])),created:a(u())}).strict();var Cl=d({type:a(u()),attributes:a(Rl)}).strict();var w_=d({data:Cl}).strict();var Nl=d({url:u(),id:u(),destinations:I(gr)}).strict();var Tl=d({type:b(["shape"]),shape:b(["rectangle","circle","line"]),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fill:a(d({color:a(u()),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),stroke:a(d({color:a(u()),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),rectangle:a(d({width:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),height:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),cornerRadius:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),circle:a(d({radius:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])})),line:a(d({length:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),thickness:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}))}).strict();var ma=d({width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(4096)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(4096)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var ha=d({format:a(b(["mp4","webm","mov","avi","mkv","ogv","wmv","avif","gif","mp3","wav","jpg","png","webp","tif"])),size:a(ma),fit:a(b(["cover","contain","crop"])),resolution:a(b(["preview","mobile","sd","hd","fhd"])),quality:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(100)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([O(12),O(15),O(23.976),O(24),O(25),O(29.97),O(30),O(48),O(50),O(59.94),O(60)])),speed:a(ll),keyframeInterval:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int().gte(1).lte(300)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fixOffset:a(T()),fixRotation:a(T()),enhance:a(il),filename:a(u())}).strict();var Il=d({renditions:a(I(ha)),transcription:a(fl)}).strict();var jl=d({id:u(),status:a(b(["queued","importing","ready","failed","deleted","overwritten"])),url:a(u()),executionTime:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),transformation:a(ha),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Fl=d({renditions:a(I(jl))}).strict();var Dl=d({id:u(),owner:u(),input:a(u()),source:a(u()),status:a(b(["queued","importing","ready","failed","deleted","overwritten"])),outputs:a(Fl),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),created:a(u()),updated:a(u())}).strict();var ga=d({type:u(),id:u(),attributes:Dl}).strict();var z_=d({data:I(ga)}).strict();var S_=d({data:ga}).strict();var Ll=d({url:a(u()),outputs:a(Il),destinations:a(gr),callback:a(u())}).strict();var Ul=d({src:u().min(1).regex(/\S/),effect:a(b(["fadeIn","fadeOut","fadeInFadeOut"])),volume:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Ml=d({type:b(["svg"]),src:u().min(1).max(500000)}).strict();var vl=d({id:u(),merge:a(I(aa))}).strict();var Vl=d({horizontal:a(b(["left","center","right"])),vertical:a(b(["top","center","bottom"]))}).strict();var ql=d({preset:b(["typewriter"]),duration:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0.1).lte(30)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),Jl=d({color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(100)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),wrap:a(T())}).strict();var Bl=d({family:a(u()),color:a(u()),opacity:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),weight:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Hl=d({width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),color:a(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),Gl=d({type:b(["text"]),text:u(),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),font:a(Bl),background:a(Jl),alignment:a(Vl),stroke:a(Hl),animation:a(ql),ellipsis:a(u())}).strict().superRefine((e,t)=>{if(e.background&&e.background.wrap===!0)t.addIssue({code:Ne.custom,message:'background.wrap is only supported on rich-text and rich-caption assets. For type "text", migrate to type "rich-text" to use this feature.',path:["background","wrap"]})});var Kl=d({type:b(["text-to-image"]),prompt:u(),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().int()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:a(_t)}).strict();var Wl=d({capture:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),scale:f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var Yl=d({format:b(["mp4","gif","mp3","jpg","png","bmp"]),resolution:a(b(["preview","mobile","sd","hd","1080","4k"])),aspectRatio:a(b(["16:9","9:16","1:1","4:5","4:3"])),size:a(ma),fps:a(f([O(12),O(15),O(23.976),O(24),O(25),O(29.97),O(30),O(48),O(50),O(59.94),O(60)])),scaleTo:a(b(["preview","mobile","sd","hd","1080","4k"])),quality:a(b(["verylow","low","medium","high","veryhigh"])),repeat:a(T()),mute:a(T()),range:a(hl),poster:a(ml),thumbnail:a(Wl),destinations:a(I(gr))}).strict().superRefine((e,t)=>{var r=e.format==="mp3";if(!r&&e.size!=null&&(e.size.width==null||e.size.height==null)){t.addIssue({code:Ne.custom,path:["size"],message:"size requires both width and height"});return}var n=typeof e.resolution==="string",o=e.size!=null&&e.size.width!=null&&e.size.height!=null;if(!r&&!n&&!o)t.addIssue({code:Ne.custom,message:'output requires either "resolution" or "size" (with width and height)'})});var Ql=d({in:a(b(["none","fade","fadeSlow","fadeFast","reveal","revealSlow","revealFast","wipeLeft","wipeLeftSlow","wipeLeftFast","wipeRight","wipeRightSlow","wipeRightFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast","carouselLeft","carouselLeftSlow","carouselLeftFast","carouselRight","carouselRightSlow","carouselRightFast","carouselUp","carouselUpSlow","carouselUpFast","carouselDown","carouselDownSlow","carouselDownFast","shuffleTopRight","shuffleTopRightSlow","shuffleTopRightFast","shuffleRightTop","shuffleRightTopSlow","shuffleRightTopFast","shuffleRightBottom","shuffleRightBottomSlow","shuffleRightBottomFast","shuffleBottomRight","shuffleBottomRightSlow","shuffleBottomRightFast","shuffleBottomLeft","shuffleBottomLeftSlow","shuffleBottomLeftFast","shuffleLeftBottom","shuffleLeftBottomSlow","shuffleLeftBottomFast","shuffleLeftTop","shuffleLeftTopSlow","shuffleLeftTopFast","shuffleTopLeft","shuffleTopLeftSlow","shuffleTopLeftFast","zoom"])),out:a(b(["none","fade","fadeSlow","fadeFast","reveal","revealSlow","revealFast","wipeLeft","wipeLeftSlow","wipeLeftFast","wipeRight","wipeRightSlow","wipeRightFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast","carouselLeft","carouselLeftSlow","carouselLeftFast","carouselRight","carouselRightSlow","carouselRightFast","carouselUp","carouselUpSlow","carouselUpFast","carouselDown","carouselDownSlow","carouselDownFast","shuffleTopRight","shuffleTopRightSlow","shuffleTopRightFast","shuffleRightTop","shuffleRightTopSlow","shuffleRightTopFast","shuffleRightBottom","shuffleRightBottomSlow","shuffleRightBottomFast","shuffleBottomRight","shuffleBottomRightSlow","shuffleBottomRightFast","shuffleBottomLeft","shuffleBottomLeftSlow","shuffleBottomLeftFast","shuffleLeftBottom","shuffleLeftBottomSlow","shuffleLeftBottomFast","shuffleLeftTop","shuffleLeftTopSlow","shuffleLeftTopFast","shuffleTopLeft","shuffleTopLeftSlow","shuffleTopLeftFast","zoom"]))}).strict();var ne=d({from:a(Z()),to:a(Z()),start:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),interpolation:a(b(["linear","bezier","constant"])),easing:a(b(["ease","easeIn","easeOut","easeInOut","easeInQuad","easeInCubic","easeInQuart","easeInQuint","easeInSine","easeInExpo","easeInCirc","easeInBack","easeOutQuad","easeOutCubic","easeOutQuart","easeOutQuint","easeOutSine","easeOutExpo","easeOutCirc","easeOutBack","easeInOutQuad","easeInOutCubic","easeInOutQuart","easeInOutQuint","easeInOutSine","easeInOutExpo","easeInOutCirc","easeInOutBack"]))}).strict();var Xl=d({type:b(["audio"]),src:a(u().min(1).regex(/\S/)),prompt:a(u().max(4000)),model:a(u()),options:a(Ce(u(),Z())),trim:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),speed:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"]))}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Ne.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var _a=d({x:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(-10).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),y:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(-10).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)]))}).strict();var ef=d({angle:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(-360).lte(360)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)]))}).strict();var tf=d({x:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(-100).lte(100)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),y:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(-100).lte(100)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)]))}).strict();var rf=d({type:b(["text-to-speech"]),text:u(),voice:u(),language:a(u()),newscaster:a(T()).default(!1),trim:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),speed:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"]))}).strict();var nf=d({type:b(["title"]),text:u(),style:a(b(["minimal","blockbuster","vogue","sketchy","skinny","chunk","chunkLight","marker","future","subtitle"])),color:a(u()),size:a(b(["xx-small","x-small","small","medium","large","x-large","xx-large"])),background:a(u()),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:a(_a)}).strict();var of=d({rotate:a(ef),skew:a(tf),flip:a(Kp)}).strict();var sf=d({type:b(["video"]),src:a(u().min(1).regex(/\S/)),prompt:a(u().max(4000)),model:a(u()),options:a(Ce(u(),Z())),transcode:a(T()),trim:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(1)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),volumeEffect:a(b(["none","fadeIn","fadeOut","fadeInFadeOut"])),speed:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0).lte(10)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),crop:a(_t),chromaKey:a(Pp)}).strict().superRefine((e,t)=>{var r=typeof e.src==="string"&&e.src.trim().length>0,n=typeof e.prompt==="string"&&e.prompt.trim().length>0;if(!r&&!n)t.addIssue({code:Ne.custom,message:'A media asset requires either "src" (a source URL) or "prompt" (to generate the asset). Provide one.',path:["src"]})});var af=ea("type",[sf,tl,Gl,Pl,Xl,dl,Ep,Zl,el,Xp,nf,Tl,Ml,Kl,rl,rf]);var uf=d({id:a(u()),asset:af,start:f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),f([u().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])]),length:f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(0)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),f([u().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])]),fit:a(b(["cover","contain","crop","none"])),scale:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),width:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(1).lte(3840)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g().gte(1).lte(2160)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),position:a(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:a(_a),transition:a(Ql),effect:a(b(["zoomIn","zoomInSlow","zoomInFast","zoomOut","zoomOutSlow","zoomOutFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast"])),filter:a(b(["none","blur","boost","contrast","darken","greyscale","lighten","muted","negative"])),opacity:a(f([f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),I(ne)])),transform:a(of),alias:a(f([u().regex(/^[A-Za-z0-9_-]+$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var cf=uf.transform((e)=>{if(e.asset&&typeof e.asset==="object"&&"type"in e.asset){if(e.asset.type==="rich-text"){let{fit:r,...n}=e;return n}}return e}),pf=d({clips:I(cf).min(1)}).strict();var lf=d({soundtrack:a(Ul),background:a(u()),fonts:a(I(Wp)),tracks:I(pf).min(1),cache:a(T())}).strict();var Ge=d({timeline:lf,output:Yl,merge:a(I(aa)),callback:a(u()),disk:a(b(["local","mount"])),instance:a(b(["s1","s2","a1"]))}).strict(),xa=Ge,ff=d({id:u(),owner:u(),plan:a(u()),status:b(["queued","fetching","preprocessing","rendering","generating","saving","done","failed"]),error:a(u()),duration:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),renderTime:a(f([_((e)=>{if(e===""||e===null||e===void 0)return;if(Array.isArray(e))return e;if(typeof e==="string"){if(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(e))return e;return Number(e)}return e},g()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),url:a(u()),poster:a(f([u(),Re()])),thumbnail:a(f([u(),Re()])),data:a(Ge),created:a(u()),updated:a(u())}).strict();var k_=d({success:T(),message:u(),response:ff}).strict();var df=d({id:u(),name:u(),owner:u(),template:Ge}).strict();var Z_=d({success:T(),message:u(),response:df}).strict();var ya=d({name:u(),template:a(Ge)}).strict();var O_=d({body:Ge,path:a(S()),query:a(S())}).strict();var E_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(d({data:a(T()),merged:a(T())}))}).strict();var P_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var R_=d({body:ya,path:a(S()),query:a(S())}).strict();var C_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),N_=hr(),T_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var I_=d({body:ya,path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var j_=d({body:vl,path:a(S()),query:a(S())}).strict();var F_=d({body:a(S()),path:d({url:u()}),query:a(S())}).strict();var D_=d({body:ia,path:a(S()),query:a(S()),headers:a(d({"Idempotency-Key":a(u())}))}).strict();var L_=d({body:ia,path:a(S()),query:a(S())}).strict();var U_=d({body:a(S()),path:d({id:u()}),query:a(S())}).strict();var M_=d({body:a(S()),path:a(S()),query:a(d({expand:a(b(["options"]))}))}).strict();var v_=d({body:a(S()),path:d({id:u()}),query:a(S())}).strict();var V_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),q_=hr(),J_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var B_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var H_=d({body:Nl,path:a(S()),query:a(S())}).strict();var G_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var K_=d({body:Ll,path:a(S()),query:a(S())}).strict();var W_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict(),Y_=hr(),Q_=d({body:a(S()),path:d({id:f([u().regex(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}),query:a(S())}).strict();var X_=d({body:a(S()),path:a(S()),query:a(S())}).strict();var mf={alignment:"align",duration:"length",transitions:"transition",name:"family"},ba={"align.vertical":{center:"middle"},fit:{cover:"crop"}},hf=new Set(["arapey","clear sans","clearsans","didact gothic","didactgothic","montserrat","movlette","notoemoji","open sans","opensans","permanent marker","permanentmarker","roboto","sue ellen francisco","sueellenfrancisco","uni neue","unineue","work sans","worksans"]),gf=/-(?:(?:Extra(?:Light|Bold)|SemiBold|Regular|Medium|Light|Black|Bold|Thin|Heavy)(?:Italic|Oblique)?|(?:Italic|Oblique))$/i,_f=new Set(["image","video","audio","luma"]);function Te(e){let t=[],r=xa.safeParse(e);if(!r.success)for(let o of wf(r.error))t.push({...o,level:"error"});for(let o of xf(e))t.push(o);return{ok:!t.some((o)=>(o.level??"error")==="error"),issues:t}}function be(e){let t=e.filter((o)=>(o.level??"error")==="error"),r=e.filter((o)=>o.level==="warning"),n=[];if(t.length){let o=r.length?`, ${r.length} warning${xr(r.length)}`:"";n.push(`✗ Edit JSON failed validation (${t.length} error${xr(t.length)}${o}):`)}else n.push(`⚠ Edit JSON valid, with ${r.length} warning${xr(r.length)}:`);for(let o of e){let s=(o.level??"error")==="error"?"✗":"⚠",i=o.suggestion?` (did you mean '${o.suggestion}'?)`:"";n.push(` ${s} ${o.path||"<root>"}: ${o.message}${i}`)}return n.join(`
|
|
89
|
+
`)}function xr(e){return e===1?"":"s"}function xf(e){let t=[],n=e?.timeline,o=n?.tracks;if(!Array.isArray(o))return t;let s=[];if(Array.isArray(n?.fonts))for(let i of n.fonts){let c=bf(i?.src);if(c)s.push(c)}return o.forEach((i,c)=>{let p=i?.clips;if(!Array.isArray(p))return;let l=p.map((h,y)=>({ci:y,start:h?.start,len:h?.length})).filter((h)=>typeof h.start==="number"&&typeof h.len==="number");for(let h=0;h<l.length;h++)for(let y=h+1;y<l.length;y++){let A=l[h],x=l[y];if(A.start<x.start+x.len&&x.start<A.start+A.len){let[z,M]=A.ci<x.ci?[A.ci,x.ci]:[x.ci,A.ci];t.push({path:`timeline.tracks[${c}].clips`,code:"clip_overlap",level:"error",message:`clips [${z}] and [${M}] overlap in time — clips on one track must not `+"overlap (they flicker). Put simultaneous elements on separate tracks."})}}p.forEach((h,y)=>{let A=h?.asset,x=`timeline.tracks[${c}].clips[${y}]`,z=A?.font?.family;if(typeof z==="string"&&z.length>0){let ie=yf(z,s,`${x}.asset.font.family`);if(ie)t.push(ie)}let M=A?.type;if(M==="html5"&&typeof A?.js==="string"&&A.js.length>0){let ie=$f(A.js,`${x}.asset.js`);if(ie)t.push(ie)}let N=A?.src;if(typeof M==="string"&&_f.has(M)&&typeof N==="string")if(/^https:\/\//i.test(N)||/^alias:\/\//i.test(N));else if(/^data:/i.test(N))t.push({path:`${x}.asset.src`,code:"src_not_public",level:"warning",message:"data: URIs aren't fetched by render workers — host the asset and use a public https:// URL."});else if(/^http:\/\//i.test(N))t.push({path:`${x}.asset.src`,code:"src_not_https",level:"warning",message:"http:// sources are blocked/upgraded — use https://."});else t.push({path:`${x}.asset.src`,code:"src_not_public",level:"warning",message:`'${Af(N,48)}' is not a public https:// URL — local paths don't render. `+"Host it with 'shotstack ingest upload' and use the returned URL."})})}),t}function yf(e,t,r){let n=e.toLowerCase();if(hf.has(n))return null;if(t.some((s)=>n===s.full.toLowerCase()||n===s.base.toLowerCase()))return null;let o="the exact family name stored in the font file, which can differ from the name on Google Fonts (Space Grotesk's file says 'Space Grotesk Light')";if(t.length===0)return{path:r,code:"font_not_loaded",level:"warning",message:`font.family '${e}' is neither a built-in font nor loaded via timeline.fonts[] — `+"it renders in Roboto. Add the font's URL to timeline.fonts[] and use its filename as font.family."};if(t.length===1)return{path:r,code:"font_not_loaded",level:"warning",message:`font.family '${e}' doesn't match the timeline.fonts[] filename. It renders in that font only because it's the sole entry; add another font and it falls back to Roboto unless it's ${o}. Use the filename to be sure.`,suggestion:t[0].full};return{path:r,code:"font_not_loaded",level:"warning",message:`font.family '${e}' doesn't match any timeline.fonts[] filename (${t.map((s)=>`'${s.full}'`).join(", ")}). It renders in Roboto unless it's ${o}. Use the filename to be sure.`}}function bf(e){if(typeof e!=="string")return null;let t=e.split(/[?#]/,1)[0].split("/").pop()??"";try{t=decodeURIComponent(t)}catch{}let r=t.replace(/\.(ttf|otf|woff2?|eot)$/i,"");return r.length?{full:r,base:r.replace(gf,"")}:null}function $f(e,t){try{Function(e)}catch(r){let n=r instanceof Error?r.message:String(r);return{path:t,code:"js_syntax_error",level:"error",message:`asset.js has a syntax error — the html5 clip will render completely blank with no render error. ${n}`}}return null}function Af(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function wf(e){return e.issues.flatMap((t)=>zf(t))}function zf(e){let t=kf(e.path);if(e.code==="unrecognized_keys"&&"keys"in e)return e.keys.map((n)=>({path:Zf(t,n),code:e.code,message:`unrecognized key '${n}'`,suggestion:mf[n]}));let r=Sf(t,e);return[{path:t,code:e.code,message:e.message,...r?{suggestion:r}:{}}]}function Sf(e,t){let r=e.replace(/\[\d+\]/g,""),n=r.split(".").slice(-2).join(".");if(t.code==="invalid_value"&&"received"in t){let o=String(t.received);return ba[n]?.[o]??ba[r]?.[o]}return}function kf(e){return e.reduce((t,r)=>{if(typeof r==="number")return`${t}[${r}]`;let n=String(r);return t?`${t}.${n}`:n},"")}function Zf(e,t){return e?`${e}.${t}`:t}var $a=new F("render").description("Submit a Shotstack Edit JSON to the render API").argument("<file>","Path to a Shotstack Edit JSON file").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--watch","After submitting, poll until the render reaches a terminal state").option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("render",H("render"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=Ef(process.cwd(),e),i=await Of(s,"utf8"),c=JSON.parse(i),p=Te(c);if(!p.ok){if(r==="json")console.log(JSON.stringify({ok:!1,issues:p.issues}));else console.error(be(p.issues));return{exitCode:1,validation:p}}if(p.issues.length>0&&r!=="json")console.error(be(p.issues));let l=V({apiKey:o,env:n}),h=t.watch?2:1,y="";for(let A=1;A<=h;A++){let x=await l.post("/render",c),z=x.response.id;if(y=z,!t.watch)return E(r,{id:z},z),{renderId:z,response:x.response};let M=await It(l,z,r,!0);if(M.status!=="failed")return{renderId:z,response:M,exitCode:0};let N=Rf(M.error);if(N&&A<h){if(r!=="json")console.error(`⚠ render failed (${M.error??"unknown"}) — looks transient, resubmitting ${A+1}/${h}…`);await Cf(2000);continue}if(r!=="json")console.error(N?`✗ render still failing after ${h} attempts. For a complex multi-scene edit, preview it client-side first: shotstack studio ${e}`:`✗ render failed: ${M.error??"unknown error"}`);return{renderId:z,response:M,exitCode:1}}return{renderId:y,exitCode:1}})}),Pf=/temporar|try again|time ?d? ?out|timeout|too many requests|service unavailable|unavailable|throttl/i;function Rf(e){return typeof e==="string"&&Pf.test(e)}function Cf(e){return new Promise((t)=>setTimeout(t,e))}import{readFile as Nf,writeFile as Tf,mkdtemp as If}from"node:fs/promises";import{tmpdir as jf}from"node:os";import{join as Aa}from"node:path";import{spawn as Ff}from"node:child_process";var wa="https://github.com/shotstack/shotstack-cli/issues/new?template=bug.yml",Df=6000,Za=5,Oa=new F("feedback").description("Open a pre-filled GitHub issue with a flight-recorder dossier from your last 5 invocations").action(async()=>{let e=await Lf(Za),t=Uf(e),r=vf(e),n=`&title=${encodeURIComponent(r)}`,o=`${wa}${n}&body=${encodeURIComponent(t)}`;if(o.length<=Df){ka(o),console.log("Opened browser with pre-filled issue. Review before submitting.");return}let s=await If(Aa(jf(),"shotstack-feedback-")),i=Aa(s,"dossier.md");await Tf(i,t),ka(`${wa}${n}`),console.log(`Dossier too large to inline. Saved to: ${i}`),console.log("Drag the file into the issue body, or paste its contents.")});async function Lf(e){let t=Ye(),r;try{r=await Nf(t,"utf8")}catch{return[]}let o=r.split(`
|
|
90
|
+
`).filter((i)=>i.trim().length>0).slice(-e).reverse(),s=[];for(let i of o)try{s.push(JSON.parse(i))}catch{}return s}function Uf(e){let t=[];if(t.push("## Environment"),t.push(`- Shotstack CLI: ${Fe}`),t.push(`- OS: ${process.platform}-${process.arch}`),t.push(""),t.push(`## Last ${Za} invocations (most recent first)`),t.push(""),e.length===0)t.push("_No recorded invocations._");else for(let r of e){let n=(r.args??[]).join(" "),o=`### ${r.ts} — shotstack ${r.cmd}${n?" "+n:""}`;if(t.push(o),t.push(`- Exit: ${r.exit} Duration: ${r.durationMs}ms`),r.renderId)t.push(`- Render ID: ${r.renderId}`);if(r.response!==void 0){let s=typeof r.response==="string"?r.response:JSON.stringify(r.response);t.push(`- Response: ${s}`)}if(r.error)t.push(`- Error: ${r.error.name}: ${r.error.message}`);t.push("")}return t.push(`[full log at ${Ye()}]`),t.push(""),t.push("## What I expected vs what happened"),t.push("<!-- Describe the issue, request, or question here. -->"),t.join(`
|
|
91
|
+
`)}var za=80,Mf="Feedback from shotstack CLI";function vf(e){let t=e.find((o)=>o.error);if(t&&t.error)return yr(`${t.cmd}: ${t.error.name} — ${t.error.message}`);let r=e.find((o)=>Sa(o.response)!==null);if(r){let o=Sa(r.response);return yr(`Render failed: ${o}`)}let n=e.find((o)=>o.exit!==0);if(n)return yr(`${n.cmd} exited ${n.exit}`);return Mf}function Sa(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e;if(t.state!=="failed")return null;return typeof t.error==="string"&&t.error.length>0?t.error:"unknown error"}function yr(e){return e.length<=za?e:e.slice(0,za-1)+"…"}function ka(e){let t=process.platform==="win32",r=process.platform==="darwin"?"open":t?"cmd":"xdg-open",o=Ff(r,t?["/c","start","",e]:[e],{stdio:"ignore",detached:!0});o.on("error",()=>{console.error(`Could not open browser. Visit: ${e}`)}),o.unref()}import{readFile as Vf}from"node:fs/promises";import{resolve as qf}from"node:path";import{spawn as Pa,execSync as Jf}from"node:child_process";var Ra="https://shotstack.studio",Bf=`${Ra}/api/share`,Hf=5000,Gf=6000,Ca=new F("studio").description("Open the Edit JSON in the shotstack.studio web editor. By default, posts the JSON to the share API and returns a short URL.").argument("<file>","Path to a Shotstack Edit JSON file").option("--copy","Copy the URL to the clipboard").option("--no-open","Do not try to open the URL in a browser").option("--no-shorten","Skip the share API; emit a base64url URL inline").option("--env <name>",`Environment whose API key makes the short link permanent: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{let r=C(t.output),n=qf(process.cwd(),e),o=await Vf(n,"utf8"),s=JSON.parse(o),i=Te(s);if(!i.ok){if(r==="json")console.log(JSON.stringify({ok:!1,issues:i.issues}));else console.error(be(i.issues));process.exit(1)}let c=t.shorten?Wf(t.env):void 0,{url:p,shortened:l}=await Kf(s,{shorten:t.shorten,apiKey:c,env:t.shorten?me(t.env):void 0});if(!l&&p.length>Gf)console.error(`warning: encoded URL is ${p.length} characters; large templates may exceed browser URL limits.`);if(t.copy)await Xf(p);let h=t.open&&nd()&&td(p);if(r==="json"||!h)E(r,{url:p,shortened:l},p)});async function Kf(e,t={}){if(t.shorten!==!1){let n=await Qf(e,t.apiKey);if("url"in n){if(!t.apiKey)console.error(t.env==="dev"?"note: this link lasts 30 days. Dev keys can't make links permanent; use --env stage or --env v1.":"note: this link lasts 30 days. Run `shotstack login` or set SHOTSTACK_API_KEY to make your links permanent.");return{url:n.url,shortened:!0}}console.error(`warning: the shotstack.studio share API failed (${n.failed}); falling back to inline URL.`)}return{url:Yf(e),shortened:!1}}function Wf(e,t){let r=me(e);if(r==="dev")return;try{return q(r,t)}catch(n){if(n instanceof ue)return;throw n}}function Yf(e){let t=Buffer.from(JSON.stringify(e),"utf8").toString("base64url");return`${Ra}/#json=${t}`}async function Qf(e,t){let r={"Content-Type":"application/json"};if(t)r["x-api-key"]=t;let n=await Ea(e,r);return"retry"in n&&n.retry?Ea(e,r):n}async function Ea(e,t){let r;try{r=await fetch(Bf,{method:"POST",headers:t,body:JSON.stringify(e),redirect:"error",signal:AbortSignal.timeout(Hf)})}catch(o){return{failed:o.message,retry:!0}}let n=await r.json().catch(()=>({}));if(r.ok&&n.url)return{url:n.url};if(r.status===429||r.status>=500)return{failed:`HTTP ${r.status}`,retry:!0};if(r.status>=400){let o=`${n.error??"no reason given"} (HTTP ${r.status})`;throw new ee(r.status,n,`The shotstack.studio share API refused the request: ${o}`)}return{failed:`HTTP ${r.status} without a url`,retry:!1}}async function Xf(e){let{cmd:t,args:r}=ed();await new Promise((n,o)=>{let s=Pa(t,r,{stdio:["pipe","ignore","ignore"]});s.on("error",o),s.on("exit",(i)=>i===0?n():o(Error(`${t} exited ${i}`))),s.stdin.end(e)})}function ed(){if(process.platform==="darwin")return{cmd:"pbcopy",args:[]};if(process.platform==="win32")return{cmd:"clip",args:[]};return{cmd:"xclip",args:["-selection","clipboard"]}}function td(e){let{cmd:t,args:r}=rd(e);try{let n=Pa(t,r,{detached:!0,stdio:"ignore"});return n.on("error",()=>{}),n.unref(),!0}catch{return!1}}function rd(e){if(process.platform==="win32")return{cmd:"cmd",args:["/c","start","",e]};if(process.platform==="darwin")return{cmd:"open",args:[e]};return{cmd:"xdg-open",args:[e]}}function nd(){if(process.platform==="darwin"||process.platform==="win32")return!0;if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return!1;try{return Jf("command -v xdg-open",{stdio:"ignore"}),!0}catch{return!1}}import{readFile as od}from"node:fs/promises";import{resolve as sd,extname as id}from"node:path";var ad=3000,ud=new Set(["ready","failed","deleted","overwritten"]),$e=new F("ingest").description("Ingest source media via the Shotstack Ingest API: upload local files, fetch remote URLs, and manage stored sources");$e.command("upload <file>").description("Upload a local file and host it on Shotstack for use as an Edit asset src").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--watch","Poll until the source is ready, then print its hosted URL").option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("ingest upload",H("upload"),async()=>{let r=C(t.output),n=J(t.env,"ingest"),o=q(n.name),s=V({apiKey:o,env:n}),i=await od(sd(process.cwd(),e)),c=await s.post("/upload"),{id:p,url:l}=c.data.attributes;return await cd(l,i,ld(e)),Na(s,p,r,t.watch===!0)})});$e.command("fetch <url>").description("Ingest a remote URL into Shotstack-hosted storage").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--watch","Poll until the source is ready, then print its hosted URL").option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("ingest fetch",H("fetch"),async()=>{let r=C(t.output),n=J(t.env,"ingest"),o=q(n.name),s=V({apiKey:o,env:n}),i=await s.post("/sources",{url:e});return Na(s,i.data.id,r,t.watch===!0)})});$e.command("status <id>").description("Poll the status of an ingested source").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--watch","Poll continuously until the source reaches a terminal state").option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("ingest status",H("status"),async()=>{let r=C(t.output),n=J(t.env,"ingest"),o=q(n.name),s=V({apiKey:o,env:n}),i=await Ta(s,e,r,t.watch===!0);return{renderId:i.id,response:yt(i),exitCode:i.status==="failed"?1:0}})});$e.command("list").description("List ingested sources").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{await B("ingest list",H("list"),async()=>{let t=C(e.output),r=J(e.env,"ingest"),n=q(r.name),i=(await V({apiKey:n,env:r}).get("/sources")).data.map((p)=>yt(p.attributes)),c=i.length?i.map((p)=>[p.id,p.status,p.source??""].join(" ").trimEnd()).join(`
|
|
92
|
+
`):"No sources.";return E(t,i,c),{response:{count:i.length}}})});$e.command("delete <id>").description("Delete an ingested source").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("ingest delete",H("delete"),async()=>{let r=C(t.output),n=J(t.env,"ingest"),o=q(n.name);return await V({apiKey:o,env:n}).del(`/sources/${encodeURIComponent(e)}`),E(r,{id:e,deleted:!0},`deleted ${e}`),{renderId:e,response:{id:e,deleted:!0}}})});async function Na(e,t,r,n){if(!n)return E(r,{id:t},t),{renderId:t,response:{id:t}};let o=await Ta(e,t,r,!0);return{renderId:t,response:yt(o),exitCode:o.status==="failed"?1:0}}async function Ta(e,t,r,n,o=ad){while(!0){let i=(await e.get(`/sources/${encodeURIComponent(t)}`)).data.attributes;if(E(r,yt(i),fd(i)),!n||ud.has(i.status))return i;await dd(o)}}async function cd(e,t,r){let n=await fetch(e,{method:"PUT",headers:r?{"content-type":r}:void 0,body:t});if(!n.ok){let o=await n.text().catch(()=>"");throw new ee(n.status,o||void 0,`PUT upload → ${n.status} ${n.statusText}`)}}var pd={".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".avi":"video/x-msvideo",".mkv":"video/x-matroska",".ogv":"video/ogg",".wmv":"video/x-ms-wmv",".gif":"image/gif",".mp3":"audio/mpeg",".wav":"audio/wav",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".flac":"audio/flac",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".avif":"image/avif",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".srt":"application/x-subrip",".vtt":"text/vtt",".ttf":"font/ttf",".otf":"font/otf",".woff":"font/woff",".woff2":"font/woff2"};function ld(e){return pd[id(e).toLowerCase()]}function yt(e){let t={id:e.id,status:e.status};if(e.source)t.source=e.source;if(e.input)t.input=e.input;if(e.width)t.width=e.width;if(e.height)t.height=e.height;if(e.duration)t.duration=e.duration;if(e.error)t.error=e.error;return t}function fd(e){let t=[e.status];if(e.source)t.push(e.source);if(e.error)t.push(`error: ${e.error}`);return t.join(" ")}function dd(e){return new Promise((t)=>setTimeout(t,e))}import{readFile as md}from"node:fs/promises";import{resolve as hd}from"node:path";async function gd(e,t){return(await e.get(`/templates/${encodeURIComponent(t)}`)).response}async function _d(e){return(await e.get("/templates")).response.templates}async function xd(e,t,r){return(await e.post("/templates",{name:t,template:r})).response.id}async function yd(e,t,r,n){let o={template:r};if(n)o.name=n;await e.put(`/templates/${encodeURIComponent(t)}`,o)}async function bd(e,t){await e.del(`/templates/${encodeURIComponent(t)}`)}async function Ia(e){let t=await md(hd(process.cwd(),e),"utf8");return JSON.parse(t)}var Ae=new F("template").description("Work with saved Shotstack templates");Ae.command("get <id>").description("Fetch a saved template's Edit JSON by id — pipe it to a file or `shotstack render`").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("template get",H("get"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=V({apiKey:o,env:n}),i=await gd(s,e);return E(r,i.template,JSON.stringify(i.template,null,2)),{templateId:i.id,exitCode:0}})});Ae.command("list").description("List your saved templates (id and name), newest first").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{await B("template list",H("list"),async()=>{let t=C(e.output),r=J(e.env),n=q(r.name),o=V({apiKey:n,env:r}),s=await _d(o),i=s.length?s.map((c)=>`${c.id} ${c.name??""}`.trimEnd()).join(`
|
|
93
|
+
`):"No templates found";return E(t,s,i),{count:s.length,exitCode:0}})});Ae.command("create <file>").description("Save an Edit JSON file as a new template; prints the new template id").requiredOption("--name <name>","Name for the saved template").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("template create",H("create"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=V({apiKey:o,env:n}),i=await Ia(e),c=await xd(s,t.name,i);return E(r,{id:c},c),{templateId:c,exitCode:0}})});Ae.command("update <id> <file>").description("Overwrite a saved template with an Edit JSON file").option("--name <name>","Also rename the template").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t,r)=>{await B("template update",H("update"),async()=>{let n=C(r.output),o=J(r.env),s=q(o.name),i=V({apiKey:s,env:o}),c=await Ia(t);return await yd(i,e,c,r.name),E(n,{id:e,status:"updated"},`updated ${e}`),{templateId:e,exitCode:0}})});Ae.command("delete <id>").description("Delete a saved template").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("template delete",H("delete"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=V({apiKey:o,env:n});return await bd(s,e),E(r,{id:e,status:"deleted"},`deleted ${e}`),{templateId:e,exitCode:0}})});import{readFile as $d}from"node:fs/promises";import{resolve as Ad}from"node:path";var ja=new F("validate").description("Validate an Edit JSON offline — schema (property names, enums, types) plus "+"same-track overlaps, unloaded fonts, non-public asset URLs and html5 JS syntax errors. No API key, no credits.").argument("<file>","Path to a Shotstack Edit JSON file").option("--strict","Treat warnings as errors (exit 1 on any warning)").option("--output <format>","Output format: text | json","text").action(async(e,t)=>{let r=C(t.output),n=Ad(process.cwd(),e),o=await $d(n,"utf8"),s;try{s=JSON.parse(o)}catch(l){let h=l instanceof Error?l.message:String(l),y={path:"<root>",code:"invalid_json",level:"error",message:h};if(r==="json")console.log(JSON.stringify({ok:!1,issues:[y]}));else console.error(`✗ ${e}: invalid JSON — ${h}`);process.exitCode=1;return}let i=Te(s),c=i.issues.some((l)=>l.level==="warning"),p=!i.ok||t.strict===!0&&c;if(r==="json")console.log(JSON.stringify({ok:!p,issues:i.issues}));else if(i.issues.length===0)console.log(`✓ ${e} is valid`);else{let l=be(i.issues);if(p)console.error(l);else console.log(l)}process.exitCode=p?1:0});async function wd(e){return(await e.get("/models")).models}async function bt(e,t){return e.get(`/models/${encodeURIComponent(t)}`)}var Fa=new F("models").description("List generation models with availability, or show one model's options").argument("[id]","Model id; prints the JSON Schema for its options").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("models",H("models"),async()=>{let r=C(t.output),n=J(t.env),o=q(n.name),s=V({apiKey:o,env:n});if(e){let c=await bt(s,e);return E(r,c,Sd(c)),{response:{model:c.model,available:c.available}}}let i=await wd(s);return E(r,i,i.length?zd(i):"No models."),{response:{count:i.length}}})});function $t(e){if(e.available===!0)return"available";if(e.available===!1)return`unavailable: ${e.unavailableReason??"no reason given"}`;return"availability unknown"}function zd(e){let t=e.map((n)=>[n.model,n.type,$t(n)]),r=t[0].map((n,o)=>Math.max(...t.map((s)=>s[o].length)));return t.map((n)=>n.map((o,s)=>o.padEnd(r[s])).join(" ").trimEnd()).join(`
|
|
94
|
+
`)}function Sd(e){let t=[`${e.model} ${e.type} ${$t(e)}`];if(e.name)t.push(e.description?`${e.name}: ${e.description}`:e.name);if(e.options)t.push("Options:",JSON.stringify(e.options,null,2));return t.join(`
|
|
95
|
+
`)}var Da=new Set(["done","failed"]),La=3000,Ua=new F("generate").description("Generate one image, video or audio asset from a prompt").argument("<model>","Model id from `shotstack models`").argument("<prompt>","Text prompt; for a speech model, the words to speak").option("--options <json>","Model options as a JSON object (see `shotstack models <model>`)",Pd).option("--length <seconds>","Length of the clip the asset fills; models that generate to a duration use it",Rd).option("--watch","Poll until the asset is ready, then print its URL").option("--quote","Print the credits this exact request would cost, without generating or charging").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t,r)=>{await B("generate",H("generate"),async()=>{let n=C(r.output),o=J(r.env),s=q(o.name),i=V({apiKey:s,env:o}),c={model:e,prompt:t,options:r.options,length:r.length};if(r.quote)return Zd(i,c,n);return kd(i,c,n,r.watch===!0)})});async function kd(e,t,r,n,o=La){let s=await bt(e,t.model);if(s.available===!1){let p={model:s.model,available:!1,unavailableReason:s.unavailableReason};if(r==="json")console.log(JSON.stringify(p));else console.error(`✗ ${s.model} is ${$t(s)}`);return{response:p,exitCode:1}}let i=await e.post("/generate",Ma(s,t));E(r,i,va(i));let c=i;if(!Da.has(i.status)){if(n)c=await Ed(e,i.id,r,o);else if(r!=="json")console.error("Still generating. Run the same command with --watch to wait; the same request returns this job instead of starting another.")}return{renderId:c.id,response:c,exitCode:c.status==="failed"?1:0}}async function Zd(e,t,r){let n=await bt(e,t.model),o=await e.post("/generate/quote",Ma(n,t));return E(r,o,Od(o)),{response:o}}function Od(e){return`${e.ceiling?"up to ":""}${e.credits} ${e.credits===1?"credit":"credits"}`}function Ma(e,t){return{asset:{type:e.type,prompt:t.prompt,model:e.model,...t.options&&{options:t.options}},...t.length!==void 0&&{length:t.length}}}async function Ed(e,t,r,n=La){while(!0){await Cd(n);let o=await e.get(`/generate/${encodeURIComponent(t)}`);if(E(r,o,va(o)),Da.has(o.status))return o}}function Pd(e){let t;try{t=JSON.parse(e)}catch{throw new We("Not valid JSON.")}if(t===null||typeof t!=="object"||Array.isArray(t))throw new We("Expected a JSON object.");return t}function Rd(e){let t=Number(e);if(!Number.isFinite(t)||t<=0)throw new We("Expected a positive number of seconds.");return t}function va(e){if(e.status==="done")return`done ${e.url??""}`.trimEnd();if(e.status==="failed")return`failed error: ${e.error??"unknown error"}`;return`${e.status} ${e.id}`}function Cd(e){return new Promise((t)=>setTimeout(t,e))}var Nd=new Set(["done","failed"]),Td=3000,Va=new F("analyze").alias("analyse").description("Find a music track's tempo, beats, bars, drops and sections").argument("<src>","Public URL of an audio or video file; host a local file with `shotstack ingest upload` first").option("--env <name>",`Environment: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await B("analyze",H("analyze"),async()=>{let r=C(t.output),n=V({env:J(t.env)});return Id(n,e,r)})});async function Id(e,t,r,n=Td){let o=await e.post("/analysis",{src:t});while(!Nd.has(o.status)){if(r!=="json")console.error(`${o.status} ${o.id}`);await Fd(n),o=await e.get(`/analysis/${encodeURIComponent(o.id)}`)}if(o.status==="failed")return E(r,o,`failed error: ${o.error??"unknown error"}`),{response:o,exitCode:1};if(E(r,o.result,`done ${jd(o.result??{})}`),r!=="json")console.error("Print the full map with --output json.");return{response:o,exitCode:0}}function jd(e){let t=`${e.drops?.length??0} drops, ${e.sections?.length??0} sections`;if(!e.steady)return`tempo varies (about ${e.bpm} BPM): ${e.beats?.length??0} beats, ${e.downbeats?.length??0} downbeats, ${t}`;return`${e.bpm} BPM, ${e.meter}/4, bar ${e.bar?.toFixed(2)} s from ${e.origin?.toFixed(2)} s, ${e.bars?.count??0} bars, ${t}`}function Fd(e){return new Promise((t)=>setTimeout(t,e))}import{createInterface as Dd}from"node:readline";import{Writable as Ld}from"node:stream";var qa=new F("login").description("Save your Shotstack API key so you don't have to set SHOTSTACK_API_KEY every session").option("--env <name>",`Environment the key belongs to: ${R.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{let t=C(e.output),r=me(e.env),n=await Ud();if(!n)console.error("No API key provided."),process.exit(1);await Wr(r,n);let o=ke();E(t,{env:r,stored:!0,path:o},`Saved API key for ${r} → ${o} (chmod 600).`)}),Ja=new F("logout").description("Remove a saved Shotstack API key").option("--env <name>",`Environment to forget: ${R.join(" | ")}`).option("--all","Remove saved keys for every environment").option("--output <format>","Output format: text | json","text").action(async(e)=>{let t=C(e.output);if(e.all){await Qr(),E(t,{cleared:!0},"Removed all saved API keys.");return}let r=me(e.env),n=await Yr(r);E(t,{env:r,removed:n},n?`Removed saved API key for ${r}.`:`No saved API key for ${r}.`)});async function Ud(){if(!process.stdin.isTTY){let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf8").trim()}return Md("Shotstack API key: ")}function Md(e){return new Promise((t)=>{let r=!1,n=new Ld({write(s,i,c){if(!r)process.stdout.write(s);c()}}),o=Dd({input:process.stdin,output:n,terminal:!0});o.question(e,(s)=>{o.close(),process.stdout.write(`
|
|
96
|
+
`),t(s.trim())}),r=!0})}var vd=new F().name("shotstack").description("Command-line interface for the Shotstack video rendering API").version(Fe).addCommand($a).addCommand(on).addCommand(Ca).addCommand($e).addCommand(Ae).addCommand(ja).addCommand(Fa).addCommand(Ua).addCommand(Va).addCommand(qa).addCommand(Ja).addCommand(Oa);try{await vd.parseAsync(process.argv)}catch(e){process.exit(Vd(e))}function Vd(e){if(e instanceof ue||e instanceof Ze)return console.error(e.message),1;if(e instanceof ee){if(console.error(e.message),e.body)console.error(typeof e.body==="string"?e.body:JSON.stringify(e.body));return e.isTransient?2:1}if(e instanceof Error){if("code"in e&&e.code==="ENOENT")return console.error(e.message),1;return console.error(e.message),2}return console.error(String(e)),2}
|