@shotstack/cli 0.8.4 → 0.10.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 +23 -0
- package/dist/shotstack.js +53 -51
- package/package.json +2 -2
- package/skills/shotstack/SKILL.md +38 -3
- package/skills/shotstack/references/caption.md +1 -1
- package/skills/shotstack/references/generation.md +100 -0
- package/skills/shotstack/references/troubleshooting.md +1 -1
- package/skills/shotstack/shared/agent-core.md +14 -8
package/dist/shotstack.js
CHANGED
|
@@ -1,94 +1,96 @@
|
|
|
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 _=t.visibleArguments(e).map((x)=>
|
|
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
|
|
2
|
+
import{createRequire as Ga}from"node:module";var Ba=Object.defineProperty;var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ha=(e,t,r)=>{for(var n in t)Ba(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},Ce=Ga(import.meta.url);var Ne=$e(function(Wa){class bt 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 bt{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Wa.CommanderError=bt;Wa.InvalidArgumentError=Ar});var Be=$e(function(eu){var{InvalidArgumentError:Qa}=Ne();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 Qa(`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 Xa(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}eu.Argument=wr;eu.humanReadableArgName=Xa});var $t=$e(function(ou){var{humanReadableArgName:nu}=Be();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)=>nu(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 U=`${x.padEnd(r+2)}${z}`;return t.wrap(U,n-2,r+2)}return x}function u(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 _=t.visibleArguments(e).map((x)=>i(t.argumentTerm(x),t.argumentDescription(x)));if(_.length>0)p=p.concat(["Arguments:",u(_),""]);let y=t.visibleOptions(e).map((x)=>i(t.optionTerm(x),t.optionDescription(x)));if(y.length>0)p=p.concat(["Options:",u(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:",u(x),""])}let A=t.visibleCommands(e).map((x)=>i(t.subcommandTerm(x),t.subcommandDescription(x)));if(A.length>0)p=p.concat(["Commands:",u(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 u=e.slice(0,r),p=e.slice(r).replace(`\r
|
|
5
5
|
`,`
|
|
6
6
|
`),l=" ".repeat(r),y=`\\s${""}`,A=new RegExp(`
|
|
7
|
-
|.{1,${
|
|
8
|
-
`)return"";return(
|
|
9
|
-
`)}}
|
|
7
|
+
|.{1,${i-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g"),x=p.match(A)||[];return u+x.map((z,U)=>{if(z===`
|
|
8
|
+
`)return"";return(U>0?l:"")+z.trimEnd()}).join(`
|
|
9
|
+
`)}}ou.Help=zr});var At=$e(function(cu){var{InvalidArgumentError:iu}=Ne();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=uu(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 iu(`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 au(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 au(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function uu(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}}cu.Option=Sr;cu.DualOptions=kr});var Zr=$e(function(mu){function fu(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 du(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 u=fu(e,i),p=Math.max(e.length,i.length);if((p-u)/p>s){if(u<o)o=u,n=[i];else if(u===o)n.push(i)}}),n.sort((i,u)=>i.localeCompare(u)),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,
|
|
11
|
+
(Did you mean ${n[0]}?)`;return""}mu.suggestSimilar=du});var Rr=$e(function($u){var gu=Ce("node:events").EventEmitter,wt=Ce("node:child_process"),se=Ce("node:path"),St=Ce("node:fs"),V=Ce("node:process"),{Argument:_u,humanReadableArgName:xu}=Be(),{CommanderError:zt}=Ne(),{Help:yu}=$t(),{Option:Or,DualOptions:bu}=At(),{suggestSimilar:Er}=Zr();class kt extends gu{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)=>V.stdout.write(t),writeErr:(t)=>V.stderr.write(t),getOutHelpWidth:()=>V.stdout.isTTY?V.stdout.columns:void 0,getErrHelpWidth:()=>V.stderr.isTTY?V.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(/([^ ]+) *(.*)/),u=this.createCommand(s);if(n)u.description(n),u._executableHandler=!0;if(o.isDefault)this._defaultCommandName=u._name;if(u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,i)u.arguments(i);if(this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n)return this;return u}createCommand(e){return new kt(e)}createHelp(){return Object.assign(new yu,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 _u(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 zt(e,t,r));V.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 u=this.getOptionValue(r);if(o!==null&&e.parseArg)o=this._callParseArg(e,o,u,s);else if(o!==null&&e.variadic)o=e._concatValue(o,u);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=(u,p)=>{let l=i.exec(u);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(V.versions?.electron)t.from="electron";let n=V.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))t.from="eval"}if(e===void 0)e=V.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(V.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,_){let y=se.resolve(l,_);if(St.existsSync(y))return y;if(n.includes(se.extname(_)))return;let A=n.find((x)=>St.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=St.realpathSync(this._scriptPath)}catch(_){l=this._scriptPath}i=se.resolve(se.dirname(l),i)}if(i){let l=o(i,s);if(!l&&!e._executableFile&&this._scriptPath){let _=se.basename(this._scriptPath,se.extname(this._scriptPath));if(_!==this._name)l=o(i,`${_}-${e._name}`)}s=l||s}r=n.includes(se.extname(s));let u;if(V.platform!=="win32")if(r)t.unshift(s),t=Pr(V.execArgv).concat(t),u=wt.spawn(V.argv[0],t,{stdio:"inherit"});else u=wt.spawn(s,t,{stdio:"inherit"});else t.unshift(s),t=Pr(V.execArgv).concat(t),u=wt.spawn(V.execPath,t,{stdio:"inherit"});if(!u.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((_)=>{V.on(_,()=>{if(u.killed===!1&&u.exitCode===null)u.kill(_)})});let p=this._exitCallback;u.on("close",(l)=>{if(l=l??1,!p)V.exit(l);else p(new zt(l,"commander.executeSubCommandAsync","(close)"))}),u.on("error",(l)=>{if(l.code==="ENOENT"){let _=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
|
-
- ${_}`;throw Error(y)}else if(l.code==="EACCES")throw Error(`'${s}' not executable`);if(!p)
|
|
17
|
+
- ${_}`;throw Error(y)}else if(l.code==="EACCES")throw Error(`'${s}' not executable`);if(!p)V.exit(1);else{let _=new zt(1,"commander.executeSubCommandAsync","(error)");_.nestedError=l,p(_)}}),this.runningCommand=u}_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(u){return u.length>1&&u[0]==="-"}let i=null;while(o.length){let u=o.shift();if(u==="--"){if(n===r)n.push(u);n.push(...o);break}if(i&&!s(u)){this.emit(`option:${i.name()}`,u);continue}if(i=null,s(u)){let p=this._findOption(u);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(u.length>2&&u[0]==="-"&&u[1]!=="-"){let p=this._findOption(`-${u[1]}`);if(p){if(p.required||p.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${p.name()}`,u.slice(2));else this.emit(`option:${p.name()}`),o.unshift(`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let p=u.indexOf("="),l=this._findOption(u.slice(0,p));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(p+1));continue}}if(s(u))n=r;if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(u)){if(t.push(u),o.length>0)r.push(...o);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){if(t.push(u),o.length>0)t.push(...o);break}else if(this._defaultCommandName){if(r.push(u),o.length>0)r.push(...o);break}}if(this._passThroughOptions){if(n.push(u),o.length>0)n.push(...o);break}n.push(u)}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 V.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()}`,V.env[e.envVar]);else this.emit(`optionEnv:${e.name()}`)}})}_parseOptionsImplied(){let e=new bu(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(),u=this.getOptionValue(i),p=this.options.find((_)=>_.negate&&i===_.attributeName()),l=this.options.find((_)=>!_.negate&&i===_.attributeName());if(p&&(p.presetArg===void 0&&u===!1||p.presetArg!==void 0&&u===p.presetArg))return p;return l||s},n=(s)=>{let i=r(s),u=i.attributeName();if(this.getOptionValueSource(u)==="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)=>xu(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=se.basename(e,se.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=V.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
|
|
24
|
-
`,{mode:384}),await
|
|
25
|
-
`;if(await Zu(Pu(t),{recursive:!0,mode:448}),!await ju(t))await en(t,"",{mode:384});await Ou(t,n),await Fu(t)}async function ju(e){try{return await Qr(e),!0}catch{return!1}}async function Fu(e){let t=await Qr(e).catch(()=>null);if(!t||t.size<=Ru)return;let r=await Eu(e),n=r.subarray(Math.max(0,r.length-Nu)),o=n.indexOf(10),s=o>=0?n.subarray(o+1):n;await en(e,s,{mode:384})}var Du=/^https?:\/\//i,Lu=/(https?:\/\/[^\s'"<>?]+)\?[^\s'"<>]*?(?:Signature|X-Amz-[A-Za-z0-9-]+|x-amz-security-token)=[^\s'"<>]*/gi;function Rt(e){return e.replace(Lu,"$1?[redacted-signed]")}function Uu(e){if(typeof e!=="string")return e;if(e.startsWith("-"))return e;if(Du.test(e))return Rt(e);if(/[\/\\]/.test(e))return Mu(e);return e}function Mu(e){let t=e.split(/[\/\\]/);return t[t.length-1]||e}function Pt(e){if(typeof e==="string")return Rt(e);if(Array.isArray(e))return e.map(Pt);if(e&&typeof e==="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Pt(n);return t}return e}function Vu(e){let t=JSON.stringify(e);if(t===void 0||t.length<=Yr)return e;return t.slice(0,Yr)+"...[truncated]"}async function K(e,t,r){let n=Date.now();try{let o=await r(),s=o.exitCode??0;if(await Xr({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),a=o instanceof ie?o.body:void 0;throw await Xr({cmd:e,args:t,exit:s,durationMs:Date.now()-n,response:a,error:Iu(o)}).catch(()=>{}),o}}function qu(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 Ju=new Set(["done","failed"]),Bu=3000,tn=new q("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: ${U.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await K("status",G("status"),async()=>{let r=j(t.output),n=W(t.env),o=v(n.name),s=H({apiKey:o,env:n}),a=await Nt(s,e,r,t.watch===!0),c=a.status==="failed"?1:0;return{renderId:a.id,response:a,exitCode:c}})});async function Nt(e,t,r,n){while(!0){let s=(await e.get(`/render/${encodeURIComponent(t)}`)).response;if(M(r,s,Hu(s)),!n||Ju.has(s.status))return s;await vu(Bu)}}function Hu(e){let t=[e.status];if(e.url)t.push(e.url);if(e.error)t.push(`error: ${e.error}`);return t.join(" ")}function vu(e){return new Promise((t)=>setTimeout(t,e))}var rn;function m(e,t,r){function n(c,p){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:p,constr:a,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,p);let l=a.prototype,_=Object.keys(l);for(let y=0;y<_.length;y++){let A=_[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 a(c){var p;let l=r?.Parent?new s:this;n(l,c),(p=l._zod).deferred??(p.deferred=[]);for(let _ of l._zod.deferred)_();return l}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:(c)=>{if(r?.Parent&&c instanceof r.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var lm=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"}}(rn=globalThis).__zod_globalConfig??(rn.__zod_globalConfig={});var Se=globalThis.__zod_globalConfig;function Q(e){if(e)Object.assign(Se,e);return Se}function Ge(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 Ye(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 on(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 nn=Symbol("evaluating");function O(e,t,r){let n=void 0;Object.defineProperty(e,t,{get(){if(n===nn)return;if(n===void 0)n=nn,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 Ct(e){return JSON.stringify(e)}function sn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var It="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ke(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var an=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 jt(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 un=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 cn(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var pn={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 Wu(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 a={};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;a[c]=r.shape[c]}return de(this,"shape",a),a},checks:[]});return ne(e,s)}function Ku(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 a={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete a[c]}return de(this,"shape",a),a},checks:[]});return ne(e,s)}function Gu(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 a in t)if(Object.getOwnPropertyDescriptor(s,a)!==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 Yu(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 Xu(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 Qu(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 a=ue(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 de(this,"shape",p),p},checks:[]});return ne(t,a)}function ec(e,t,r){let n=ue(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(r)for(let a in r){if(!(a in s))throw Error(`Unrecognized key: "${a}"`);if(!r[a])continue;s[a]=new e({type:"nonoptional",innerType:o[a]})}else for(let a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});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 ln(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:a,...c}=e;if(c.path??(c.path=[]),c.message=n,t?.reportInput)c.input=a;return c}function Qe(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 fn=(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})},et=m("$ZodError",fn),Ft=m("$ZodError",fn,{Parent:Error});function dn(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 mn(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((c)=>n({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)r._errors.push(t(a));else{let p=r,l=0;while(l<c.length){let _=c[l];if(l!==c.length-1)p[_]=p[_]||{_errors:[]};else p[_]=p[_]||{_errors:[]},p[_]._errors.push(t(a));p=p[_],l++}}}};return n(e),r}var tt=(e)=>(t,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ae;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map((p)=>ee(p,s,Q())));throw It(c,o?.callee),c}return a.value};var rt=(e)=>async(t,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map((p)=>ee(p,s,Q())));throw It(c,o?.callee),c}return a.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??et)(s.issues.map((a)=>ee(a,o,Q())))}:{success:!0,data:s.value}},hn=De(Ft),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((a)=>ee(a,o,Q())))}:{success:!0,data:s.value}},gn=Le(Ft),_n=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return tt(e)(t,r,o)};var xn=(e)=>(t,r,n)=>tt(e)(t,r,n);var yn=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return rt(e)(t,r,o)};var bn=(e)=>async(t,r,n)=>rt(e)(t,r,n);var $n=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return De(e)(t,r,o)};var An=(e)=>(t,r,n)=>De(e)(t,r,n);var wn=(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 Sn=/^[cC][0-9a-z]{6,}$/,kn=/^[0-9a-z]+$/,Zn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,On=/^[0-9a-vA-V]{20}$/,En=/^[A-Za-z0-9]{27}$/,Pn=/^[a-zA-Z0-9_-]{21}$/,Rn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Nn=/^([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})$/,Dt=(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 Tn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var rc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Cn(){return new RegExp(rc,"u")}var In=/^(?:(?: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])$/,jn=/^(([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 Fn=/^((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])$/,Dn=/^(([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])$/,Ln=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lt=/^[A-Za-z0-9_-]*$/;var Un=/^https?$/,Mn=/^\+[1-9]\d{6,14}$/,Vn="(?:(?:\\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])))",qn=new RegExp(`^${Vn}$`);function Jn(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 Bn(e){return new RegExp(`^${Jn(e)}$`)}function Hn(e){let t=Jn({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(`^${Vn}T(?:${n})$`)}var vn=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Wn=/^-?\d+$/,Ut=/^-?\d+(?:\.\d+)?$/,Kn=/^(?:true|false)$/i,Gn=/^null$/i;var Yn=/^[^A-Z]*$/,Xn=/^[^a-z]*$/;var B=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Qn={number:"number",bigint:"bigint",object:"date"},Mt=m("$ZodCheckLessThan",(e,t)=>{B.init(e,t);let r=Qn[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})}}),Vt=m("$ZodCheckGreaterThan",(e,t)=>{B.init(e,t);let r=Qn[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})}}),eo=m("$ZodCheckMultipleOf",(e,t)=>{B.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):on(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})}}),to=m("$ZodCheckNumberFormat",(e,t)=>{B.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=pn[t.format];e._zod.onattach.push((a)=>{let c=a._zod.bag;if(c.format=t.format,c.minimum=o,c.maximum=s,r)c.pattern=Wn}),e._zod.check=(a)=>{let c=a.value;if(r){if(!Number.isInteger(c)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)a.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 a.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)a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>s)a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var ro=m("$ZodCheckMaxLength",(e,t)=>{var r;B.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Ye(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 a=Qe(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),no=m("$ZodCheckMinLength",(e,t)=>{var r;B.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Ye(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 a=Qe(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),oo=m("$ZodCheckLengthEquals",(e,t)=>{var r;B.init(e,t),(r=e._zod.def).when??(r.when=(n)=>{let o=n.value;return!Ye(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 a=Qe(o),c=s>t.length;n.issues.push({origin:a,...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})}}),Ue=m("$ZodCheckStringFormat",(e,t)=>{var r,n;if(B.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=()=>{})}),so=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})}}),io=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yn),Ue.init(e,t)}),ao=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xn),Ue.init(e,t)}),uo=m("$ZodCheckIncludes",(e,t)=>{B.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})}}),co=m("$ZodCheckStartsWith",(e,t)=>{B.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})}}),po=m("$ZodCheckEndsWith",(e,t)=>{B.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 lo=m("$ZodCheckOverwrite",(e,t)=>{B.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class qt{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})}$u.Command=kt});var Ot={};Ha(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}=Be(),{Command:Zt}=Rr(),{CommanderError:wu,InvalidArgumentError:Nr}=Ne(),{Help:zu}=$t(),{Option:Tr}=At();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=zu,vr=wu,qr=Nr,Jr=Nr;var{program:Bd,createCommand:Hd,createArgument:Gd,createOption:Wd,CommanderError:Kd,InvalidArgumentError:He,InvalidOptionArgumentError:Yd,Command:L,Argument:Qd,Option:Xd,Help:em}=Ot;import{readFile as kf}from"node:fs/promises";import{resolve as Zf}from"node:path";var Br={name:"@shotstack/cli",version:"0.10.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 Te=Br.version,Hr=`shotstack-cli/${Te} (${process.platform}-${process.arch})`;class ie 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 q(e){let t=e.env.baseUrl.replace(/\/$/,"");async function r(n,o,s){let i=await fetch(`${t}${o}`,{method:n,headers:{"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}),u=await i.text(),p=u?ku(u):void 0;if(!i.ok)throw new ie(i.status,p??u,`${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 ku(e){try{return JSON.parse(e)}catch{return e}}import{mkdir as Zu,writeFile as Ou,chmod as Eu}from"node:fs/promises";import{readFileSync as Pu}from"node:fs";import{join as Et,dirname as Ru}from"node:path";import{homedir as Gr}from"node:os";function Ae(){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(Pu(e,"utf8"));if(t&&typeof t==="object"&&!Array.isArray(t))return t}catch{}return{}}function Wr(e,t=Ae()){return Pt(t)[e]?.trim()||void 0}async function Kr(e,t,r=Ae()){let n=Pt(r);n[e]=t.trim(),await Rt(r,n)}async function Yr(e,t=Ae()){let r=Pt(t);if(!(e in r))return!1;return delete r[e],await Rt(t,r),!0}async function Qr(e=Ae()){await Rt(e,{})}async function Rt(e,t){await Zu(Ru(e),{recursive:!0,mode:448}),await Ou(e,JSON.stringify(t,null,2)+`
|
|
24
|
+
`,{mode:384}),await Eu(e,384).catch(()=>{})}class we 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 J(e,t){let r=process.env.SHOTSTACK_API_KEY?.trim();if(r)return r;let n=Wr(e,t);if(n)return n;throw new we(e)}var I=["dev","stage","v1"];class ze extends Error{constructor(e){super(`Invalid environment "${e}". Use one of: ${I.join(", ")}.`);this.name="InvalidEnvError"}}function Ge(e){let t=e??process.env.SHOTSTACK_ENV?.trim()??"v1";if(!Nu(t))throw new ze(t);return t}function B(e,t="edit"){let r=Cu(t);if(r)return{name:"custom",baseUrl:r};let n=Ge(e);return{name:n,baseUrl:`https://api.shotstack.io/${t}/${n}`}}function Cu(e){return(e==="ingest"?process.env.SHOTSTACK_INGEST_BASE_URL:process.env.SHOTSTACK_API_BASE_URL)?.trim()||void 0}function Nu(e){return I.includes(e)}function N(e){if(e==="json")return"json";return"text"}function P(e,t,r){if(e==="json")console.log(JSON.stringify(t));else console.log(r)}import{mkdir as Tu,appendFile as Iu,stat as rn,readFile as ju,writeFile as nn}from"node:fs/promises";import{join as Ct,dirname as Fu}from"node:path";import{homedir as Xr}from"node:os";var Du=1e6,Lu=500000,en=2000;function We(){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 Uu(e,t=new Date){let r={ts:t.toISOString(),cmd:e.cmd,args:e.args.map(Hu),exit:e.exit,durationMs:e.durationMs};if(e.renderId)r.renderId=e.renderId;if(e.response!==void 0)r.response=Wu(Nt(e.response));if(e.error)r.error=Mu(e.error);return r}function Mu(e){return{name:e.name,message:typeof e.message==="string"?Tt(e.message):String(e.message)}}function Vu(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=We()){let r=Uu(e),n=JSON.stringify(r)+`
|
|
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(`
|
|
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 mo={major:4,minor:4,patch:3};var N=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mo;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=(a,c,p)=>{let l=he(a),_;for(let y of c){if(y._zod.def.when){if(ln(a))continue;if(!y._zod.def.when(a))continue}else if(l)continue;let A=a.issues.length,x=y._zod.check(a);if(x instanceof Promise&&p?.async===!1)throw new ae;if(_||x instanceof Promise)_=(_??Promise.resolve()).then(async()=>{if(await x,a.issues.length===A)return;if(!l)l=he(a,A)});else{if(a.issues.length===A)continue;if(!l)l=he(a,A)}}if(_)return _.then(()=>a);return a},s=(a,c,p)=>{if(he(a))return a.aborted=!0,a;let l=o(c,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=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((_)=>s(_,a,c));return s(l,a,c)}let p=e._zod.parse(a,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)}}O(e,"~standard",()=>({validate:(o)=>{try{let s=hn(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return gn(e,o).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),it=m("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vn(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}}),T=m("$ZodStringFormat",(e,t)=>{Ue.init(e,t),it.init(e,t)}),wo=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Nn),T.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=Dt(n))}else t.pattern??(t.pattern=Dt());T.init(e,t)}),So=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Tn),T.init(e,t)}),ko=m("$ZodURL",(e,t)=>{T.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===Un.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})}}}),Zo=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Cn()),T.init(e,t)}),Oo=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Pn),T.init(e,t)}),Eo=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Sn),T.init(e,t)}),Po=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kn),T.init(e,t)}),Ro=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Zn),T.init(e,t)}),No=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=On),T.init(e,t)}),To=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=En),T.init(e,t)}),Co=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Hn(t)),T.init(e,t)}),Io=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qn),T.init(e,t)}),jo=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Bn(t)),T.init(e,t)}),Fo=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Rn),T.init(e,t)}),Do=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=In),T.init(e,t),e._zod.bag.format="ipv4"}),Lo=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jn),T.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 Uo=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fn),T.init(e,t)}),Mo=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Dn),T.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 a=Number(s);if(`${a}`!==s)throw Error();if(a<0||a>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 Vo(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 qo=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ln),T.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(Vo(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function nc(e){if(!Lt.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Vo(r)}var Jo=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Lt),T.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(nc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Bo=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mn),T.init(e,t)});function oc(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 Ho=m("$ZodJWT",(e,t)=>{T.init(e,t),e._zod.check=(r)=>{if(oc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Bt=m("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ut,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(a){}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}}),vo=m("$ZodNumberFormat",(e,t)=>{to.init(e,t),Bt.init(e,t)}),Wo=m("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Kn,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 Ko=m("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=Gn,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 Go=m("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=(r)=>r}),Yo=m("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Xo=m("$ZodVoid",(e,t)=>{N.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 ho(e,t,r){if(e.issues.length)t.issues.push(...pe(r,e.issues));t.value[r]=e.value}var Qo=m("$ZodArray",(e,t)=>{N.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 a=0;a<o.length;a++){let c=o[a],p=t.element._zod.run({value:c,issues:[]},n);if(p instanceof Promise)s.push(p.then((l)=>ho(l,r,a)));else ho(p,r,a)}if(s.length)return Promise.all(s).then(()=>r);return r}});function st(e,t,r,n,o,s){let a=r in n;if(e.issues.length){if(o&&s&&!a)return;t.issues.push(...pe(r,e.issues))}if(!a&&!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(a)t.value[r]=void 0}else t.value[r]=e.value}function es(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=cn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ts(e,t,r,n,o,s){let a=[],c=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(c.has(A))continue;if(l==="never"){a.push(A);continue}let x=p.run({value:t[A],issues:[]},n);if(x instanceof Promise)e.push(x.then((z)=>st(z,r,A,t,_,y)));else st(x,r,A,t,_,y)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var sc=m("$ZodObject",(e,t)=>{if(N.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=Fe(()=>es(t));O(e._zod,"propValues",()=>{let c=t.shape,p={};for(let l in c){let _=c[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,a;e._zod.parse=(c,p)=>{a??(a=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 _=[],y=a.shape;for(let A of a.keys){let x=y[A],z=x._zod.optin==="optional",F=x._zod.optout==="optional",E=x._zod.run({value:l[A],issues:[]},p);if(E instanceof Promise)_.push(E.then((oe)=>st(oe,c,A,l,z,F)));else st(E,c,A,l,z,F)}if(!s)return _.length?Promise.all(_).then(()=>c):c;return ts(_,l,c,p,n.value,e)}}),rs=m("$ZodObjectJIT",(e,t)=>{sc.init(e,t);let r=e._zod.parse,n=Fe(()=>es(t)),o=(A)=>{let x=new qt(["shape","payload","ctx"]),z=n.value,F=(re)=>{let D=Ct(re);return`shape[${D}]._zod.run({ value: input[${D}], 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 D=E[re],J=Ct(re),_r=A[re],xr=_r?._zod?.optin==="optional",Da=_r?._zod?.optout==="optional";if(x.write(`const ${D} = ${F(re)};`),xr&&Da)x.write(`
|
|
28
|
-
if (${
|
|
29
|
-
if (${
|
|
30
|
-
payload.issues = payload.issues.concat(${
|
|
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 (${M}.issues.length) {
|
|
29
|
+
if (${W} in input) {
|
|
30
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
31
31
|
...iss,
|
|
32
|
-
path: iss.path ? [${
|
|
32
|
+
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
33
33
|
})));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
if (${
|
|
38
|
-
if (${
|
|
39
|
-
newResult[${
|
|
37
|
+
if (${M}.value === undefined) {
|
|
38
|
+
if (${W} in input) {
|
|
39
|
+
newResult[${W}] = undefined;
|
|
40
40
|
}
|
|
41
41
|
} else {
|
|
42
|
-
newResult[${
|
|
42
|
+
newResult[${W}] = ${M}.value;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
`);else if(
|
|
46
|
-
const ${
|
|
47
|
-
if (${
|
|
48
|
-
payload.issues = payload.issues.concat(${
|
|
45
|
+
`);else if(!$r)x.write(`
|
|
46
|
+
const ${M}_present = ${W} in input;
|
|
47
|
+
if (${M}.issues.length) {
|
|
48
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
49
49
|
...iss,
|
|
50
|
-
path: iss.path ? [${
|
|
50
|
+
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
51
51
|
})));
|
|
52
52
|
}
|
|
53
|
-
if (!${
|
|
53
|
+
if (!${M}_present && !${M}.issues.length) {
|
|
54
54
|
payload.issues.push({
|
|
55
55
|
code: "invalid_type",
|
|
56
56
|
expected: "nonoptional",
|
|
57
57
|
input: undefined,
|
|
58
|
-
path: [${
|
|
58
|
+
path: [${W}]
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
if (${
|
|
63
|
-
if (${
|
|
64
|
-
newResult[${
|
|
62
|
+
if (${M}_present) {
|
|
63
|
+
if (${M}.value === undefined) {
|
|
64
|
+
newResult[${W}] = undefined;
|
|
65
65
|
} else {
|
|
66
|
-
newResult[${
|
|
66
|
+
newResult[${W}] = ${M}.value;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
`);else x.write(`
|
|
71
|
-
if (${
|
|
72
|
-
payload.issues = payload.issues.concat(${
|
|
71
|
+
if (${M}.issues.length) {
|
|
72
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
73
73
|
...iss,
|
|
74
|
-
path: iss.path ? [${
|
|
74
|
+
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
75
75
|
})));
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
if (${
|
|
79
|
-
if (${
|
|
80
|
-
newResult[${
|
|
78
|
+
if (${M}.value === undefined) {
|
|
79
|
+
if (${W} in input) {
|
|
80
|
+
newResult[${W}] = undefined;
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
|
-
newResult[${
|
|
83
|
+
newResult[${W}] = ${M}.value;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");let Fa=x.compile();return(re,D)=>Fa(A,re,D)},s,a=ke,c=!Se.jitless,l=c&&an.value,_=t.catchall,y;e._zod.parse=(A,x)=>{y??(y=n.value);let z=A.value;if(!a(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),!_)return A;return ts([],z,A,x,y,e)}return r(A,x)}});function go(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((a)=>ee(a,n,Q())))}),t}var Ht=m("$ZodUnion",(e,t)=>{N.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,a=[];for(let c of t.options){let p=c._zod.run({value:n.value,issues:[]},o);if(p instanceof Promise)a.push(p),s=!0;else{if(p.issues.length===0)return p;a.push(p)}}if(!s)return go(a,n,e,o);return Promise.all(a).then((c)=>go(c,n,e,o))}});var ns=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ht.init(e,t);let r=e._zod.parse;O(e._zod,"propValues",()=>{let o={};for(let s of t.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,p]of Object.entries(a)){if(!o[c])o[c]=new Set;for(let l of p)o[c].add(l)}}return o});let n=Fe(()=>{let o=t.options,s=new Map;for(let a of o){let c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let p of c){if(s.has(p))throw Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,a)}}return s});e._zod.parse=(o,s)=>{let a=o.value;if(!ke(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;let c=n.value.get(a?.[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:a,path:[t.discriminator],inst:e}),o}}),os=m("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);if(s instanceof Promise||a instanceof Promise)return Promise.all([s,a]).then(([p,l])=>_o(r,p,l));return _o(r,s,a)}});function Jt(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 a=Jt(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.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],a=Jt(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function _o(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(he(e))return e;let a=Jt(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var ss=m("$ZodRecord",(e,t)=>{N.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=[],a=t.keyType._zod.values;if(a){r.value={};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){c.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,Q())),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(!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"&&Ut.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)=>ee(y,n,Q())),input:c,path:[c],inst:e});continue}let _=t.valueType._zod.run({value:o[c],issues:[]},n);if(_ instanceof Promise)s.push(_.then((y)=>{if(y.issues.length)r.issues.push(...pe(c,y.issues));r.value[p.value]=y.value}));else{if(_.issues.length)r.issues.push(...pe(c,_.issues));r.value[p.value]=_.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var is=m("$ZodEnum",(e,t)=>{N.init(e,t);let r=Ge(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter((o)=>un.has(typeof o)).map((o)=>typeof o==="string"?ce(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let a=o.value;if(n.has(a))return o;return o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),as=m("$ZodLiteral",(e,t)=>{if(N.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 us=m("$ZodTransform",(e,t)=>{N.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((a)=>(r.value=a,r.fallback=!0,r));if(o instanceof Promise)throw new ae;return r.value=o,r.fallback=!0,r}});function xo(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var vt=m("$ZodOptional",(e,t)=>{N.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((a)=>xo(a,o));return xo(s,o)}if(r.value===void 0)return r;return t.innerType._zod.run(r,n)}}),cs=m("$ZodExactOptional",(e,t)=>{vt.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)}),ps=m("$ZodNullable",(e,t)=>{N.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)}}),ls=m("$ZodDefault",(e,t)=>{N.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)=>yo(s,t));return yo(o,t)}});function yo(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var fs=m("$ZodPrefault",(e,t)=>{N.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)}}),ds=m("$ZodNonOptional",(e,t)=>{N.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)=>bo(s,e));return bo(o,e)}});function bo(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 ms=m("$ZodCatch",(e,t)=>{N.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((a)=>ee(a,n,Q()))},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,Q()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var Wt=m("$ZodPipe",(e,t)=>{N.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((a)=>ot(a,t.in,n));return ot(s,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>ot(s,t.out,n));return ot(o,t.out,n)}});function ot(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 hs=m("$ZodPreprocess",(e,t)=>{Wt.init(e,t)}),gs=m("$ZodReadonly",(e,t)=>{N.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($o);return $o(o)}});function $o(e){return e.value=Object.freeze(e.value),e}var _s=m("$ZodCustom",(e,t)=>{B.init(e,t),N.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)=>Ao(s,r,n,e));Ao(o,r,n,e);return}});function Ao(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 xs,Rm=Symbol("ZodOutput"),Nm=Symbol("ZodInput");class ys{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 ic(){return new ys}(xs=globalThis).__zod_globalRegistry??(xs.__zod_globalRegistry=ic());var _e=globalThis.__zod_globalRegistry;function bs(e,t){return new e({type:"string",...w(t)})}function $s(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function Kt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function As(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function ws(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 Ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function ks(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function Zs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function Os(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function Es(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function Ps(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function Rs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function Ns(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function Ts(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function Cs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function Is(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function js(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function Fs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function Ds(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function Ls(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function Us(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function Ms(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function Vs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function qs(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function Js(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Bs(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Hs(e,t){return new e({type:"number",checks:[],...w(t)})}function vs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Ws(e,t){return new e({type:"boolean",...w(t)})}function Ks(e,t){return new e({type:"null",...w(t)})}function Gs(e){return new e({type:"unknown"})}function Ys(e,t){return new e({type:"never",...w(t)})}function Xs(e,t){return new e({type:"void",...w(t)})}function at(e,t){return new Mt({check:"less_than",...w(t),value:e,inclusive:!1})}function Me(e,t){return new Mt({check:"less_than",...w(t),value:e,inclusive:!0})}function ut(e,t){return new Vt({check:"greater_than",...w(t),value:e,inclusive:!1})}function Ve(e,t){return new Vt({check:"greater_than",...w(t),value:e,inclusive:!0})}function ct(e,t){return new eo({check:"multiple_of",...w(t),value:e})}function pt(e,t){return new ro({check:"max_length",...w(t),maximum:e})}function Ze(e,t){return new no({check:"min_length",...w(t),minimum:e})}function lt(e,t){return new oo({check:"length_equals",...w(t),length:e})}function Gt(e,t){return new so({check:"string_format",format:"regex",...w(t),pattern:e})}function Yt(e){return new io({check:"string_format",format:"lowercase",...w(e)})}function Xt(e){return new ao({check:"string_format",format:"uppercase",...w(e)})}function Qt(e,t){return new uo({check:"string_format",format:"includes",...w(t),includes:e})}function er(e,t){return new co({check:"string_format",format:"starts_with",...w(t),prefix:e})}function tr(e,t){return new po({check:"string_format",format:"ends_with",...w(t),suffix:e})}function fe(e){return new lo({check:"overwrite",tx:e})}function rr(e){return fe((t)=>t.normalize(e))}function nr(){return fe((e)=>e.trim())}function or(){return fe((e)=>e.toLowerCase())}function sr(){return fe((e)=>e.toUpperCase())}function ir(){return fe((e)=>sn(e))}function Qs(e,t,r){return new e({type:"array",element:t,...w(r)})}function ei(e,t,r){return new e({type:"custom",check:"custom",fn:t,...w(r)})}function ti(e,t){let r=ac((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 ac(e,t){let r=new B({check:"custom",...w(t)});return r._zod.check=e,r}function ar(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 a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let _={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,_);else{let A=a.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(!a.ref)a.ref=y;V(y,t,_),t.seen.get(y).isParent=!0}}let p=t.metadataRegistry.get(e);if(p)Object.assign(a.schema,p);if(t.io==="input"&&Y(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(n=a.schema).default??(n.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function ur(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 a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let p=n.get(c);if(p&&p!==a[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,a[0])}}let o=(a)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let y=e.external.registry.get(a[0])?.id,A=e.external.uri??((z)=>z);if(y)return{ref:A(y)};let x=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=x,{defId:x,ref:`${A("__shared")}#/${c}/${x}`}}if(a[1]===r)return{ref:"#"};let l=`${"#"}/${c}/`,_=a[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:l+_}},s=(a)=>{if(a[1].schema.$ref)return;let c=a[1],{ref:p,defId:l}=o(a);if(c.def={...c.schema},l)c.defId=l;let _=c.schema;for(let y in _)delete _[y];_.$ref=p};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
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>
|
|
87
87
|
|
|
88
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(t===a[0]){s(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1){if(e.reused==="ref"){s(a);continue}}}}function cr(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,_={...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,_),c._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=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 a=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;a[p.defId]=p.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")o.$defs=a;else o.definitions=a;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:qe(t,"input",e.processors),output:qe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){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 ri=(e,t={})=>(r)=>{let n=ar({...r,processors:t});return V(e,n),ur(n,e),cr(n,e)},qe=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:s}=n??{},a=ar({...o??{},target:s,io:t,processors:r});return V(e,a),ur(a,e),cr(a,e)};var uc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ni=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:a,format:c,patterns:p,contentEncoding:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof a==="number")o.maxLength=a;if(c){if(o.format=uc[c]??c,o.format==="")delete o.format;if(c==="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}))]}},oi=(e,t,r,n)=>{let o=r,{minimum:s,maximum:a,format:c,multipleOf:p,exclusiveMaximum:l,exclusiveMinimum:_}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))o.type="integer";else o.type="number";let y=typeof _==="number"&&_>=(s??Number.NEGATIVE_INFINITY),A=typeof l==="number"&&l<=(a??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 a==="number")o.maximum=a;if(typeof p==="number")o.multipleOf=p},si=(e,t,r,n)=>{r.type="boolean"};var ii=(e,t,r,n)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var ai=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},ui=(e,t,r,n)=>{r.not={}};var ci=(e,t,r,n)=>{};var pi=(e,t,r,n)=>{let o=e._zod.def,s=Ge(o.entries);if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";r.enum=s},li=(e,t,r,n)=>{let o=e._zod.def,s=[];for(let a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(a));else s.push(a);if(s.length===0);else if(s.length===1){let a=s[0];if(r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[a];else r.const=a}else{if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";if(s.every((a)=>typeof a==="boolean"))r.type="boolean";if(s.every((a)=>a===null))r.type="null";r.enum=s}};var fi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var di=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var mi=(e,t,r,n)=>{let o=r,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;if(typeof a==="number")o.minItems=a;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=V(s.element,t,{...n,path:[...n.path,"items"]})},hi=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object",o.properties={};let a=s.shape;for(let l in a)o.properties[l]=V(a[l],t,{...n,path:[...n.path,"properties",l]});let c=new Set(Object.keys(a)),p=new Set([...c].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"]})},gi=(e,t,r,n)=>{let o=e._zod.def,s=o.inclusive===!1,a=o.options.map((c,p)=>V(c,t,{...n,path:[...n.path,s?"oneOf":"anyOf",p]}));if(s)r.oneOf=a;else r.anyOf=a},_i=(e,t,r,n)=>{let o=e._zod.def,s=V(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=V(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(a)?a.allOf:[a]];r.allOf=p};var xi=(e,t,r,n)=>{let o=r,s=e._zod.def;o.type="object";let a=s.keyType,p=a._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=a._zod.values;if(l){let _=[...l].filter((y)=>typeof y==="string"||typeof y==="number");if(_.length>0)o.required=_}},yi=(e,t,r,n)=>{let o=e._zod.def,s=V(o.innerType,t,n),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=o.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},bi=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType},$i=(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))},Ai=(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))},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;let a;try{a=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},zi=(e,t,r,n)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?o.out:o.in:o.out;V(a,t,n);let c=t.seen.get(e);c.ref=a},Si=(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 pr=(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 hc=m("ZodISODateTime",(e,t)=>{Co.init(e,t),I.init(e,t)});function ki(e){return Vs(hc,e)}var gc=m("ZodISODate",(e,t)=>{Io.init(e,t),I.init(e,t)});function Zi(e){return qs(gc,e)}var _c=m("ZodISOTime",(e,t)=>{jo.init(e,t),I.init(e,t)});function Oi(e){return Js(_c,e)}var xc=m("ZodISODuration",(e,t)=>{Fo.init(e,t),I.init(e,t)});function Ei(e){return Bs(xc,e)}var $c=(e,t)=>{et.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>mn(e,r)},flatten:{value:(r)=>dn(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 X=m("ZodError",$c,{Parent:Error});var Pi=tt(X),Ri=rt(X),Ni=De(X),Ti=Le(X),Ci=_n(X),Ii=xn(X),ji=yn(X),Fi=bn(X),Di=$n(X),Li=An(X),Ui=wn(X),Mi=zn(X);var Vi=new WeakMap;function Je(e,t,r){let n=Object.getPrototypeOf(e),o=Vi.get(n);if(!o)o=new Set,Vi.set(n,o);if(o.has(t))return;o.add(t);for(let s in r){let a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let c=a.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 C=m("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qe(e,"input"),output:qe(e,"output")}}),e.toJSONSchema=ri(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Pi(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ni(e,r,n),e.parseAsync=async(r,n)=>Ri(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ti(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ci(e,r,n),e.decode=(r,n)=>Ii(e,r,n),e.encodeAsync=async(r,n)=>ji(e,r,n),e.decodeAsync=async(r,n)=>Fi(e,r,n),e.safeEncode=(r,n)=>Di(e,r,n),e.safeDecode=(r,n)=>Li(e,r,n),e.safeEncodeAsync=async(r,n)=>Ui(e,r,n),e.safeDecodeAsync=async(r,n)=>Mi(e,r,n),Je(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(mp(r,n))},superRefine(r,n){return this.check(hp(r,n))},overwrite(r){return this.check(fe(r))},optional(){return i(this)},exactOptional(){return tp(this)},nullable(){return Hi(this)},nullish(){return i(Hi(this))},nonoptional(r){return ap(this,r)},array(){return P(this)},or(r){return f([this,r])},and(r){return Yc(this,r)},transform(r){return vi(this,Xi(r))},default(r){return op(this,r)},prefault(r){return ip(this,r)},catch(r){return cp(this,r)},pipe(r){return vi(this,r)},readonly(){return fp(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)),Wi=m("_ZodString",(e,t)=>{it.init(e,t),C.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ni(e,n,o,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Je(e,"_ZodString",{regex(...n){return this.check(Gt(...n))},includes(...n){return this.check(Qt(...n))},startsWith(...n){return this.check(er(...n))},endsWith(...n){return this.check(tr(...n))},min(...n){return this.check(Ze(...n))},max(...n){return this.check(pt(...n))},length(...n){return this.check(lt(...n))},nonempty(...n){return this.check(Ze(1,...n))},lowercase(n){return this.check(Yt(n))},uppercase(n){return this.check(Xt(n))},trim(){return this.check(nr())},normalize(...n){return this.check(rr(...n))},toLowerCase(){return this.check(or())},toUpperCase(){return this.check(sr())},slugify(){return this.check(ir())}})}),wc=m("ZodString",(e,t)=>{it.init(e,t),Wi.init(e,t),e.email=(r)=>e.check($s(zc,r)),e.url=(r)=>e.check(ks(Sc,r)),e.jwt=(r)=>e.check(Ms(Uc,r)),e.emoji=(r)=>e.check(Zs(kc,r)),e.guid=(r)=>e.check(Kt(qi,r)),e.uuid=(r)=>e.check(As(dt,r)),e.uuidv4=(r)=>e.check(ws(dt,r)),e.uuidv6=(r)=>e.check(zs(dt,r)),e.uuidv7=(r)=>e.check(Ss(dt,r)),e.nanoid=(r)=>e.check(Os(Zc,r)),e.guid=(r)=>e.check(Kt(qi,r)),e.cuid=(r)=>e.check(Es(Oc,r)),e.cuid2=(r)=>e.check(Ps(Ec,r)),e.ulid=(r)=>e.check(Rs(Pc,r)),e.base64=(r)=>e.check(Ds(Fc,r)),e.base64url=(r)=>e.check(Ls(Dc,r)),e.xid=(r)=>e.check(Ns(Rc,r)),e.ksuid=(r)=>e.check(Ts(Nc,r)),e.ipv4=(r)=>e.check(Cs(Tc,r)),e.ipv6=(r)=>e.check(Is(Cc,r)),e.cidrv4=(r)=>e.check(js(Ic,r)),e.cidrv6=(r)=>e.check(Fs(jc,r)),e.e164=(r)=>e.check(Us(Lc,r)),e.datetime=(r)=>e.check(ki(r)),e.date=(r)=>e.check(Zi(r)),e.time=(r)=>e.check(Oi(r)),e.duration=(r)=>e.check(Ei(r))});function u(e){return bs(wc,e)}var I=m("ZodStringFormat",(e,t)=>{T.init(e,t),Wi.init(e,t)}),zc=m("ZodEmail",(e,t)=>{So.init(e,t),I.init(e,t)});var qi=m("ZodGUID",(e,t)=>{wo.init(e,t),I.init(e,t)});var dt=m("ZodUUID",(e,t)=>{zo.init(e,t),I.init(e,t)});var Sc=m("ZodURL",(e,t)=>{ko.init(e,t),I.init(e,t)});var kc=m("ZodEmoji",(e,t)=>{Zo.init(e,t),I.init(e,t)});var Zc=m("ZodNanoID",(e,t)=>{Oo.init(e,t),I.init(e,t)});var Oc=m("ZodCUID",(e,t)=>{Eo.init(e,t),I.init(e,t)});var Ec=m("ZodCUID2",(e,t)=>{Po.init(e,t),I.init(e,t)});var Pc=m("ZodULID",(e,t)=>{Ro.init(e,t),I.init(e,t)});var Rc=m("ZodXID",(e,t)=>{No.init(e,t),I.init(e,t)});var Nc=m("ZodKSUID",(e,t)=>{To.init(e,t),I.init(e,t)});var Tc=m("ZodIPv4",(e,t)=>{Do.init(e,t),I.init(e,t)});var Cc=m("ZodIPv6",(e,t)=>{Lo.init(e,t),I.init(e,t)});var Ic=m("ZodCIDRv4",(e,t)=>{Uo.init(e,t),I.init(e,t)});var jc=m("ZodCIDRv6",(e,t)=>{Mo.init(e,t),I.init(e,t)});var Fc=m("ZodBase64",(e,t)=>{qo.init(e,t),I.init(e,t)});var Dc=m("ZodBase64URL",(e,t)=>{Jo.init(e,t),I.init(e,t)});var Lc=m("ZodE164",(e,t)=>{Bo.init(e,t),I.init(e,t)});var Uc=m("ZodJWT",(e,t)=>{Ho.init(e,t),I.init(e,t)});var Ki=m("ZodNumber",(e,t)=>{Bt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(n,o,s)=>oi(e,n,o,s),Je(e,"ZodNumber",{gt(n,o){return this.check(ut(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(at(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(Ji(n))},safe(n){return this.check(Ji(n))},positive(n){return this.check(ut(0,n))},nonnegative(n){return this.check(Ve(0,n))},negative(n){return this.check(at(0,n))},nonpositive(n){return this.check(Me(0,n))},multipleOf(n,o){return this.check(ct(n,o))},step(n,o){return this.check(ct(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 Hs(Ki,e)}var Mc=m("ZodNumberFormat",(e,t)=>{vo.init(e,t),Ki.init(e,t)});function Ji(e){return vs(Mc,e)}var Vc=m("ZodBoolean",(e,t)=>{Wo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>si(e,r,n,o)});function R(e){return Ws(Vc,e)}var qc=m("ZodNull",(e,t)=>{Ko.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ii(e,r,n,o)});function Oe(e){return Ks(qc,e)}var Jc=m("ZodUnknown",(e,t)=>{Go.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ci(e,r,n,o)});function Z(){return Gs(Jc)}var Bc=m("ZodNever",(e,t)=>{Yo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ui(e,r,n,o)});function S(e){return Ys(Bc,e)}var Hc=m("ZodVoid",(e,t)=>{Xo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ai(e,r,n,o)});function fr(e){return Xs(Hc,e)}var vc=m("ZodArray",(e,t)=>{Qo.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mi(e,r,n,o),e.element=t.element,Je(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(pt(r,n))},length(r,n){return this.check(lt(r,n))},unwrap(){return this.element}})});function P(e,t){return Qs(vc,e,t)}var Wc=m("ZodObject",(e,t)=>{rs.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hi(e,r,n,o),O(e,"shape",()=>t.shape),Je(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 Gu(this,r)},safeExtend(r){return Yu(this,r)},merge(r){return Xu(this,r)},pick(r){return Wu(this,r)},omit(r){return Ku(this,r)},partial(...r){return Qu(Qi,this,r[0])},required(...r){return ec(ea,this,r[0])}})});function d(e,t){let r={type:"object",shape:e??{},...w(t)};return new Wc(r)}var Gi=m("ZodUnion",(e,t)=>{Ht.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gi(e,r,n,o),e.options=t.options});function f(e,t){return new Gi({type:"union",options:e,...w(t)})}var Kc=m("ZodDiscriminatedUnion",(e,t)=>{Gi.init(e,t),ns.init(e,t)});function Yi(e,t,r){return new Kc({type:"union",options:t,discriminator:e,...w(r)})}var Gc=m("ZodIntersection",(e,t)=>{os.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_i(e,r,n,o)});function Yc(e,t){return new Gc({type:"intersection",left:e,right:t})}var Bi=m("ZodRecord",(e,t)=>{ss.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xi(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Ee(e,t,r){if(!t||!t._zod)return new Bi({type:"record",keyType:u(),valueType:e,...w(t)});return new Bi({type:"record",keyType:e,valueType:t,...w(r)})}var lr=m("ZodEnum",(e,t)=>{is.init(e,t),C.init(e,t),e._zod.processJSONSchema=(n,o,s)=>pi(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 a of n)if(r.has(a))s[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new lr({...t,checks:[],...w(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let a of n)if(r.has(a))delete s[a];else throw Error(`Key ${a} not found in enum`);return new lr({...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 lr({type:"enum",entries:r,...w(t)})}var Xc=m("ZodLiteral",(e,t)=>{as.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>li(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 k(e,t){return new Xc({type:"literal",values:Array.isArray(e)?e:[e],...w(t)})}var Qc=m("ZodTransform",(e,t)=>{us.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>di(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 a=s;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ge(a))}};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 Xi(e){return new Qc({type:"transform",transform:e})}var Qi=m("ZodOptional",(e,t)=>{vt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function i(e){return new Qi({type:"optional",innerType:e})}var ep=m("ZodExactOptional",(e,t)=>{cs.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function tp(e){return new ep({type:"optional",innerType:e})}var rp=m("ZodNullable",(e,t)=>{ps.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new rp({type:"nullable",innerType:e})}var np=m("ZodDefault",(e,t)=>{ls.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function op(e,t){return new np({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():jt(t)}})}var sp=m("ZodPrefault",(e,t)=>{fs.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ai(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ip(e,t){return new sp({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():jt(t)}})}var ea=m("ZodNonOptional",(e,t)=>{ds.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ap(e,t){return new ea({type:"nonoptional",innerType:e,...w(t)})}var up=m("ZodCatch",(e,t)=>{ms.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cp(e,t){return new up({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var ta=m("ZodPipe",(e,t)=>{Wt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zi(e,r,n,o),e.in=t.in,e.out=t.out});function vi(e,t){return new ta({type:"pipe",in:e,out:t})}var pp=m("ZodPreprocess",(e,t)=>{ta.init(e,t),hs.init(e,t)}),lp=m("ZodReadonly",(e,t)=>{gs.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Si(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function fp(e){return new lp({type:"readonly",innerType:e})}var dp=m("ZodCustom",(e,t)=>{_s.init(e,t),C.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fi(e,r,n,o)});function mp(e,t={}){return ei(dp,e,t)}function hp(e,t){return ti(e,t)}function g(e,t){return new pp({type:"pipe",in:Xi(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 ra;(function(e){})(ra||(ra={}));var _g=Z(),xg=Z(),yg=Z(),bg=Z(),$g=Z(),Ag=Z(),wg=Z(),zg=Z(),Sg=Z(),kg=Z(),Zg=Z(),Og=Z(),Eg=Z(),Pg=Z(),Rg=Z(),Ng=Z(),Tg=Z(),Cg=Z(),_p=d({color:i(u()),opacity:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var xp=d({family:i(u()),color:i(u()),opacity:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:i(u()),strokeWidth:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var yp=d({top:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var bp=d({type:b(["caption"]),src:u().min(1).regex(/\S/),font:i(xp),background:i(_p),margin:i(yp),trim:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var $p=d({color:f([u().regex(/^#[0-9a-fA-F]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),threshold:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),halo:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var mt=d({top:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),bottom:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),left:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),right:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Ap=d({host:u(),cpCode:u(),path:i(f([u(),Oe()])),filename:i(f([u(),Oe()]))}).strict(),wp=d({provider:k("akamai-netstorage"),options:i(Ap)}).strict(),zp=d({accountName:u(),container:u(),prefix:i(f([u(),Oe()])),filename:i(f([u(),Oe()]))}).strict(),Sp=d({provider:k("azure-blob-storage"),options:i(zp)}).strict(),kp=d({bucket:u(),prefix:i(u()),filename:i(u())}).strict();var Zp=d({provider:k("google-cloud-storage"),options:i(kp)}).strict();var Op=d({folderId:i(u()),filename:i(u())}).strict();var Ep=d({provider:k("google-drive"),options:i(Op)}).strict();var Pp=d({playbackPolicy:i(P(b(["public","signed"]))),passthrough:i(u().max(255))}).strict();var Rp=d({provider:k("mux"),options:i(Pp)}).strict();var Np=d({region:u(),bucket:u(),prefix:i(u()),filename:i(u()),acl:i(u())}).strict();var Tp=d({provider:k("s3"),options:i(Np)}).strict();var Cp=d({provider:k("shotstack"),exclude:i(R())}).strict();var Ip=d({title:i(u().max(150)),privacyLevel:i(b(["public","friends","private"])),disableDuet:i(R()).default(!1),disableStitch:i(R()).default(!1),disableComment:i(R()).default(!1)}).strict(),jp=d({provider:k("tiktok"),options:i(Ip)}).strict(),Fp=d({view:i(b(["anybody","nobody","contacts","password","unlisted"])),embed:i(b(["public","private","whitelist"])),comments:i(b(["anybody","nobody","contacts"])),download:i(R()),add:i(R())}).strict();var Dp=d({name:i(u()),description:i(u()),privacy:i(Fp),folderUri:i(u())}).strict();var Lp=d({provider:k("vimeo"),options:i(Dp)}).strict();var dr=Yi("provider",[Cp,Rp,Tp,Zp,Ep,Lp,jp,wp,Sp]);var Up=d({horizontal:i(R()),vertical:i(R())}).strict();var Mp=d({src:u()}).strict();var Vp=d({credits: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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),Ee(u(),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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))]),tieredBy:i(d({option:u(),default:u()})),quantity:i(d({measure:b(["clipSeconds","promptCharacters"]),per: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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),min:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),max:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),default:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),round:i(b(["up"]))})),effectiveFrom:u()}).strict();var qp=d({model:u(),type:b(["image","video","audio"]),name:i(u()),description:i(u()),pricing:i(Vp),options:i(Ee(u(),Z())),available:i(R()),unavailableReason:i(b(["AiCapabilityNotIncluded","AiDisabled","AiAccessUnavailable"]))}).strict();var Jp=d({type:b(["html5"]),html:u().max(1e6),css:i(u().max(500000)),js:i(u().max(500000))}).strict();var Bp=d({type:b(["html"]),html:u(),css:i(u()),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:i(u()),position:i(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"]))}).strict();var na=d({type:b(["image"]),src:i(u().min(1).regex(/\S/)),prompt:i(u().max(4000)),model:i(u()),options:i(Ee(u(),Z())),crop:i(mt)}).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 Hp=d({type:b(["image-to-video"]),src:u().min(1),prompt:i(u()),aspectRatio:i(b(["1:1","4:3","16:9","9:16","3:4","21:9","9:21"])),speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:i(mt)}).strict();var vp=d({preset:b(["conference","interview","lecture","meeting","mobile_phone","music","podcast","studio","voice_over"])}).strict();var Wp=d({provider:u().default("dolby"),options:vp}).strict();var Kp=d({enhancement:k("dolbyEnhancement_DolbyEnhancement")}).strict().and(Wp);var Gp=d({audio:i(Kp)}).strict();var Yp=d({status:u(),title:u(),detail:u()}).strict();var Ig=d({errors:P(Yp)}).strict();var Xp=d({type:u(),id:u()}).strict();var jg=d({data:Xp}).strict();var Qp=d({id:u(),url:u(),expires:u()}).strict();var el=d({type:u(),id:u(),attributes:Qp}).strict();var Fg=d({data:el}).strict();var tl=d({speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),preservePitch:i(R())}).strict();var rl=d({format:i(b(["srt","vtt"]))}).strict();var nl=d({type:b(["luma"]),src:u().min(1).regex(/\S/),trim:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var oa=d({find:u(),replace:Z()}).strict();var ol=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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var sl=d({start:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var il=d({id:u(),owner:u(),region:i(u()),renderId:i(u()),providerId:i(u()),filename:i(u()),url:i(u()),status:b(["importing","ready","failed","deleted"]),created:i(u()),updated:i(u())}).strict();var sa=d({type:u(),attributes:il}).strict();var Dg=d({data:P(sa)}).strict();var Lg=d({data:sa}).strict();var Ug=d({error:u(),code:i(u()),available:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Mg=d({error:d({name:b(["UnknownGenerationModel","WithdrawnGenerationModel"]),message:u()})}).strict();var Vg=d({models:P(qp)}).strict();var qg=d({id:u(),status:b(["queued","processing","done","failed"]),url:i(u()),error:i(u())}).strict();var Jg=d({success:R(),message:u(),response:Ee(u(),Z())}).strict();var al=d({message:u(),id:u()}).strict();var Bg=d({success:R(),message:u(),response:al}).strict();var ul=d({id:u(),name:u(),created:i(u()),updated:i(u())}).strict();var cl=d({owner:u(),templates:P(ul)}).strict();var Hg=d({success:R(),message:u(),response:cl}).strict();var pl=d({message:u(),id:u()}).strict();var vg=d({success:R(),message:u(),response:pl}).strict();var ll=d({family:i(u()),weight:i(Z()).default("400"),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),background:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),size:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:i(b(["none","underline","line-through"]))}).strict();var fl=d({style:b(["karaoke","highlight","pop","fade","slide","bounce","typewriter","none"]),direction:i(b(["left","right","up","down"]))}).strict();var dl=d({family:i(u()).default("Roboto"),size:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:i(Z()).default("400"),style:i(b(["normal","italic"])),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),ia=d({horizontal:i(b(["left","center","right"])),vertical:i(b(["top","middle","bottom"]))}).strict();var ml=d({preset:b(["fadeIn","slideIn","typewriter","ascend","shift","movingLetters"]),duration:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),style:i(b(["character","word"])),direction:i(b(["left","right","up","down"]))}).strict();var aa=d({color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),borderRadius:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wrap:i(R()).default(!1),padding:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var ua=d({width:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),radius:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict(),ca=d({type:i(b(["linear","radial"])),angle:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),stops:P(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)),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 hl=d({letterSpacing:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:i(b(["none","uppercase","lowercase","capitalize"])),size:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),textDecoration:i(b(["none","underline","line-through"])),gradient:i(ca)}).strict(),pa=d({top:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),right:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),bottom:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),left:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)}).strict(),mr=d({offsetX:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),offsetY:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),blur:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5)}).strict();var ht=d({width:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1)}).strict();var gl=d({font:i(ll),stroke:i(f([ht,b(["none"])])),shadow:i(f([mr,b(["none"])]))}).strict();var _l=d({type:b(["rich-caption"]),src:u().min(1),font:i(dl),style:i(hl),stroke:i(ht),shadow:i(mr),background:i(aa),border:i(ua),padding:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),pa])),align:i(ia),active:i(gl),animation:i(fl)}).strict();var xl=d({family:i(u()).default("Open Sans"),size:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),weight:i(Z()).default("400"),style:i(b(["normal","italic"])),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),background:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),stroke:i(ht)}).strict();var yl=d({letterSpacing:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),wordSpacing:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),lineHeight:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),textTransform:i(b(["none","uppercase","lowercase","capitalize"])),textDecoration:i(b(["none","underline","line-through"])),gradient:i(ca)}).strict();var bl=d({type:b(["rich-text"]),text:u().max(5000),font:i(xl),style:i(yl),stroke:i(ht),shadow:i(mr),background:i(aa),border:i(ua),padding:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),pa])),align:i(ia),animation:i(ml)}).strict();var $l=d({id:i(u()),owner:i(u()),status:i(b(["queued","failed"])),created:i(u())}).strict();var Al=d({type:i(u()),attributes:i($l)}).strict();var Wg=d({data:Al}).strict();var wl=d({url:u(),id:u(),destinations:P(dr)}).strict();var zl=d({type:b(["shape"]),shape:b(["rectangle","circle","line"]),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fill:i(d({color:i(u()),opacity:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),stroke:i(d({color:i(u()),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),rectangle:i(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()),u().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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),cornerRadius:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),circle:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])})),line:i(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()),u().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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}))}).strict();var la=d({width:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var fa=d({format:i(b(["mp4","webm","mov","avi","mkv","ogv","wmv","avif","gif","mp3","wav","jpg","png","webp","tif"])),size:i(la),fit:i(b(["cover","contain","crop"])),resolution:i(b(["preview","mobile","sd","hd","fhd"])),quality:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:i(f([k(12),k(15),k(23.976),k(24),k(25),k(29.97),k(30),k(48),k(50),k(59.94),k(60)])),speed:i(tl),keyframeInterval:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fixOffset:i(R()),fixRotation:i(R()),enhance:i(Gp),filename:i(u())}).strict();var Sl=d({renditions:i(P(fa)),transcription:i(rl)}).strict();var kl=d({id:u(),status:i(b(["queued","importing","ready","failed","deleted","overwritten"])),url:i(u()),executionTime:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),transformation:i(fa),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Zl=d({renditions:i(P(kl))}).strict();var Ol=d({id:u(),owner:u(),input:i(u()),source:i(u()),status:i(b(["queued","importing","ready","failed","deleted","overwritten"])),outputs:i(Zl),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),duration:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),fps:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),created:i(u()),updated:i(u())}).strict();var da=d({type:u(),id:u(),attributes:Ol}).strict();var Kg=d({data:P(da)}).strict();var Gg=d({data:da}).strict();var El=d({url:i(u()),outputs:i(Sl),destinations:i(dr),callback:i(u())}).strict();var Pl=d({src:u().min(1).regex(/\S/),effect:i(b(["fadeIn","fadeOut","fadeInFadeOut"])),volume:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Rl=d({type:b(["svg"]),src:u().min(1).max(500000)}).strict();var Nl=d({id:u(),merge:i(P(oa))}).strict();var Tl=d({horizontal:i(b(["left","center","right"])),vertical:i(b(["top","center","bottom"]))}).strict();var Cl=d({preset:b(["typewriter"]),duration:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),Il=d({color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),opacity:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),padding:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),borderRadius:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),wrap:i(R())}).strict();var jl=d({family:i(u()),color:i(u()),opacity:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),size:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),weight:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),lineHeight:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Fl=d({width:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),color:i(f([u().regex(/^#[A-Fa-f0-9]{6}$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict(),Dl=d({type:b(["text"]),text:u(),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),font:i(jl),background:i(Il),alignment:i(Tl),stroke:i(Fl),animation:i(Cl),ellipsis:i(u())}).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 Ll=d({type:b(["text-to-image"]),prompt:u(),width:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),crop:i(mt)}).strict();var Ul=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()),u().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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])}).strict();var Ml=d({format:b(["mp4","gif","mp3","jpg","png","bmp"]),resolution:i(b(["preview","mobile","sd","hd","1080","4k"])),aspectRatio:i(b(["16:9","9:16","1:1","4:5","4:3"])),size:i(la),fps:i(f([k(12),k(15),k(23.976),k(24),k(25),k(29.97),k(30),k(48),k(50),k(59.94),k(60)])),scaleTo:i(b(["preview","mobile","sd","hd","1080","4k"])),quality:i(b(["verylow","low","medium","high","veryhigh"])),repeat:i(R()),mute:i(R()),range:i(sl),poster:i(ol),thumbnail:i(Ul),destinations:i(P(dr))}).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 Vl=d({in:i(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:i(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:i(Z()),to:i(Z()),start:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),length:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),interpolation:i(b(["linear","bezier","constant"])),easing:i(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 ma=d({type:b(["audio"]),src:i(u().min(1).regex(/\S/)),prompt:i(u().max(4000)),model:i(u()),options:i(Ee(u(),Z())),trim:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:i(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 ha=d({x:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),y:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)]))}).strict();var ql=d({angle:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)]))}).strict();var Jl=d({x:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),y:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)]))}).strict();var Bl=d({type:b(["text-to-speech"]),text:u(),voice:u(),language:i(u()),newscaster:i(R()).default(!1),trim:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),effect:i(b(["none","fadeIn","fadeOut","fadeInFadeOut"]))}).strict();var Hl=d({type:b(["title"]),text:u(),style:i(b(["minimal","blockbuster","vogue","sketchy","skinny","chunk","chunkLight","marker","future","subtitle"])),color:i(u()),size:i(b(["xx-small","x-small","small","medium","large","x-large","xx-large"])),background:i(u()),position:i(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:i(ha)}).strict();var vl=d({rotate:i(ql),skew:i(Jl),flip:i(Up)}).strict();var ga=d({type:b(["video"]),src:i(u().min(1).regex(/\S/)),prompt:i(u().max(4000)),model:i(u()),options:i(Ee(u(),Z())),transcode:i(R()),trim:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),volume:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),volumeEffect:i(b(["none","fadeIn","fadeOut","fadeInFadeOut"])),speed:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),crop:i(mt),chromaKey:i($p)}).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 Wl=Yi("type",[ga,na,Dl,bl,ma,nl,bp,_l,Bp,Jp,Hl,zl,Rl,Ll,Hp,Bl]);var Kl=d({id:i(u()),asset:Wl,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)),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([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)),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:i(b(["cover","contain","crop","none"])),scale:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),width:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),height:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),position:i(b(["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft","center"])),offset:i(ha),transition:i(Vl),effect:i(b(["zoomIn","zoomInSlow","zoomInFast","zoomOut","zoomOutSlow","zoomOutFast","slideLeft","slideLeftSlow","slideLeftFast","slideRight","slideRightSlow","slideRightFast","slideUp","slideUpSlow","slideUpFast","slideDown","slideDownSlow","slideDownFast"])),filter:i(b(["none","blur","boost","contrast","darken","greyscale","lighten","muted","negative"])),opacity:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),P(te)])),transform:i(vl),alias:i(f([u().regex(/^[A-Za-z0-9_-]+$/),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))}).strict();var Gl=Kl.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}),Yl=d({clips:P(Gl).min(1)}).strict();var Xl=d({soundtrack:i(Pl),background:i(u()),fonts:i(P(Mp)),tracks:P(Yl).min(1),cache:i(R())}).strict();var Be=d({timeline:Xl,output:Ml,merge:i(P(oa)),callback:i(u()),disk:i(b(["local","mount"])),instance:i(b(["s1","s2","a1"]))}).strict(),_a=Be,Ql=d({id:u(),owner:u(),plan:i(u()),status:b(["queued","fetching","preprocessing","rendering","generating","saving","done","failed"]),error:i(u()),duration:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),renderTime:i(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()),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),url:i(u()),poster:i(f([u(),Oe()])),thumbnail:i(f([u(),Oe()])),data:i(Be),created:i(u()),updated:i(u())}).strict();var Yg=d({success:R(),message:u(),response:Ql}).strict();var ef=d({id:u(),name:u(),owner:u(),template:Be}).strict();var Xg=d({success:R(),message:u(),response:ef}).strict();var xa=d({name:u(),template:i(Be)}).strict();var Qg=d({body:Be,path:i(S()),query:i(S())}).strict();var e_=d({body:i(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:i(d({data:i(R()),merged:i(R())}))}).strict();var t_=d({body:i(S()),path:i(S()),query:i(S())}).strict();var r_=d({body:xa,path:i(S()),query:i(S())}).strict();var n_=d({body:i(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:i(S())}).strict(),o_=fr(),s_=d({body:i(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:i(S())}).strict();var i_=d({body:xa,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:i(S())}).strict();var a_=d({body:Nl,path:i(S()),query:i(S())}).strict();var u_=d({body:i(S()),path:d({url:u()}),query:i(S())}).strict();var c_=d({body:i(d({asset:f([na,ga,ma]),length:i(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)),u().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))})),path:i(S()),query:i(S()),headers:i(d({"Idempotency-Key":i(u())}))}).strict();var p_=d({body:i(S()),path:d({id:u()}),query:i(S())}).strict();var l_=d({body:i(S()),path:i(S()),query:i(d({expand:i(b(["options"]))}))}).strict();var f_=d({body:i(S()),path:d({id:u()}),query:i(S())}).strict();var d_=d({body:i(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:i(S())}).strict(),m_=fr(),h_=d({body:i(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:i(S())}).strict();var g_=d({body:i(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:i(S())}).strict();var __=d({body:wl,path:i(S()),query:i(S())}).strict();var x_=d({body:i(S()),path:i(S()),query:i(S())}).strict();var y_=d({body:El,path:i(S()),query:i(S())}).strict();var b_=d({body:i(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:i(S())}).strict(),$_=fr(),A_=d({body:i(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:i(S())}).strict();var w_=d({body:i(S()),path:i(S()),query:i(S())}).strict();var tf={alignment:"align",duration:"length",transitions:"transition",name:"family"},ya={"align.vertical":{center:"middle"},fit:{cover:"crop"}},rf=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"]),nf=/-(?:(?:Extra(?:Light|Bold)|SemiBold|Regular|Medium|Light|Black|Bold|Thin|Heavy)(?:Italic|Oblique)?|(?:Italic|Oblique))$/i,of=new Set(["image","video","audio","luma"]);function Re(e){let t=[],r=_a.safeParse(e);if(!r.success)for(let o of lf(r.error))t.push({...o,level:"error"});for(let o of sf(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${hr(r.length)}`:"";n.push(`✗ Edit JSON failed validation (${t.length} error${hr(t.length)}${o}):`)}else n.push(`⚠ Edit JSON valid, with ${r.length} warning${hr(r.length)}:`);for(let o of e){let s=(o.level??"error")==="error"?"✗":"⚠",a=o.suggestion?` (did you mean '${o.suggestion}'?)`:"";n.push(` ${s} ${o.path||"<root>"}: ${o.message}${a}`)}return n.join(`
|
|
89
|
-
`)}function
|
|
90
|
-
`).filter((
|
|
91
|
-
`)}var
|
|
92
|
-
`):"No sources.";return
|
|
93
|
-
`):"No templates found";return
|
|
94
|
-
`)
|
|
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 gf(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 u=xf(i?.src);if(u)s.push(u)}return o.forEach((i,u)=>{let p=i?.clips;if(!Array.isArray(p))return;let l=p.map((_,y)=>({ci:y,start:_?.start,len:_?.length})).filter((_)=>typeof _.start==="number"&&typeof _.len==="number");for(let _=0;_<l.length;_++)for(let y=_+1;y<l.length;y++){let A=l[_],x=l[y];if(A.start<x.start+x.len&&x.start<A.start+A.len){let[z,U]=A.ci<x.ci?[A.ci,x.ci]:[x.ci,A.ci];t.push({path:`timeline.tracks[${u}].clips`,code:"clip_overlap",level:"error",message:`clips [${z}] and [${U}] overlap in time — clips on one track must not `+"overlap (they flicker). Put simultaneous elements on separate tracks."})}}p.forEach((_,y)=>{let A=_?.asset,x=`timeline.tracks[${u}].clips[${y}]`,z=A?.font?.family;if(typeof z==="string"&&z.length>0){let oe=_f(z,s,`${x}.asset.font.family`);if(oe)t.push(oe)}let U=A?.type;if(U==="html5"&&typeof A?.js==="string"&&A.js.length>0){let oe=yf(A.js,`${x}.asset.js`);if(oe)t.push(oe)}let E=A?.src;if(typeof U==="string"&&hf.has(U)&&typeof E==="string")if(/^https:\/\//i.test(E)||/^alias:\/\//i.test(E));else if(/^data:/i.test(E))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(E))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:`'${bf(E,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 _f(e,t,r){let n=e.toLowerCase();if(df.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 xf(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(mf,"")}:null}function yf(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 bf(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function $f(e){return e.issues.flatMap((t)=>Af(t))}function Af(e){let t=zf(e.path);if(e.code==="unrecognized_keys"&&"keys"in e)return e.keys.map((n)=>({path:Sf(t,n),code:e.code,message:`unrecognized key '${n}'`,suggestion:ff[n]}));let r=wf(t,e);return[{path:t,code:e.code,message:e.message,...r?{suggestion:r}:{}}]}function wf(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 zf(e){return e.reduce((t,r)=>{if(typeof r==="number")return`${t}[${r}]`;let n=String(r);return t?`${t}.${n}`:n},"")}function Sf(e,t){return e?`${e}.${t}`:t}var $a=new L("render").description("Submit a Shotstack Edit JSON to the render API").argument("<file>","Path to a Shotstack Edit JSON file").option("--env <name>",`Environment: ${I.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 H("render",G("render"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=Zf(process.cwd(),e),i=await kf(s,"utf8"),u=JSON.parse(i),p=Re(u);if(!p.ok){if(r==="json")console.log(JSON.stringify({ok:!1,issues:p.issues}));else console.error(xe(p.issues));return{exitCode:1,validation:p}}if(p.issues.length>0&&r!=="json")console.error(xe(p.issues));let l=q({apiKey:o,env:n}),_=t.watch?2:1,y="";for(let A=1;A<=_;A++){let x=await l.post("/render",u),z=x.response.id;if(y=z,!t.watch)return P(r,{id:z},z),{renderId:z,response:x.response};let U=await It(l,z,r,!0);if(U.status!=="failed")return{renderId:z,response:U,exitCode:0};let E=Ef(U.error);if(E&&A<_){if(r!=="json")console.error(`⚠ render failed (${U.error??"unknown"}) — looks transient, resubmitting ${A+1}/${_}…`);await Pf(2000);continue}if(r!=="json")console.error(E?`✗ render still failing after ${_} attempts. For a complex multi-scene edit, preview it client-side first: shotstack studio ${e}`:`✗ render failed: ${U.error??"unknown error"}`);return{renderId:z,response:U,exitCode:1}}return{renderId:y,exitCode:1}})}),Of=/temporar|try again|time ?d? ?out|timeout|too many requests|service unavailable|unavailable|throttl/i;function Ef(e){return typeof e==="string"&&Of.test(e)}function Pf(e){return new Promise((t)=>setTimeout(t,e))}import{readFile as Rf,writeFile as Cf,mkdtemp as Nf}from"node:fs/promises";import{tmpdir as Tf}from"node:os";import{join as Aa}from"node:path";import{spawn as If}from"node:child_process";var wa="https://github.com/shotstack/shotstack-cli/issues/new?template=bug.yml",jf=6000,Za=5,Oa=new L("feedback").description("Open a pre-filled GitHub issue with a flight-recorder dossier from your last 5 invocations").action(async()=>{let e=await Ff(Za),t=Df(e),r=Uf(e),n=`&title=${encodeURIComponent(r)}`,o=`${wa}${n}&body=${encodeURIComponent(t)}`;if(o.length<=jf){ka(o),console.log("Opened browser with pre-filled issue. Review before submitting.");return}let s=await Nf(Aa(Tf(),"shotstack-feedback-")),i=Aa(s,"dossier.md");await Cf(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 Ff(e){let t=We(),r;try{r=await Rf(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 Df(e){let t=[];if(t.push("## Environment"),t.push(`- Shotstack CLI: ${Te}`),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 ${We()}]`),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,Lf="Feedback from shotstack CLI";function Uf(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 Lf}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=If(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 Mf}from"node:fs/promises";import{resolve as Vf}from"node:path";import{spawn as Ea,execSync as vf}from"node:child_process";var Pa="https://shotstack.studio",qf=`${Pa}/api/share`,Jf=3000,Bf=6000,Ra=new L("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("--output <format>","Output format: text | json","text").action(async(e,t)=>{let r=N(t.output),n=Vf(process.cwd(),e),o=await Mf(n,"utf8"),s=JSON.parse(o),i=Re(s);if(!i.ok){if(r==="json")console.log(JSON.stringify({ok:!1,issues:i.issues}));else console.error(xe(i.issues));process.exit(1)}let{url:u,shortened:p}=await Hf(s,{shorten:t.shorten});if(!p&&u.length>Bf)console.error(`warning: encoded URL is ${u.length} characters; large templates may exceed browser URL limits.`);if(t.copy)await Kf(u);let l=t.open&&ed()&&Qf(u);if(r==="json"||!l)P(r,{url:u,shortened:p},u)});async function Hf(e,t={}){if(t.shorten!==!1){let n=await Wf(e);if(n)return{url:n,shortened:!0};console.error("warning: could not reach the shotstack.studio share API; falling back to inline URL.")}return{url:Gf(e),shortened:!1}}function Gf(e){let t=Buffer.from(JSON.stringify(e),"utf8").toString("base64url");return`${Pa}/#json=${t}`}async function Wf(e){try{let t=await fetch(qf,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(Jf)});if(!t.ok)return null;return(await t.json()).url??null}catch{return null}}async function Kf(e){let{cmd:t,args:r}=Yf();await new Promise((n,o)=>{let s=Ea(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 Yf(){if(process.platform==="darwin")return{cmd:"pbcopy",args:[]};if(process.platform==="win32")return{cmd:"clip",args:[]};return{cmd:"xclip",args:["-selection","clipboard"]}}function Qf(e){let{cmd:t,args:r}=Xf(e);try{let n=Ea(t,r,{detached:!0,stdio:"ignore"});return n.on("error",()=>{}),n.unref(),!0}catch{return!1}}function Xf(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 ed(){if(process.platform==="darwin"||process.platform==="win32")return!0;if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return!1;try{return vf("command -v xdg-open",{stdio:"ignore"}),!0}catch{return!1}}import{readFile as td}from"node:fs/promises";import{resolve as rd,extname as nd}from"node:path";var od=3000,sd=new Set(["ready","failed","deleted","overwritten"]),ye=new L("ingest").description("Ingest source media via the Shotstack Ingest API: upload local files, fetch remote URLs, and manage stored sources");ye.command("upload <file>").description("Upload a local file and host it on Shotstack for use as an Edit asset src").option("--env <name>",`Environment: ${I.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 H("ingest upload",G("upload"),async()=>{let r=N(t.output),n=B(t.env,"ingest"),o=J(n.name),s=q({apiKey:o,env:n}),i=await td(rd(process.cwd(),e)),u=await s.post("/upload"),{id:p,url:l}=u.data.attributes;return await id(l,i,ud(e)),Ca(s,p,r,t.watch===!0)})});ye.command("fetch <url>").description("Ingest a remote URL into Shotstack-hosted storage").option("--env <name>",`Environment: ${I.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 H("ingest fetch",G("fetch"),async()=>{let r=N(t.output),n=B(t.env,"ingest"),o=J(n.name),s=q({apiKey:o,env:n}),i=await s.post("/sources",{url:e});return Ca(s,i.data.id,r,t.watch===!0)})});ye.command("status <id>").description("Poll the status of an ingested source").option("--env <name>",`Environment: ${I.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 H("ingest status",G("status"),async()=>{let r=N(t.output),n=B(t.env,"ingest"),o=J(n.name),s=q({apiKey:o,env:n}),i=await Na(s,e,r,t.watch===!0);return{renderId:i.id,response:_t(i),exitCode:i.status==="failed"?1:0}})});ye.command("list").description("List ingested sources").option("--env <name>",`Environment: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{await H("ingest list",G("list"),async()=>{let t=N(e.output),r=B(e.env,"ingest"),n=J(r.name),i=(await q({apiKey:n,env:r}).get("/sources")).data.map((p)=>_t(p.attributes)),u=i.length?i.map((p)=>[p.id,p.status,p.source??""].join(" ").trimEnd()).join(`
|
|
92
|
+
`):"No sources.";return P(t,i,u),{response:{count:i.length}}})});ye.command("delete <id>").description("Delete an ingested source").option("--env <name>",`Environment: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("ingest delete",G("delete"),async()=>{let r=N(t.output),n=B(t.env,"ingest"),o=J(n.name);return await q({apiKey:o,env:n}).del(`/sources/${encodeURIComponent(e)}`),P(r,{id:e,deleted:!0},`deleted ${e}`),{renderId:e,response:{id:e,deleted:!0}}})});async function Ca(e,t,r,n){if(!n)return P(r,{id:t},t),{renderId:t,response:{id:t}};let o=await Na(e,t,r,!0);return{renderId:t,response:_t(o),exitCode:o.status==="failed"?1:0}}async function Na(e,t,r,n,o=od){while(!0){let i=(await e.get(`/sources/${encodeURIComponent(t)}`)).data.attributes;if(P(r,_t(i),cd(i)),!n||sd.has(i.status))return i;await pd(o)}}async function id(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 ie(n.status,o||void 0,`PUT upload → ${n.status} ${n.statusText}`)}}var ad={".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 ud(e){return ad[nd(e).toLowerCase()]}function _t(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 cd(e){let t=[e.status];if(e.source)t.push(e.source);if(e.error)t.push(`error: ${e.error}`);return t.join(" ")}function pd(e){return new Promise((t)=>setTimeout(t,e))}import{readFile as ld}from"node:fs/promises";import{resolve as fd}from"node:path";async function dd(e,t){return(await e.get(`/templates/${encodeURIComponent(t)}`)).response}async function md(e){return(await e.get("/templates")).response.templates}async function hd(e,t,r){return(await e.post("/templates",{name:t,template:r})).response.id}async function gd(e,t,r,n){let o={template:r};if(n)o.name=n;await e.put(`/templates/${encodeURIComponent(t)}`,o)}async function _d(e,t){await e.del(`/templates/${encodeURIComponent(t)}`)}async function Ta(e){let t=await ld(fd(process.cwd(),e),"utf8");return JSON.parse(t)}var be=new L("template").description("Work with saved Shotstack templates");be.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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("template get",G("get"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=q({apiKey:o,env:n}),i=await dd(s,e);return P(r,i.template,JSON.stringify(i.template,null,2)),{templateId:i.id,exitCode:0}})});be.command("list").description("List your saved templates (id and name), newest first").option("--env <name>",`Environment: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{await H("template list",G("list"),async()=>{let t=N(e.output),r=B(e.env),n=J(r.name),o=q({apiKey:n,env:r}),s=await md(o),i=s.length?s.map((u)=>`${u.id} ${u.name??""}`.trimEnd()).join(`
|
|
93
|
+
`):"No templates found";return P(t,s,i),{count:s.length,exitCode:0}})});be.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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("template create",G("create"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=q({apiKey:o,env:n}),i=await Ta(e),u=await hd(s,t.name,i);return P(r,{id:u},u),{templateId:u,exitCode:0}})});be.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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t,r)=>{await H("template update",G("update"),async()=>{let n=N(r.output),o=B(r.env),s=J(o.name),i=q({apiKey:s,env:o}),u=await Ta(t);return await gd(i,e,u,r.name),P(n,{id:e,status:"updated"},`updated ${e}`),{templateId:e,exitCode:0}})});be.command("delete <id>").description("Delete a saved template").option("--env <name>",`Environment: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("template delete",G("delete"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=q({apiKey:o,env:n});return await _d(s,e),P(r,{id:e,status:"deleted"},`deleted ${e}`),{templateId:e,exitCode:0}})});import{readFile as xd}from"node:fs/promises";import{resolve as yd}from"node:path";var Ia=new L("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=N(t.output),n=yd(process.cwd(),e),o=await xd(n,"utf8"),s;try{s=JSON.parse(o)}catch(l){let _=l instanceof Error?l.message:String(l),y={path:"<root>",code:"invalid_json",level:"error",message:_};if(r==="json")console.log(JSON.stringify({ok:!1,issues:[y]}));else console.error(`✗ ${e}: invalid JSON — ${_}`);process.exitCode=1;return}let i=Re(s),u=i.issues.some((l)=>l.level==="warning"),p=!i.ok||t.strict===!0&&u;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=xe(i.issues);if(p)console.error(l);else console.log(l)}process.exitCode=p?1:0});async function bd(e){return(await e.get("/models")).models}async function xt(e,t){return e.get(`/models/${encodeURIComponent(t)}`)}var ja=new L("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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t)=>{await H("models",G("models"),async()=>{let r=N(t.output),n=B(t.env),o=J(n.name),s=q({apiKey:o,env:n});if(e){let u=await xt(s,e);return P(r,u,Ad(u)),{response:{model:u.model,available:u.available}}}let i=await bd(s);return P(r,i,i.length?$d(i):"No models."),{response:{count:i.length}}})});function yt(e){if(e.available===!0)return"available";if(e.available===!1)return`unavailable: ${e.unavailableReason??"no reason given"}`;return"availability unknown"}function $d(e){let t=e.map((n)=>[n.model,n.type,yt(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 Ad(e){let t=[`${e.model} ${e.type} ${yt(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 Fa=new Set(["done","failed"]),Da=3000,La=new L("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>`)",Zd).option("--length <seconds>","Length of the clip the asset fills; models that generate to a duration use it",Od).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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e,t,r)=>{await H("generate",G("generate"),async()=>{let n=N(r.output),o=B(r.env),s=J(o.name),i=q({apiKey:s,env:o}),u={model:e,prompt:t,options:r.options,length:r.length};if(r.quote)return zd(i,u,n);return wd(i,u,n,r.watch===!0)})});async function wd(e,t,r,n,o=Da){let s=await xt(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 ${yt(s)}`);return{response:p,exitCode:1}}let i=await e.post("/generate",Ua(s,t));P(r,i,Ma(i));let u=i;if(!Fa.has(i.status)){if(n)u=await kd(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:u.id,response:u,exitCode:u.status==="failed"?1:0}}async function zd(e,t,r){let n=await xt(e,t.model),o=await e.post("/generate/quote",Ua(n,t));return P(r,o,Sd(o)),{response:o}}function Sd(e){return`${e.ceiling?"up to ":""}${e.credits} ${e.credits===1?"credit":"credits"}`}function Ua(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 kd(e,t,r,n=Da){while(!0){await Ed(n);let o=await e.get(`/generate/${encodeURIComponent(t)}`);if(P(r,o,Ma(o)),Fa.has(o.status))return o}}function Zd(e){let t;try{t=JSON.parse(e)}catch{throw new He("Not valid JSON.")}if(t===null||typeof t!=="object"||Array.isArray(t))throw new He("Expected a JSON object.");return t}function Od(e){let t=Number(e);if(!Number.isFinite(t)||t<=0)throw new He("Expected a positive number of seconds.");return t}function Ma(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 Ed(e){return new Promise((t)=>setTimeout(t,e))}import{createInterface as Pd}from"node:readline";import{Writable as Rd}from"node:stream";var Va=new L("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: ${I.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(e)=>{let t=N(e.output),r=Ge(e.env),n=await Cd();if(!n)console.error("No API key provided."),process.exit(1);await Kr(r,n);let o=Ae();P(t,{env:r,stored:!0,path:o},`Saved API key for ${r} → ${o} (chmod 600).`)}),va=new L("logout").description("Remove a saved Shotstack API key").option("--env <name>",`Environment to forget: ${I.join(" | ")}`).option("--all","Remove saved keys for every environment").option("--output <format>","Output format: text | json","text").action(async(e)=>{let t=N(e.output);if(e.all){await Qr(),P(t,{cleared:!0},"Removed all saved API keys.");return}let r=Ge(e.env),n=await Yr(r);P(t,{env:r,removed:n},n?`Removed saved API key for ${r}.`:`No saved API key for ${r}.`)});async function Cd(){if(!process.stdin.isTTY){let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf8").trim()}return Nd("Shotstack API key: ")}function Nd(e){return new Promise((t)=>{let r=!1,n=new Rd({write(s,i,u){if(!r)process.stdout.write(s);u()}}),o=Pd({input:process.stdin,output:n,terminal:!0});o.question(e,(s)=>{o.close(),process.stdout.write(`
|
|
96
|
+
`),t(s.trim())}),r=!0})}var Td=new L().name("shotstack").description("Command-line interface for the Shotstack video rendering API").version(Te).addCommand($a).addCommand(on).addCommand(Ra).addCommand(ye).addCommand(be).addCommand(Ia).addCommand(ja).addCommand(La).addCommand(Va).addCommand(va).addCommand(Oa);try{await Td.parseAsync(process.argv)}catch(e){process.exit(Id(e))}function Id(e){if(e instanceof we||e instanceof ze)return console.error(e.message),1;if(e instanceof ie){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}
|