@boostxyz/cli 1.1.0-alpha.37 → 1.2.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/dist/{ccip-B90Impbv.js → ccip-BNKpCk1Q.js} +1 -1
- package/dist/{ccip-DQqriboS.cjs → ccip-BX3ehRwS.cjs} +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +15 -15
- package/dist/commands/deploy.cjs +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/seed.cjs +2 -2
- package/dist/commands/seed.js +603 -578
- package/dist/{utils-C7UotnrC.cjs → utils-CQC0lDOX.cjs} +13 -13
- package/dist/{utils-CX1JpbvX.js → utils-CbGtTEVk.js} +449 -449
- package/package.json +2 -2
package/dist/commands/deploy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoostRegistry as U, BoostCore as y0, getDeployedContractAddress as d, EventAction as u0, SimpleAllowList as o0, SimpleDenyList as l0, ManagedBudget as m0, AllowListIncentive as T0, CGDAIncentive as w0, ERC20Incentive as v0, ERC20VariableIncentive as M0, ERC20VariableCriteriaIncentive as I0, PointsIncentive as h0, SignerValidator as A0, LimitedSignerValidator as O0 } from "@boostxyz/sdk";
|
|
2
|
-
import { C as R0, a as g0, b as x0, p as _0, c as C0, d as z0, f as N0, h as E0, i as $0, j as L0, k as k0 } from "../utils-
|
|
2
|
+
import { C as R0, a as g0, b as x0, p as _0, c as C0, d as z0, f as N0, h as E0, i as $0, j as L0, k as k0 } from "../utils-CbGtTEVk.js";
|
|
3
3
|
const H0 = "hh-sol-artifact-1", B0 = "ContractAction", D0 = "contracts/actions/ContractAction.sol", S0 = [
|
|
4
4
|
{
|
|
5
5
|
inputs: [],
|
package/dist/commands/seed.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return tt(this,we,"m",nt).call(this,this,e)}}we=new WeakSet,nt=function n(e,t){return t!=null&&t(e)?e:e.cause?tt(this,we,"m",n).call(this,e.cause,t):e};class Lt extends Y{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class zt extends Y{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Ut extends Y{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class qt extends Y{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function at(n,e={}){let t;if(e.connector){const{connector:c}=e;if(n.state.status==="reconnecting"&&!c.getAccounts&&!c.getChainId)throw new qt({connector:c});const[m,I]=await Promise.all([c.getAccounts(),c.getChainId()]);t={accounts:m,chainId:I,connector:c}}else t=n.state.connections.get(n.state.current);if(!t)throw new Lt;const a=e.chainId??t.chainId,r=await t.connector.getChainId();if(r!==t.chainId)throw new Ut({connectionChainId:t.chainId,connectorChainId:r});const s=t.connector;if(s.getClient)return s.getClient({chainId:a});const i=C.parseAccount(e.account??t.accounts[0]);if(i.address=C.getAddress(i.address),e.account&&!t.accounts.some(c=>c.toLowerCase()===i.address.toLowerCase()))throw new zt({address:i.address,connector:s});const o=n.chains.find(c=>c.id===a),u=await t.connector.getProvider({chainId:a});return C.createClient({account:i,chain:o,name:"Connector Client",transport:c=>C.custom(u)({...c,retryCount:0})})}async function Pe(n,e){const{abi:t,chainId:a,connector:r,...s}=e;let i;e.account?i=e.account:i=(await at(n,{chainId:a,connector:r})).account;const o=n.getClient({chainId:a}),u=ze(o,C.simulateContract,"simulateContract"),{result:c,request:m}=await u({...s,abi:t,account:i});return{chainId:o.chain.id,result:c,request:{__mode:"prepared",...m,chainId:a}}}function Ue(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=Le(e),s=Ne(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return Pe(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>Pe(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}function Ge(n,e){const{chainId:t,...a}=e,r=n.getClient({chainId:t});return ze(r,C.readContract,"readContract")(a)}function rt(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=Le(e),s=Ne(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return Ge(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>Ge(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}async function Qe(n,e){const{account:t,chainId:a,connector:r,__mode:s,...i}=e;let o;typeof t=="object"&&t.type==="local"?o=n.getClient({chainId:a}):o=await at(n,{account:t,chainId:a,connector:r});const{connector:u}=Ne(n);let c;if(s==="prepared"||u!=null&&u.supportsSimulation)c=i;else{const{request:m}=await Pe(n,{...i,account:t,chainId:a});c=m}return await ze(o,C.writeContract,"writeContract")({...c,...t?{account:t}:{},chain:a?{id:a}:null})}function qe(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=Le(e),s=Ne(e);let i;return t.chainId?i=t.chainId:t.account&&t.account===s.address||t.account===void 0?i=s.chainId:i=r,Qe(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:i?(a=n.address)==null?void 0:a[i]:void 0,abi:n.abi})}:(e,t)=>Qe(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}const B=[{type:"error",inputs:[],name:"AllowanceOverflow"},{type:"error",inputs:[],name:"AllowanceUnderflow"},{type:"error",inputs:[],name:"InsufficientAllowance"},{type:"error",inputs:[],name:"InsufficientBalance"},{type:"error",inputs:[],name:"InvalidPermit"},{type:"error",inputs:[],name:"PermitExpired"},{type:"error",inputs:[],name:"TotalSupplyOverflow"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"spender",internalType:"address",type:"address",indexed:!0},{name:"amount",internalType:"uint256",type:"uint256",indexed:!1}],name:"Approval"},{type:"event",anonymous:!1,inputs:[{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"amount",internalType:"uint256",type:"uint256",indexed:!1}],name:"Transfer"},{type:"function",inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{name:"result",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"spender",internalType:"address",type:"address"}],name:"allowance",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"spender",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"approve",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"balanceOf",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"decimals",outputs:[{name:"",internalType:"uint8",type:"uint8"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"mintPayable",outputs:[],stateMutability:"payable"},{type:"function",inputs:[],name:"name",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"nonces",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"spender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"deadline",internalType:"uint256",type:"uint256"},{name:"v",internalType:"uint8",type:"uint8"},{name:"r",internalType:"bytes32",type:"bytes32"},{name:"s",internalType:"bytes32",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"symbol",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"function",inputs:[],name:"totalSupply",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"transfer",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"transferFrom",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"}],Wt=rt({abi:B,functionName:"allowance"}),Ft=rt({abi:B,functionName:"balanceOf"}),Ht=qe({abi:B,functionName:"approve"}),Jt=qe({abi:B,functionName:"mint"}),Yt=qe({abi:B,functionName:"mintPayable"}),Gt=Ue({abi:B,functionName:"approve"}),Qt=Ue({abi:B,functionName:"mint"}),Kt=Ue({abi:B,functionName:"mintPayable"}),Xt="0x6080604052348015600e575f80fd5b50610e138061001c5f395ff3fe6080604052600436106100dc575f3560e01c806340c10f191161007e57806395d89b411161005857806395d89b41146102bc578063a9059cbb146102e6578063d505accf14610322578063dd62ed3e1461034a576100dc565b806340c10f191461021c57806370a08231146102445780637ecebe0014610280576100dc565b806318160ddd116100ba57806318160ddd1461016257806323b872dd1461018c578063313ce567146101c85780633644e515146101f2576100dc565b806306fdde03146100e0578063095ea7b31461010a57806317d304b014610146575b5f80fd5b3480156100eb575f80fd5b506100f4610386565b60405161010191906109bf565b60405180910390f35b348015610115575f80fd5b50610130600480360381019061012b9190610a70565b6103c3565b60405161013d9190610ac8565b60405180910390f35b610160600480360381019061015b9190610a70565b610413565b005b34801561016d575f80fd5b50610176610470565b6040516101839190610af0565b60405180910390f35b348015610197575f80fd5b506101b260048036038101906101ad9190610b09565b610481565b6040516101bf9190610ac8565b60405180910390f35b3480156101d3575f80fd5b506101dc610552565b6040516101e99190610b74565b60405180910390f35b3480156101fd575f80fd5b5061020661055a565b6040516102139190610ba5565b60405180910390f35b348015610227575f80fd5b50610242600480360381019061023d9190610a70565b6105ea565b005b34801561024f575f80fd5b5061026a60048036038101906102659190610bbe565b6105f8565b6040516102779190610af0565b60405180910390f35b34801561028b575f80fd5b506102a660048036038101906102a19190610bbe565b610611565b6040516102b39190610af0565b60405180910390f35b3480156102c7575f80fd5b506102d061062a565b6040516102dd91906109bf565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190610a70565b610667565b6040516103199190610ac8565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190610c3d565b6106f5565b005b348015610355575f80fd5b50610370600480360381019061036b9190610cda565b610891565b60405161037d9190610af0565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f636b20455243323000000000000000000000000000000000000000000000815250905090565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b6064816104209190610d45565b341015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045990610dbf565b60405180910390fd5b61046c82826108af565b5050565b5f6805345cdf77eb68f44c54905090565b5f61048d848484610941565b8360601b33602052637f5e9f208117600c526034600c20805460018101156104ca57808511156104c4576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c208054808711156104f05763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610547848484610946565b600190509392505050565b5f6012905090565b5f8061056461094b565b90505f801b810361058157610577610386565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b6105f482826108af565b5050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b60606040518060400160405280600481526020017f4d4f434b00000000000000000000000000000000000000000000000000000000815250905090565b5f610673338484610941565b6387a211a2600c52335f526020600c2080548084111561069a5763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050506106eb338484610946565b6001905092915050565b5f6106fe61094b565b90505f801b810361071b57610711610386565b8051906020012090505b8442111561073057631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d51146108385763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b6108ba5f8383610941565b6805345cdf77eb68f44c54818101818110156108dd5763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350505061093d5f8383610946565b5050565b505050565b505050565b5f90565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6109918261094f565b61099b8185610959565b93506109ab818560208601610969565b6109b481610977565b840191505092915050565b5f6020820190508181035f8301526109d78184610987565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a0c826109e3565b9050919050565b610a1c81610a02565b8114610a26575f80fd5b50565b5f81359050610a3781610a13565b92915050565b5f819050919050565b610a4f81610a3d565b8114610a59575f80fd5b50565b5f81359050610a6a81610a46565b92915050565b5f8060408385031215610a8657610a856109df565b5b5f610a9385828601610a29565b9250506020610aa485828601610a5c565b9150509250929050565b5f8115159050919050565b610ac281610aae565b82525050565b5f602082019050610adb5f830184610ab9565b92915050565b610aea81610a3d565b82525050565b5f602082019050610b035f830184610ae1565b92915050565b5f805f60608486031215610b2057610b1f6109df565b5b5f610b2d86828701610a29565b9350506020610b3e86828701610a29565b9250506040610b4f86828701610a5c565b9150509250925092565b5f60ff82169050919050565b610b6e81610b59565b82525050565b5f602082019050610b875f830184610b65565b92915050565b5f819050919050565b610b9f81610b8d565b82525050565b5f602082019050610bb85f830184610b96565b92915050565b5f60208284031215610bd357610bd26109df565b5b5f610be084828501610a29565b91505092915050565b610bf281610b59565b8114610bfc575f80fd5b50565b5f81359050610c0d81610be9565b92915050565b610c1c81610b8d565b8114610c26575f80fd5b50565b5f81359050610c3781610c13565b92915050565b5f805f805f805f60e0888a031215610c5857610c576109df565b5b5f610c658a828b01610a29565b9750506020610c768a828b01610a29565b9650506040610c878a828b01610a5c565b9550506060610c988a828b01610a5c565b9450506080610ca98a828b01610bff565b93505060a0610cba8a828b01610c29565b92505060c0610ccb8a828b01610c29565b91505092959891949750929550565b5f8060408385031215610cf057610cef6109df565b5b5f610cfd85828601610a29565b9250506020610d0e85828601610a29565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610d4f82610a3d565b9150610d5a83610a3d565b925082610d6a57610d69610d18565b5b828204905092915050565b7f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e657921000000005f82015250565b5f610da9601c83610959565b9150610db482610d75565b602082019050919050565b5f6020820190508181035f830152610dd681610d9d565b905091905056fea2646970667358221220a588f9f821e157f856641e8171dc78ec959e3c73080238aa8696355fc5d4a5d064736f6c634300081a0033";class st extends T.Deployable{async balanceOf(e,t){return await Ft(this._config,{address:this.assertValidAddress(),args:[e],...t})}async allowance(e,t,a){return await Wt(this._config,{address:this.assertValidAddress(),args:[e,t],...a})}async approve(e,t,a){return await this.awaitResult(this.approveRaw(e,t,a))}async approveRaw(e,t,a){const{request:r,result:s}=await Gt(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Ht(this._config,r),result:s}}async mint(e,t,a){return await this.awaitResult(this.mintRaw(e,t,a))}async mintRaw(e,t,a){const{request:r,result:s}=await Qt(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Jt(this._config,r),result:s}}async mintPayable(e,t,a){return await this.awaitResult(this.mintPayableRaw(e,t,a))}async mintPayableRaw(e,t,a){const{request:r,result:s}=await Kt(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Yt(this._config,r),result:s}}buildParameters(e={},t){const[,a]=this.validateDeploymentConfig(e,t);return{abi:B,bytecode:Xt,...this.optionallyAttachAccount(a.account)}}}const en=[{account:"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",key:"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",key:"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"},{account:"0x90F79bf6EB2c4f870365E785982E1f101E93b906",key:"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6"},{account:"0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",key:"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"},{account:"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",key:"0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"}].map(n=>({...n,privateKey:C.privateKeyToAccount(n.key)}));var _;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const s={};for(const i of r)s[i]=i;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of s)i[o]=r[o];return n.objectValues(i)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&s.push(i);return s},n.find=(r,s)=>{for(const i of r)if(s(i))return i},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function a(r,s=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}n.joinValues=a,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(_||(_={}));var $e;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})($e||($e={}));const f=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=n=>{switch(typeof n){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(n)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(n)?f.array:n===null?f.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?f.promise:typeof Map<"u"&&n instanceof Map?f.map:typeof Set<"u"&&n instanceof Set?f.set:typeof Date<"u"&&n instanceof Date?f.date:f.object;default:return f.unknown}},d=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),tn=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class R extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},a={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)a._errors.push(t(i));else{let o=a,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return r(this),a}static assert(e){if(!(e instanceof R))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}R.create=n=>new R(n);const ne=(n,e)=>{let t;switch(n.code){case d.invalid_type:n.received===f.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,_.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(n.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(n.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(n.options)}, received '${n.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:_.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case d.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case d.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(n)}return{message:t}};let it=ne;function nn(n){it=n}function ke(){return it}const Te=n=>{const{data:e,path:t,errorMaps:a,issueData:r}=n,s=[...t,...r.path||[]],i={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let o="";const u=a.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...r,path:s,message:o}},an=[];function l(n,e){const t=ke(),a=Te({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===ne?void 0:ne].filter(r=>!!r)});n.common.issues.push(a)}class A{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const r of t){if(r.status==="aborted")return b;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const r of t){const s=await r.key,i=await r.value;a.push({key:s,value:i})}return A.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const r of t){const{key:s,value:i}=r;if(s.status==="aborted"||i.status==="aborted")return b;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(a[s.value]=i.value)}return{status:e.value,value:a}}}const b=Object.freeze({status:"aborted"}),ee=n=>({status:"dirty",value:n}),E=n=>({status:"valid",value:n}),De=n=>n.status==="aborted",Ve=n=>n.status==="dirty",oe=n=>n.status==="valid",ce=n=>typeof Promise<"u"&&n instanceof Promise;function Ce(n,e,t,a){if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function ot(n,e,t,a,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}var p;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(p||(p={}));var se,ie;class P{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ke=(n,e)=>{if(oe(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new R(n.common.issues);return this._error=t,this._error}}};function g(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:r}=n;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{var u,c;const{message:m}=n;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:(u=m??a)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=m??t)!==null&&c!==void 0?c:o.defaultError}},description:r}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ce(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const r={common:{issues:[],async:(a=t==null?void 0:t.async)!==null&&a!==void 0?a:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Ke(r,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},r=this._parse({data:e,path:a.path,parent:a}),s=await(ce(r)?r:Promise.resolve(r));return Ke(a,s)}refine(e,t){const a=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const i=e(r),o=()=>s.addIssue({code:d.custom,...a(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof t=="function"?t(a,r):t),!1))}_refinement(e){return new j({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return M.create(this,this._def)}nullable(){return F.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this,this._def)}promise(){return re.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return he.create(this,e,this._def)}transform(e){return new j({...g(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ge({...g(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new We({typeName:y.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ve({...g(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return _e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rn=/^c[^\s-]{8,}$/i,sn=/^[0-9a-z]+$/,on=/^[0-9A-HJKMNP-TV-Z]{26}$/,cn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dn=/^[a-z0-9_-]{21}$/i,un=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ln=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ze;const hn=/^(?:(?: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])$/,pn=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,mn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct="((\\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])))",yn=new RegExp(`^${ct}$`);function dt(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function bn(n){return new RegExp(`^${dt(n)}$`)}function ut(n){let e=`${ct}T${dt(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function gn(n,e){return!!((e==="v4"||!e)&&hn.test(n)||(e==="v6"||!e)&&pn.test(n))}class O extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.string,received:s.parsedType}),b}const a=new A;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?l(r,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&l(r,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")ln.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"email",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Ze||(Ze=new RegExp(fn,"u")),Ze.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"emoji",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")cn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"uuid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")dn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"nanoid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")rn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")sn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid2",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")on.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ulid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),l(r,{validation:"url",code:d.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"regex",code:d.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?ut(s).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?yn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?bn(s).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?un.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"duration",code:d.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?gn(e.data,s.version)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ip",code:d.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?mn.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"base64",code:d.invalid_string,message:s.message}),a.dirty()):_.assertNever(s);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(r=>e.test(r),{validation:t,code:d.invalid_string,...p.errToObj(a)})}_addCheck(e){return new O({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}datetime(e){var t,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!1,...p.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...p.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...p.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...p.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...p.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...p.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...p.errToObj(t)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new O({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}O.create=n=>{var e;return new O({checks:[],typeName:y.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...g(n)})};function vn(n,e){const t=(n.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=t>a?t:a,s=parseInt(n.toFixed(r).replace(".","")),i=parseInt(e.toFixed(r).replace(".",""));return s%i/Math.pow(10,r)}class U extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.number,received:s.parsedType}),b}let a;const r=new A;for(const s of this._def.checks)s.kind==="int"?_.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?vn(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.not_finite,message:s.message}),r.dirty()):_.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,a,r){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}U.create=n=>new U({checks:[],typeName:y.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...g(n)});class q extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.bigint,received:s.parsedType}),b}let a;const r=new A;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):_.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,a,r){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}q.create=n=>{var e;return new q({checks:[],typeName:y.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...g(n)})};class de extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.boolean,received:a.parsedType}),b}return E(e.data)}}de.create=n=>new de({typeName:y.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...g(n)});class G extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_type,expected:f.date,received:s.parsedType}),b}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return l(s,{code:d.invalid_date}),b}const a=new A;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):_.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}G.create=n=>new G({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:y.ZodDate,...g(n)});class Se extends v{_parse(e){if(this._getType(e)!==f.symbol){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.symbol,received:a.parsedType}),b}return E(e.data)}}Se.create=n=>new Se({typeName:y.ZodSymbol,...g(n)});class ue extends v{_parse(e){if(this._getType(e)!==f.undefined){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.undefined,received:a.parsedType}),b}return E(e.data)}}ue.create=n=>new ue({typeName:y.ZodUndefined,...g(n)});class le extends v{_parse(e){if(this._getType(e)!==f.null){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.null,received:a.parsedType}),b}return E(e.data)}}le.create=n=>new le({typeName:y.ZodNull,...g(n)});class ae extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return E(e.data)}}ae.create=n=>new ae({typeName:y.ZodAny,...g(n)});class J extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return E(e.data)}}J.create=n=>new J({typeName:y.ZodUnknown,...g(n)});class V extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),b}}V.create=n=>new V({typeName:y.ZodNever,...g(n)});class Ie extends v{_parse(e){if(this._getType(e)!==f.undefined){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.void,received:a.parsedType}),b}return E(e.data)}}Ie.create=n=>new Ie({typeName:y.ZodVoid,...g(n)});class Z extends v{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),b;if(r.exactLength!==null){const i=t.data.length>r.exactLength.value,o=t.data.length<r.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(l(t,{code:d.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(l(t,{code:d.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>r.type._parseAsync(new P(t,i,t.path,o)))).then(i=>A.mergeArray(a,i));const s=[...t.data].map((i,o)=>r.type._parseSync(new P(t,i,t.path,o)));return A.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new Z({...this._def,minLength:{value:e,message:p.toString(t)}})}max(e,t){return new Z({...this._def,maxLength:{value:e,message:p.toString(t)}})}length(e,t){return new Z({...this._def,exactLength:{value:e,message:p.toString(t)}})}nonempty(e){return this.min(1,e)}}Z.create=(n,e)=>new Z({type:n,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...g(e)});function X(n){if(n instanceof x){const e={};for(const t in n.shape){const a=n.shape[t];e[t]=M.create(X(a))}return new x({...n._def,shape:()=>e})}else return n instanceof Z?new Z({...n._def,type:X(n.element)}):n instanceof M?M.create(X(n.unwrap())):n instanceof F?F.create(X(n.unwrap())):n instanceof $?$.create(n.items.map(e=>X(e))):n}class x extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const c=this._getOrReturnCtx(e);return l(c,{code:d.invalid_type,expected:f.object,received:c.parsedType}),b}const{status:a,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof V&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const m=s[c],I=r.data[c];u.push({key:{status:"valid",value:c},value:m._parse(new P(r,I,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof V){const c=this._def.unknownKeys;if(c==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(c==="strict")o.length>0&&(l(r,{code:d.unrecognized_keys,keys:o}),a.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const m of o){const I=r.data[m];u.push({key:{status:"valid",value:m},value:c._parse(new P(r,I,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const m of u){const I=await m.key,K=await m.value;c.push({key:I,value:K,alwaysSet:m.alwaysSet})}return c}).then(c=>A.mergeObjectSync(a,c)):A.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var r,s,i,o;const u=(i=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,a).message)!==null&&i!==void 0?i:a.defaultError;return t.code==="unrecognized_keys"?{message:(o=p.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};return _.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])}),new x({...this._def,shape:()=>t})}omit(e){const t={};return _.objectKeys(this.shape).forEach(a=>{e[a]||(t[a]=this.shape[a])}),new x({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};return _.objectKeys(this.shape).forEach(a=>{const r=this.shape[a];e&&!e[a]?t[a]=r:t[a]=r.optional()}),new x({...this._def,shape:()=>t})}required(e){const t={};return _.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])t[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof M;)s=s._def.innerType;t[a]=s}}),new x({...this._def,shape:()=>t})}keyof(){return lt(_.objectKeys(this.shape))}}x.create=(n,e)=>new x({shape:()=>n,unknownKeys:"strip",catchall:V.create(),typeName:y.ZodObject,...g(e)});x.strictCreate=(n,e)=>new x({shape:()=>n,unknownKeys:"strict",catchall:V.create(),typeName:y.ZodObject,...g(e)});x.lazycreate=(n,e)=>new x({shape:n,unknownKeys:"strip",catchall:V.create(),typeName:y.ZodObject,...g(e)});class fe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function r(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new R(o.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:i}),b}if(t.common.async)return Promise.all(a.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(r);{let s;const i=[];for(const u of a){const c={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(u=>new R(u));return l(t,{code:d.invalid_union,unionErrors:o}),b}}get options(){return this._def.options}}fe.create=(n,e)=>new fe({options:n,typeName:y.ZodUnion,...g(e)});const D=n=>n instanceof me?D(n.schema):n instanceof j?D(n.innerType()):n instanceof ye?[n.value]:n instanceof W?n.options:n instanceof be?_.objectValues(n.enum):n instanceof ge?D(n._def.innerType):n instanceof ue?[void 0]:n instanceof le?[null]:n instanceof M?[void 0,...D(n.unwrap())]:n instanceof F?[null,...D(n.unwrap())]:n instanceof We||n instanceof _e?D(n.unwrap()):n instanceof ve?D(n._def.innerType):[];class Re extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:d.invalid_type,expected:f.object,received:t.parsedType}),b;const a=this.discriminator,r=t.data[a],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const r=new Map;for(const s of t){const i=D(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,s)}}return new Re({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...g(a)})}}function Be(n,e){const t=z(n),a=z(e);if(n===e)return{valid:!0,data:n};if(t===f.object&&a===f.object){const r=_.objectKeys(e),s=_.objectKeys(n).filter(o=>r.indexOf(o)!==-1),i={...n,...e};for(const o of s){const u=Be(n[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&a===f.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<n.length;s++){const i=n[s],o=e[s],u=Be(i,o);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return t===f.date&&a===f.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class he extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=(s,i)=>{if(De(s)||De(i))return b;const o=Be(s.value,i.value);return o.valid?((Ve(s)||Ve(i))&&t.dirty(),{status:t.value,value:o.data}):(l(a,{code:d.invalid_intersection_types}),b)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,i])=>r(s,i)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}he.create=(n,e,t)=>new he({left:n,right:e,typeName:y.ZodIntersection,...g(t)});class $ extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.array)return l(a,{code:d.invalid_type,expected:f.array,received:a.parsedType}),b;if(a.data.length<this._def.items.length)return l(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&a.data.length>this._def.items.length&&(l(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new P(a,i,a.path,o)):null}).filter(i=>!!i);return a.common.async?Promise.all(s).then(i=>A.mergeArray(t,i)):A.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $({...this._def,rest:e})}}$.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:n,typeName:y.ZodTuple,rest:null,...g(e)})};class pe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.object)return l(a,{code:d.invalid_type,expected:f.object,received:a.parsedType}),b;const r=[],s=this._def.keyType,i=this._def.valueType;for(const o in a.data)r.push({key:s._parse(new P(a,o,a.path,o)),value:i._parse(new P(a,a.data[o],a.path,o)),alwaysSet:o in a.data});return a.common.async?A.mergeObjectAsync(t,r):A.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof v?new pe({keyType:e,valueType:t,typeName:y.ZodRecord,...g(a)}):new pe({keyType:O.create(),valueType:e,typeName:y.ZodRecord,...g(t)})}}class Ae extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.map)return l(a,{code:d.invalid_type,expected:f.map,received:a.parsedType}),b;const r=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map(([o,u],c)=>({key:r._parse(new P(a,o,a.path,[c,"key"])),value:s._parse(new P(a,u,a.path,[c,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,m=await u.value;if(c.status==="aborted"||m.status==="aborted")return b;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,m=u.value;if(c.status==="aborted"||m.status==="aborted")return b;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}}}}Ae.create=(n,e,t)=>new Ae({valueType:e,keyType:n,typeName:y.ZodMap,...g(t)});class Q extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.set)return l(a,{code:d.invalid_type,expected:f.set,received:a.parsedType}),b;const r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(l(a,{code:d.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(l(a,{code:d.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function i(u){const c=new Set;for(const m of u){if(m.status==="aborted")return b;m.status==="dirty"&&t.dirty(),c.add(m.value)}return{status:t.value,value:c}}const o=[...a.data.values()].map((u,c)=>s._parse(new P(a,u,a.path,c)));return a.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new Q({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new Q({...this._def,maxSize:{value:e,message:p.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(n,e)=>new Q({valueType:n,minSize:null,maxSize:null,typeName:y.ZodSet,...g(e)});class te extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:d.invalid_type,expected:f.function,received:t.parsedType}),b;function a(o,u){return Te({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),ne].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function r(o,u){return Te({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ke(),ne].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof re){const o=this;return E(async function(...u){const c=new R([]),m=await o._def.args.parseAsync(u,s).catch(N=>{throw c.addIssue(a(u,N)),c}),I=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(I,s).catch(N=>{throw c.addIssue(r(I,N)),c})})}else{const o=this;return E(function(...u){const c=o._def.args.safeParse(u,s);if(!c.success)throw new R([a(u,c.error)]);const m=Reflect.apply(i,this,c.data),I=o._def.returns.safeParse(m,s);if(!I.success)throw new R([r(m,I.error)]);return I.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new te({...this._def,args:$.create(e).rest(J.create())})}returns(e){return new te({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new te({args:e||$.create([]).rest(J.create()),returns:t||J.create(),typeName:y.ZodFunction,...g(a)})}}class me extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}me.create=(n,e)=>new me({getter:n,typeName:y.ZodLazy,...g(e)});class ye extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}ye.create=(n,e)=>new ye({value:n,typeName:y.ZodLiteral,...g(e)});function lt(n,e){return new W({values:n,typeName:y.ZodEnum,...g(e)})}class W extends v{constructor(){super(...arguments),se.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{expected:_.joinValues(a),received:t.parsedType,code:d.invalid_type}),b}if(Ce(this,se)||ot(this,se,new Set(this._def.values)),!Ce(this,se).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:a}),b}return E(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return W.create(e,{...this._def,...t})}exclude(e,t=this._def){return W.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}se=new WeakMap;W.create=lt;class be extends v{constructor(){super(...arguments),ie.set(this,void 0)}_parse(e){const t=_.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==f.string&&a.parsedType!==f.number){const r=_.objectValues(t);return l(a,{expected:_.joinValues(r),received:a.parsedType,code:d.invalid_type}),b}if(Ce(this,ie)||ot(this,ie,new Set(_.getValidEnumValues(this._def.values))),!Ce(this,ie).has(e.data)){const r=_.objectValues(t);return l(a,{received:a.data,code:d.invalid_enum_value,options:r}),b}return E(e.data)}get enum(){return this._def.values}}ie=new WeakMap;be.create=(n,e)=>new be({values:n,typeName:y.ZodNativeEnum,...g(e)});class re extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:f.promise,received:t.parsedType}),b;const a=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return E(a.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(n,e)=>new re({type:n,typeName:y.ZodPromise,...g(e)});class j extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:i=>{l(a,i),i.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const i=r.transform(a.data,s);if(a.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return b;const u=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return u.status==="aborted"?b:u.status==="dirty"||t.value==="dirty"?ee(u.value):u});{if(t.value==="aborted")return b;const o=this._def.schema._parseSync({data:i,path:a.path,parent:a});return o.status==="aborted"?b:o.status==="dirty"||t.value==="dirty"?ee(o.value):o}}if(r.type==="refinement"){const i=o=>{const u=r.refinement(o,s);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){const i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!oe(i))return i;const o=r.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>oe(i)?Promise.resolve(r.transform(i.value,s)).then(o=>({status:t.value,value:o})):i);_.assertNever(r)}}j.create=(n,e,t)=>new j({schema:n,typeName:y.ZodEffects,effect:e,...g(t)});j.createWithPreprocess=(n,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:n},typeName:y.ZodEffects,...g(t)});class M extends v{_parse(e){return this._getType(e)===f.undefined?E(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(n,e)=>new M({innerType:n,typeName:y.ZodOptional,...g(e)});class F extends v{_parse(e){return this._getType(e)===f.null?E(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}F.create=(n,e)=>new F({innerType:n,typeName:y.ZodNullable,...g(e)});class ge extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===f.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ge.create=(n,e)=>new ge({innerType:n,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ve extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ce(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new R(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new R(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ve.create=(n,e)=>new ve({innerType:n,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class Ee extends v{_parse(e){if(this._getType(e)!==f.nan){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.nan,received:a.parsedType}),b}return{status:"valid",value:e.data}}}Ee.create=n=>new Ee({typeName:y.ZodNaN,...g(n)});const _n=Symbol("zod_brand");class We extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?b:s.status==="dirty"?(t.dirty(),ee(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?b:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,t){return new xe({in:e,out:t,typeName:y.ZodPipeline})}}class _e extends v{_parse(e){const t=this._def.innerType._parse(e),a=r=>(oe(r)&&(r.value=Object.freeze(r.value)),r);return ce(t)?t.then(r=>a(r)):a(t)}unwrap(){return this._def.innerType}}_e.create=(n,e)=>new _e({innerType:n,typeName:y.ZodReadonly,...g(e)});function ft(n,e={},t){return n?ae.create().superRefine((a,r)=>{var s,i;if(!n(a)){const o=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,u=(i=(s=o.fatal)!==null&&s!==void 0?s:t)!==null&&i!==void 0?i:!0,c=typeof o=="string"?{message:o}:o;r.addIssue({code:"custom",...c,fatal:u})}}):ae.create()}const xn={object:x.lazycreate};var y;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(y||(y={}));const wn=(n,e={message:`Input not instance of ${n.name}`})=>ft(t=>t instanceof n,e),ht=O.create,pt=U.create,kn=Ee.create,Tn=q.create,mt=de.create,Cn=G.create,Sn=Se.create,In=ue.create,An=le.create,En=ae.create,Nn=J.create,Rn=V.create,On=Ie.create,Zn=Z.create,jn=x.create,Mn=x.strictCreate,Pn=fe.create,$n=Re.create,Dn=he.create,Vn=$.create,Bn=pe.create,Ln=Ae.create,zn=Q.create,Un=te.create,qn=me.create,Wn=ye.create,Fn=W.create,Hn=be.create,Jn=re.create,Xe=j.create,Yn=M.create,Gn=F.create,Qn=j.createWithPreprocess,Kn=xe.create,Xn=()=>ht().optional(),ea=()=>pt().optional(),ta=()=>mt().optional(),na={string:n=>O.create({...n,coerce:!0}),number:n=>U.create({...n,coerce:!0}),boolean:n=>de.create({...n,coerce:!0}),bigint:n=>q.create({...n,coerce:!0}),date:n=>G.create({...n,coerce:!0})},aa=b;var h=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:nn,getErrorMap:ke,makeIssue:Te,EMPTY_PATH:an,addIssueToContext:l,ParseStatus:A,INVALID:b,DIRTY:ee,OK:E,isAborted:De,isDirty:Ve,isValid:oe,isAsync:ce,get util(){return _},get objectUtil(){return $e},ZodParsedType:f,getParsedType:z,ZodType:v,datetimeRegex:ut,ZodString:O,ZodNumber:U,ZodBigInt:q,ZodBoolean:de,ZodDate:G,ZodSymbol:Se,ZodUndefined:ue,ZodNull:le,ZodAny:ae,ZodUnknown:J,ZodNever:V,ZodVoid:Ie,ZodArray:Z,ZodObject:x,ZodUnion:fe,ZodDiscriminatedUnion:Re,ZodIntersection:he,ZodTuple:$,ZodRecord:pe,ZodMap:Ae,ZodSet:Q,ZodFunction:te,ZodLazy:me,ZodLiteral:ye,ZodEnum:W,ZodNativeEnum:be,ZodPromise:re,ZodEffects:j,ZodTransformer:j,ZodOptional:M,ZodNullable:F,ZodDefault:ge,ZodCatch:ve,ZodNaN:Ee,BRAND:_n,ZodBranded:We,ZodPipeline:xe,ZodReadonly:_e,custom:ft,Schema:v,ZodSchema:v,late:xn,get ZodFirstPartyTypeKind(){return y},coerce:na,any:En,array:Zn,bigint:Tn,boolean:mt,date:Cn,discriminatedUnion:$n,effect:Xe,enum:Fn,function:Un,instanceof:wn,intersection:Dn,lazy:qn,literal:Wn,map:Ln,nan:kn,nativeEnum:Hn,never:Rn,null:An,nullable:Gn,number:pt,object:jn,oboolean:ta,onumber:ea,optional:Yn,ostring:Xn,pipeline:Kn,preprocess:Qn,promise:Jn,record:Bn,set:zn,strictObject:Mn,string:ht,symbol:Sn,transformer:Xe,tuple:Vn,undefined:In,union:Pn,unknown:Nn,void:On,NEVER:aa,ZodIssueCode:d,quotelessJson:tn,ZodError:R});const ra="test test test test test test test test test test test junk",sa=async function(e,t){const a=t.privateKey,r=t.mnemonic??ra,s=t.chain||"anvil",[{config:i,account:o},u]=C.getDeployableOptions({chain:s,rpcUrl:t.rpcUrl,privateKey:a,mnemonic:r}),c=u.id;if(e.at(0)==="generate")return Nt({account:o==null?void 0:o.address,chainId:c});if(e.at(0)==="erc20"){let S=new st({config:i,account:o},{});return await S.deploy(),{erc20:S.assertValidAddress()}}const m=T.BOOST_REGISTRY_ADDRESSES[c];if(!m)throw new Error(`Unable to select a deployed BoostRegistry with chain ID ${c}`);const I=new T.BoostRegistry({config:i,account:o,address:m}),K=T.BOOST_CORE_ADDRESSES[c];if(!K)throw new Error(`Unable to select a deployed BoostCore with chain ID ${c}`);const N=new T.BoostCore({config:i,account:o,address:K});if(!e.length)throw new Error("No seed provided");const Rt=await Promise.all(e.map(ia));let Oe,He;const Je=[];for(const S of Rt){let L;if(typeof S.budget=="string"&&C.isAddress(S.budget))L=N.ManagedBudget(S.budget);else if(Me(He,S.budget)&&Oe)L=Oe;else{const k={...S.budget,authorized:[...S.budget.authorized,K],roles:[...S.budget.roles,T.Roles.MANAGER]};L=await I.initialize(crypto.randomUUID(),N.ManagedBudget(k)),Oe=L,He=S.budget}const Ot=S.incentives.map(async k=>{let H=0n;switch(k.type){case"AllowListIncentive":return N.AllowListIncentive(k);case"ERC20Incentive":return k.strategy===T.StrategyType.RAFFLE&&(H+=k.reward),k.strategy===T.StrategyType.POOL&&(H+=k.reward*k.limit),k.shouldMintAndAllocate&&await je(L,H,k.asset,{config:i,account:o}),N.ERC20Incentive(k);case"ERC20VariableCriteriaIncentive":return H+=k.limit,k.shouldMintAndAllocate&&await je(L,H,k.asset,{config:i,account:o}),N.ERC20VariableCriteriaIncentive(k);case"ERC20VariableIncentive":return H+=k.limit,k.shouldMintAndAllocate&&await je(L,H,k.asset,{config:i,account:o}),N.ERC20VariableIncentive(k)}}),Zt=await Promise.all(Ot),jt=await N.createBoost({protocolFee:S.protocolFee,maxParticipants:S.maxParticipants,budget:L,action:N.EventAction(S.action),validator:N.SignerValidator(S.validator),allowList:await da(S,{core:N}),incentives:Zt});Je.push(jt.id.toString())}return{boostIds:Je}};async function je(n,e,t,a){if(t&&e){let r=new st(a,t);await ua(a,r,n,et(e.toString()))}}async function ia(n){const e=await Mt.readFile(Pt.normalize(n),{encoding:"utf8"});return Et.parse(JSON.parse(e))}const oa=h.custom(C.isHex,"invalid Hex payload"),w=h.string().transform((n,e)=>(/^0x[a-fA-F0-9]{40}$/.test(n)||e.addIssue({code:h.ZodIssueCode.custom,message:`Invalid Address ${n}`}),n)).pipe(h.custom(C.isAddress,"invalid eth address")),ca=h.coerce.number().min(1).max(2).transform(BigInt).pipe(h.custom()),yt=h.object({type:h.literal("ManagedBudget"),owner:w,authorized:h.array(w),roles:h.array(ca)}).refine(n=>n.authorized.length===n.roles.length,"length mismatch authorized and roles"),Fe=h.custom().pipe(h.string().regex(/^(event|function) .*/,{message:"signature must start with `event` or function`"}).transform(n=>{if(n.startsWith("event"))return C.pad(C.toFunctionSelector(n));if(n.startsWith("function"))return C.toEventSelector(n);throw new Error("unreachable")})),bt=h.object({signatureType:h.nativeEnum(T.SignatureType),signature:Fe,fieldIndex:h.number().nonnegative(),targetContract:w,chainid:h.number().nonnegative()}),gt=h.object({filterType:h.nativeEnum(T.FilterType),fieldType:h.nativeEnum(T.PrimitiveType),fieldIndex:h.number().nonnegative(),filterData:oa}),vt=h.object({signature:Fe,signatureType:h.nativeEnum(T.SignatureType),actionType:h.number().optional(),targetContract:w,chainid:h.number().nonnegative(),actionParameter:gt}),_t=h.object({type:h.literal("EventAction"),actionClaimant:bt,actionSteps:h.array(vt).max(4)}),xt=h.object({type:h.literal("SignerValidator"),signers:h.array(w),validatorCaller:w}),wt=h.object({type:h.literal("SimpleDenyList"),owner:w,denied:h.array(w)}),kt=h.object({type:h.literal("SimpleAllowList"),owner:w,allowed:h.array(w)}),Tt=h.object({type:h.literal("AllowListIncentive"),allowList:w,limit:h.coerce.bigint()}),Ct=h.object({type:h.literal("ERC20Incentive"),asset:w,shouldMintAndAllocate:h.boolean().optional().default(!1),strategy:h.nativeEnum(T.StrategyType),reward:h.coerce.bigint(),limit:h.coerce.bigint(),manager:w.optional()}),St=h.object({type:h.literal("ERC20VariableIncentive"),asset:w,shouldMintAndAllocate:h.boolean().optional().default(!1),reward:h.coerce.bigint(),limit:h.coerce.bigint(),manager:w}),It=h.object({criteriaType:h.nativeEnum(T.SignatureType),signature:Fe,fieldIndex:h.number().nonnegative(),targetContract:w}),At=h.object({type:h.literal("ERC20VariableCriteriaIncentive"),asset:w,shouldMintAndAllocate:h.boolean().optional().default(!1),reward:h.coerce.bigint(),limit:h.coerce.bigint(),manager:w.optional(),criteria:It}),Et=h.object({protocolFee:h.coerce.bigint(),maxParticipants:h.coerce.bigint(),budget:h.union([w,yt]),action:h.union([w,_t]),validator:h.union([w,xt]),allowList:h.union([w,wt,kt]),incentives:h.array(h.union([Tt,Ct,At,St]))});async function da({allowList:n},{core:e}){if(typeof n=="string"&&C.isAddress(n))return await T.allowListFromAddress({config:e._config,account:e._account},n);switch(n.type){case"SimpleAllowList":return e.SimpleAllowList(n);case"SimpleDenyList":return e.SimpleDenyList(n);default:throw new Error("unusupported AllowList: "+n)}}async function ua(n,e,t,a=et("110")){return await e.mint(n.account.address,a),await e.approve(t.assertValidAddress(),a),await t.allocate({amount:a,asset:e.assertValidAddress(),target:n.account.address}),{budget:t,erc20:e}}function Nt({asset:n="0xf3B2d0E4f2d8F453DBCc278b10e88b20d7f19f8D",account:e=en[0].account,chainId:t}){return{protocolFee:0n,maxParticipants:10n,budget:{type:"ManagedBudget",owner:e,authorized:[e],roles:[T.Roles.MANAGER]},action:{type:"EventAction",actionClaimant:{signatureType:T.SignatureType.FUNC,signature:"function mint(address to, uint256 amount)",fieldIndex:0,targetContract:Ye,chainid:t},actionSteps:[{signature:"event Minted(address to, uint256 amount)",signatureType:T.SignatureType.FUNC,actionType:0,targetContract:Ye,chainid:t,actionParameter:{filterType:T.FilterType.EQUAL,fieldType:T.PrimitiveType.ADDRESS,fieldIndex:0,filterData:e}}]},validator:{type:"SignerValidator",signers:[e],validatorCaller:e},allowList:{type:"SimpleDenyList",owner:e,denied:[]},incentives:[{type:"ERC20Incentive",asset:n,shouldMintAndAllocate:!1,strategy:0,reward:1n,limit:1n,manager:e}]}}exports.ActionClaimantSchema=bt;exports.ActionStepCriteriaSchema=gt;exports.ActionStepSchema=vt;exports.AllowListIncentiveSchema=Tt;exports.BoostSeedConfigSchema=Et;exports.ERC20IncentiveSchema=Ct;exports.ERC20VariableCriteriaIncentiveSchema=At;exports.ERC20VariableIncentiveSchema=St;exports.EventActionSchema=_t;exports.IncentiveCriteriaSchema=It;exports.ManagedBudgetSchema=yt;exports.SignerValidatorSchema=xt;exports.SimpleAllowListSchema=kt;exports.SimpleDenyListSchema=wt;exports.makeSeed=Nt;exports.seed=sa;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dt=require("node:fs/promises"),Vt=require("node:path"),T=require("@boostxyz/sdk"),S=require("../utils-CQC0lDOX.cjs");class Bt extends S.BaseError{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Lt(n,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(n))throw new Bt({value:n});let[t,a="0"]=n.split(".");const r=t.startsWith("-");if(r&&(t=t.slice(1)),a=a.replace(/(0+)$/,""),e===0)Math.round(+`.${a}`)===1&&(t=`${BigInt(t)+1n}`),a="";else if(a.length>e){const[s,i,o]=[a.slice(0,e-1),a.slice(e-1,e),a.slice(e)],u=Math.round(+`${i}.${o}`);u>9?a=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):a=`${s}${u}`,a.length>e&&(a=a.slice(1),t=`${BigInt(t)+1n}`),a=a.slice(0,e)}else a=a.padEnd(e,"0");return BigInt(`${r?"-":""}${t}${a}`)}function tt(n,e="wei"){return Lt(n,S.etherUnits[e])}const Ye="0x0000000000000000000000000000000000000000";function Pe(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;let t,a;if(Array.isArray(n)&&Array.isArray(e)){if(t=n.length,t!==e.length)return!1;for(a=t;a--!==0;)if(!Pe(n[a],e[a]))return!1;return!0}if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();const r=Object.keys(n);if(t=r.length,t!==Object.keys(e).length)return!1;for(a=t;a--!==0;)if(!Object.prototype.hasOwnProperty.call(e,r[a]))return!1;for(a=t;a--!==0;){const s=r[a];if(s&&!Pe(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function Re(n){const e=n.state.current,t=n.state.connections.get(e),a=t==null?void 0:t.accounts,r=a==null?void 0:a[0],s=n.chains.find(o=>o.id===(t==null?void 0:t.chainId)),i=n.state.status;switch(i){case"connected":return{address:r,addresses:a,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:i};case"reconnecting":return{address:r,addresses:a,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!r,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:i};case"connecting":return{address:r,addresses:a,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:i};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:i}}}function ze(n){return n.state.chainId}function Ue(n,e,t){const a=n[e.name];if(typeof a=="function")return a;const r=n[t];return typeof r=="function"?r:s=>e(n,s)}const zt="2.13.8",Ut=()=>`@wagmi/core@${zt}`;var nt=function(n,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(n):a?a.value:e.get(n)},ke,at;class J extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Ut()}constructor(e,t={}){var a;super(),ke.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=t.cause instanceof J?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,s=t.cause instanceof J&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
|
|
2
|
+
`),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return nt(this,ke,"m",at).call(this,this,e)}}ke=new WeakSet,at=function n(e,t){return t!=null&&t(e)?e:e.cause?nt(this,ke,"m",n).call(this,e.cause,t):e};class qt extends J{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Wt extends J{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Ft extends J{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ht extends J{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function rt(n,e={}){let t;if(e.connector){const{connector:c}=e;if(n.state.status==="reconnecting"&&!c.getAccounts&&!c.getChainId)throw new Ht({connector:c});const[m,I]=await Promise.all([c.getAccounts(),c.getChainId()]);t={accounts:m,chainId:I,connector:c}}else t=n.state.connections.get(n.state.current);if(!t)throw new qt;const a=e.chainId??t.chainId,r=await t.connector.getChainId();if(r!==t.chainId)throw new Ft({connectionChainId:t.chainId,connectorChainId:r});const s=t.connector;if(s.getClient)return s.getClient({chainId:a});const i=S.parseAccount(e.account??t.accounts[0]);if(i.address=S.getAddress(i.address),e.account&&!t.accounts.some(c=>c.toLowerCase()===i.address.toLowerCase()))throw new Wt({address:i.address,connector:s});const o=n.chains.find(c=>c.id===a),u=await t.connector.getProvider({chainId:a});return S.createClient({account:i,chain:o,name:"Connector Client",transport:c=>S.custom(u)({...c,retryCount:0})})}async function $e(n,e){const{abi:t,chainId:a,connector:r,...s}=e;let i;e.account?i=e.account:i=(await rt(n,{chainId:a,connector:r})).account;const o=n.getClient({chainId:a}),u=Ue(o,S.simulateContract,"simulateContract"),{result:c,request:m}=await u({...s,abi:t,account:i});return{chainId:o.chain.id,result:c,request:{__mode:"prepared",...m,chainId:a}}}function qe(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=ze(e),s=Re(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return $e(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>$e(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}function Qe(n,e){const{chainId:t,...a}=e,r=n.getClient({chainId:t});return Ue(r,S.readContract,"readContract")(a)}function st(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=ze(e),s=Re(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return Qe(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>Qe(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}async function Ke(n,e){const{account:t,chainId:a,connector:r,__mode:s,...i}=e;let o;typeof t=="object"&&t.type==="local"?o=n.getClient({chainId:a}):o=await rt(n,{account:t,chainId:a,connector:r});const{connector:u}=Re(n);let c;if(s==="prepared"||u!=null&&u.supportsSimulation)c=i;else{const{request:m}=await $e(n,{...i,account:t,chainId:a});c=m}return await Ue(o,S.writeContract,"writeContract")({...c,...t?{account:t}:{},chain:a?{id:a}:null})}function We(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=ze(e),s=Re(e);let i;return t.chainId?i=t.chainId:t.account&&t.account===s.address||t.account===void 0?i=s.chainId:i=r,Ke(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:i?(a=n.address)==null?void 0:a[i]:void 0,abi:n.abi})}:(e,t)=>Ke(e,{...t,...n.address?{address:n.address}:{},...n.functionName?{functionName:n.functionName}:{},abi:n.abi})}const z=[{type:"error",inputs:[],name:"AllowanceOverflow"},{type:"error",inputs:[],name:"AllowanceUnderflow"},{type:"error",inputs:[],name:"InsufficientAllowance"},{type:"error",inputs:[],name:"InsufficientBalance"},{type:"error",inputs:[],name:"InvalidPermit"},{type:"error",inputs:[],name:"PermitExpired"},{type:"error",inputs:[],name:"TotalSupplyOverflow"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"spender",internalType:"address",type:"address",indexed:!0},{name:"amount",internalType:"uint256",type:"uint256",indexed:!1}],name:"Approval"},{type:"event",anonymous:!1,inputs:[{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"amount",internalType:"uint256",type:"uint256",indexed:!1}],name:"Transfer"},{type:"function",inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{name:"result",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"spender",internalType:"address",type:"address"}],name:"allowance",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"spender",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"approve",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"balanceOf",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"decimals",outputs:[{name:"",internalType:"uint8",type:"uint8"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"mintPayable",outputs:[],stateMutability:"payable"},{type:"function",inputs:[],name:"name",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"nonces",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"spender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"deadline",internalType:"uint256",type:"uint256"},{name:"v",internalType:"uint8",type:"uint8"},{name:"r",internalType:"bytes32",type:"bytes32"},{name:"s",internalType:"bytes32",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"symbol",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"function",inputs:[],name:"totalSupply",outputs:[{name:"result",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"transfer",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"amount",internalType:"uint256",type:"uint256"}],name:"transferFrom",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"nonpayable"}],Gt=st({abi:z,functionName:"allowance"}),Jt=st({abi:z,functionName:"balanceOf"}),Yt=We({abi:z,functionName:"approve"}),Qt=We({abi:z,functionName:"mint"}),Kt=We({abi:z,functionName:"mintPayable"}),Xt=qe({abi:z,functionName:"approve"}),en=qe({abi:z,functionName:"mint"}),tn=qe({abi:z,functionName:"mintPayable"}),nn="0x6080604052348015600e575f80fd5b50610e138061001c5f395ff3fe6080604052600436106100dc575f3560e01c806340c10f191161007e57806395d89b411161005857806395d89b41146102bc578063a9059cbb146102e6578063d505accf14610322578063dd62ed3e1461034a576100dc565b806340c10f191461021c57806370a08231146102445780637ecebe0014610280576100dc565b806318160ddd116100ba57806318160ddd1461016257806323b872dd1461018c578063313ce567146101c85780633644e515146101f2576100dc565b806306fdde03146100e0578063095ea7b31461010a57806317d304b014610146575b5f80fd5b3480156100eb575f80fd5b506100f4610386565b60405161010191906109bf565b60405180910390f35b348015610115575f80fd5b50610130600480360381019061012b9190610a70565b6103c3565b60405161013d9190610ac8565b60405180910390f35b610160600480360381019061015b9190610a70565b610413565b005b34801561016d575f80fd5b50610176610470565b6040516101839190610af0565b60405180910390f35b348015610197575f80fd5b506101b260048036038101906101ad9190610b09565b610481565b6040516101bf9190610ac8565b60405180910390f35b3480156101d3575f80fd5b506101dc610552565b6040516101e99190610b74565b60405180910390f35b3480156101fd575f80fd5b5061020661055a565b6040516102139190610ba5565b60405180910390f35b348015610227575f80fd5b50610242600480360381019061023d9190610a70565b6105ea565b005b34801561024f575f80fd5b5061026a60048036038101906102659190610bbe565b6105f8565b6040516102779190610af0565b60405180910390f35b34801561028b575f80fd5b506102a660048036038101906102a19190610bbe565b610611565b6040516102b39190610af0565b60405180910390f35b3480156102c7575f80fd5b506102d061062a565b6040516102dd91906109bf565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190610a70565b610667565b6040516103199190610ac8565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190610c3d565b6106f5565b005b348015610355575f80fd5b50610370600480360381019061036b9190610cda565b610891565b60405161037d9190610af0565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f636b20455243323000000000000000000000000000000000000000000000815250905090565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b6064816104209190610d45565b341015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045990610dbf565b60405180910390fd5b61046c82826108af565b5050565b5f6805345cdf77eb68f44c54905090565b5f61048d848484610941565b8360601b33602052637f5e9f208117600c526034600c20805460018101156104ca57808511156104c4576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c208054808711156104f05763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610547848484610946565b600190509392505050565b5f6012905090565b5f8061056461094b565b90505f801b810361058157610577610386565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b6105f482826108af565b5050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b60606040518060400160405280600481526020017f4d4f434b00000000000000000000000000000000000000000000000000000000815250905090565b5f610673338484610941565b6387a211a2600c52335f526020600c2080548084111561069a5763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050506106eb338484610946565b6001905092915050565b5f6106fe61094b565b90505f801b810361071b57610711610386565b8051906020012090505b8442111561073057631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d51146108385763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b6108ba5f8383610941565b6805345cdf77eb68f44c54818101818110156108dd5763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350505061093d5f8383610946565b5050565b505050565b505050565b5f90565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6109918261094f565b61099b8185610959565b93506109ab818560208601610969565b6109b481610977565b840191505092915050565b5f6020820190508181035f8301526109d78184610987565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a0c826109e3565b9050919050565b610a1c81610a02565b8114610a26575f80fd5b50565b5f81359050610a3781610a13565b92915050565b5f819050919050565b610a4f81610a3d565b8114610a59575f80fd5b50565b5f81359050610a6a81610a46565b92915050565b5f8060408385031215610a8657610a856109df565b5b5f610a9385828601610a29565b9250506020610aa485828601610a5c565b9150509250929050565b5f8115159050919050565b610ac281610aae565b82525050565b5f602082019050610adb5f830184610ab9565b92915050565b610aea81610a3d565b82525050565b5f602082019050610b035f830184610ae1565b92915050565b5f805f60608486031215610b2057610b1f6109df565b5b5f610b2d86828701610a29565b9350506020610b3e86828701610a29565b9250506040610b4f86828701610a5c565b9150509250925092565b5f60ff82169050919050565b610b6e81610b59565b82525050565b5f602082019050610b875f830184610b65565b92915050565b5f819050919050565b610b9f81610b8d565b82525050565b5f602082019050610bb85f830184610b96565b92915050565b5f60208284031215610bd357610bd26109df565b5b5f610be084828501610a29565b91505092915050565b610bf281610b59565b8114610bfc575f80fd5b50565b5f81359050610c0d81610be9565b92915050565b610c1c81610b8d565b8114610c26575f80fd5b50565b5f81359050610c3781610c13565b92915050565b5f805f805f805f60e0888a031215610c5857610c576109df565b5b5f610c658a828b01610a29565b9750506020610c768a828b01610a29565b9650506040610c878a828b01610a5c565b9550506060610c988a828b01610a5c565b9450506080610ca98a828b01610bff565b93505060a0610cba8a828b01610c29565b92505060c0610ccb8a828b01610c29565b91505092959891949750929550565b5f8060408385031215610cf057610cef6109df565b5b5f610cfd85828601610a29565b9250506020610d0e85828601610a29565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610d4f82610a3d565b9150610d5a83610a3d565b925082610d6a57610d69610d18565b5b828204905092915050565b7f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e657921000000005f82015250565b5f610da9601c83610959565b9150610db482610d75565b602082019050919050565b5f6020820190508181035f830152610dd681610d9d565b905091905056fea2646970667358221220a588f9f821e157f856641e8171dc78ec959e3c73080238aa8696355fc5d4a5d064736f6c634300081a0033";class it extends T.Deployable{async balanceOf(e,t){return await Jt(this._config,{address:this.assertValidAddress(),args:[e],...t})}async allowance(e,t,a){return await Gt(this._config,{address:this.assertValidAddress(),args:[e,t],...a})}async approve(e,t,a){return await this.awaitResult(this.approveRaw(e,t,a))}async approveRaw(e,t,a){const{request:r,result:s}=await Xt(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Yt(this._config,r),result:s}}async mint(e,t,a){return await this.awaitResult(this.mintRaw(e,t,a))}async mintRaw(e,t,a){const{request:r,result:s}=await en(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Qt(this._config,r),result:s}}async mintPayable(e,t,a){return await this.awaitResult(this.mintPayableRaw(e,t,a))}async mintPayableRaw(e,t,a){const{request:r,result:s}=await tn(this._config,{address:this.assertValidAddress(),args:[e,t],...this.optionallyAttachAccount(),...a});return{hash:await Kt(this._config,r),result:s}}buildParameters(e={},t){const[,a]=this.validateDeploymentConfig(e,t);return{abi:z,bytecode:nn,...this.optionallyAttachAccount(a.account)}}}const an=[{account:"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",key:"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",key:"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"},{account:"0x90F79bf6EB2c4f870365E785982E1f101E93b906",key:"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6"},{account:"0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",key:"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"},{account:"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",key:"0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"},{account:"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",key:"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"}].map(n=>({...n,privateKey:S.privateKeyToAccount(n.key)}));var _;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const s={};for(const i of r)s[i]=i;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of s)i[o]=r[o];return n.objectValues(i)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&s.push(i);return s},n.find=(r,s)=>{for(const i of r)if(s(i))return i},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function a(r,s=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}n.joinValues=a,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(_||(_={}));var De;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(De||(De={}));const h=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),U=n=>{switch(typeof n){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(n)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(n)?h.array:n===null?h.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?h.promise:typeof Map<"u"&&n instanceof Map?h.map:typeof Set<"u"&&n instanceof Set?h.set:typeof Date<"u"&&n instanceof Date?h.date:h.object;default:return h.unknown}},d=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rn=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class R extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},a={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)a._errors.push(t(i));else{let o=a,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return r(this),a}static assert(e){if(!(e instanceof R))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}R.create=n=>new R(n);const ne=(n,e)=>{let t;switch(n.code){case d.invalid_type:n.received===h.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,_.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(n.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(n.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(n.options)}, received '${n.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:_.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case d.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case d.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(n)}return{message:t}};let ot=ne;function sn(n){ot=n}function Te(){return ot}const Ce=n=>{const{data:e,path:t,errorMaps:a,issueData:r}=n,s=[...t,...r.path||[]],i={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let o="";const u=a.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...r,path:s,message:o}},on=[];function f(n,e){const t=Te(),a=Ce({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===ne?void 0:ne].filter(r=>!!r)});n.common.issues.push(a)}class E{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const r of t){if(r.status==="aborted")return b;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const r of t){const s=await r.key,i=await r.value;a.push({key:s,value:i})}return E.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const r of t){const{key:s,value:i}=r;if(s.status==="aborted"||i.status==="aborted")return b;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(a[s.value]=i.value)}return{status:e.value,value:a}}}const b=Object.freeze({status:"aborted"}),ee=n=>({status:"dirty",value:n}),N=n=>({status:"valid",value:n}),Ve=n=>n.status==="aborted",Be=n=>n.status==="dirty",oe=n=>n.status==="valid",ce=n=>typeof Promise<"u"&&n instanceof Promise;function Se(n,e,t,a){if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function ct(n,e,t,a,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}var p;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(p||(p={}));var se,ie;class P{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xe=(n,e)=>{if(oe(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new R(n.common.issues);return this._error=t,this._error}}};function g(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:r}=n;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{var u,c;const{message:m}=n;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:(u=m??a)!==null&&u!==void 0?u:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=m??t)!==null&&c!==void 0?c:o.defaultError}},description:r}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return U(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:U(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E,ctx:{common:e.parent.common,data:e.data,parsedType:U(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ce(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const r={common:{issues:[],async:(a=t==null?void 0:t.async)!==null&&a!==void 0?a:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:U(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Xe(r,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:U(e)},r=this._parse({data:e,path:a.path,parent:a}),s=await(ce(r)?r:Promise.resolve(r));return Xe(a,s)}refine(e,t){const a=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const i=e(r),o=()=>s.addIssue({code:d.custom,...a(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof t=="function"?t(a,r):t),!1))}_refinement(e){return new j({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return M.create(this,this._def)}nullable(){return H.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this,this._def)}promise(){return re.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return he.create(this,e,this._def)}transform(e){return new j({...g(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ge({...g(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new Fe({typeName:y.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ve({...g(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return _e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cn=/^c[^\s-]{8,}$/i,dn=/^[0-9a-z]+$/,un=/^[0-9A-HJKMNP-TV-Z]{26}$/,ln=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fn=/^[a-z0-9_-]{21}$/i,hn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Me;const yn=/^(?:(?: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])$/,bn=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,gn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt="((\\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])))",vn=new RegExp(`^${dt}$`);function ut(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function _n(n){return new RegExp(`^${ut(n)}$`)}function lt(n){let e=`${dt}T${ut(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xn(n,e){return!!((e==="v4"||!e)&&yn.test(n)||(e==="v6"||!e)&&bn.test(n))}class O extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.string,received:s.parsedType}),b}const a=new E;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?f(r,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&f(r,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")pn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"email",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Me||(Me=new RegExp(mn,"u")),Me.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"emoji",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")ln.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"uuid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")fn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"nanoid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")cn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")dn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid2",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")un.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ulid",code:d.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),f(r,{validation:"url",code:d.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"regex",code:d.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?lt(s).test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?vn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?_n(s).test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{code:d.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?hn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"duration",code:d.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?xn(e.data,s.version)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ip",code:d.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?gn.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"base64",code:d.invalid_string,message:s.message}),a.dirty()):_.assertNever(s);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(r=>e.test(r),{validation:t,code:d.invalid_string,...p.errToObj(a)})}_addCheck(e){return new O({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}datetime(e){var t,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!1,...p.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...p.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...p.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...p.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...p.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...p.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...p.errToObj(t)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new O({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}O.create=n=>{var e;return new O({checks:[],typeName:y.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...g(n)})};function wn(n,e){const t=(n.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=t>a?t:a,s=parseInt(n.toFixed(r).replace(".","")),i=parseInt(e.toFixed(r).replace(".",""));return s%i/Math.pow(10,r)}class q extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.number){const s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.number,received:s.parsedType}),b}let a;const r=new E;for(const s of this._def.checks)s.kind==="int"?_.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?wn(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_finite,message:s.message}),r.dirty()):_.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,a,r){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}q.create=n=>new q({checks:[],typeName:y.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...g(n)});class W extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){const s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.bigint,received:s.parsedType}),b}let a;const r=new E;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):_.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,a,r){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}W.create=n=>{var e;return new W({checks:[],typeName:y.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...g(n)})};class de extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.boolean,received:a.parsedType}),b}return N(e.data)}}de.create=n=>new de({typeName:y.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...g(n)});class Y extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.date,received:s.parsedType}),b}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_date}),b}const a=new E;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):_.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Y.create=n=>new Y({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:y.ZodDate,...g(n)});class Ie extends v{_parse(e){if(this._getType(e)!==h.symbol){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.symbol,received:a.parsedType}),b}return N(e.data)}}Ie.create=n=>new Ie({typeName:y.ZodSymbol,...g(n)});class ue extends v{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.undefined,received:a.parsedType}),b}return N(e.data)}}ue.create=n=>new ue({typeName:y.ZodUndefined,...g(n)});class le extends v{_parse(e){if(this._getType(e)!==h.null){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.null,received:a.parsedType}),b}return N(e.data)}}le.create=n=>new le({typeName:y.ZodNull,...g(n)});class ae extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return N(e.data)}}ae.create=n=>new ae({typeName:y.ZodAny,...g(n)});class G extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return N(e.data)}}G.create=n=>new G({typeName:y.ZodUnknown,...g(n)});class L extends v{_parse(e){const t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:h.never,received:t.parsedType}),b}}L.create=n=>new L({typeName:y.ZodNever,...g(n)});class Ae extends v{_parse(e){if(this._getType(e)!==h.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.void,received:a.parsedType}),b}return N(e.data)}}Ae.create=n=>new Ae({typeName:y.ZodVoid,...g(n)});class Z extends v{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),r=this._def;if(t.parsedType!==h.array)return f(t,{code:d.invalid_type,expected:h.array,received:t.parsedType}),b;if(r.exactLength!==null){const i=t.data.length>r.exactLength.value,o=t.data.length<r.exactLength.value;(i||o)&&(f(t,{code:i?d.too_big:d.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(f(t,{code:d.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(f(t,{code:d.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>r.type._parseAsync(new P(t,i,t.path,o)))).then(i=>E.mergeArray(a,i));const s=[...t.data].map((i,o)=>r.type._parseSync(new P(t,i,t.path,o)));return E.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new Z({...this._def,minLength:{value:e,message:p.toString(t)}})}max(e,t){return new Z({...this._def,maxLength:{value:e,message:p.toString(t)}})}length(e,t){return new Z({...this._def,exactLength:{value:e,message:p.toString(t)}})}nonempty(e){return this.min(1,e)}}Z.create=(n,e)=>new Z({type:n,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...g(e)});function X(n){if(n instanceof k){const e={};for(const t in n.shape){const a=n.shape[t];e[t]=M.create(X(a))}return new k({...n._def,shape:()=>e})}else return n instanceof Z?new Z({...n._def,type:X(n.element)}):n instanceof M?M.create(X(n.unwrap())):n instanceof H?H.create(X(n.unwrap())):n instanceof $?$.create(n.items.map(e=>X(e))):n}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const c=this._getOrReturnCtx(e);return f(c,{code:d.invalid_type,expected:h.object,received:c.parsedType}),b}const{status:a,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const m=s[c],I=r.data[c];u.push({key:{status:"valid",value:c},value:m._parse(new P(r,I,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof L){const c=this._def.unknownKeys;if(c==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(c==="strict")o.length>0&&(f(r,{code:d.unrecognized_keys,keys:o}),a.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const m of o){const I=r.data[m];u.push({key:{status:"valid",value:m},value:c._parse(new P(r,I,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const m of u){const I=await m.key,K=await m.value;c.push({key:I,value:K,alwaysSet:m.alwaysSet})}return c}).then(c=>E.mergeObjectSync(a,c)):E.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var r,s,i,o;const u=(i=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,a).message)!==null&&i!==void 0?i:a.defaultError;return t.code==="unrecognized_keys"?{message:(o=p.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};return _.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])}),new k({...this._def,shape:()=>t})}omit(e){const t={};return _.objectKeys(this.shape).forEach(a=>{e[a]||(t[a]=this.shape[a])}),new k({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};return _.objectKeys(this.shape).forEach(a=>{const r=this.shape[a];e&&!e[a]?t[a]=r:t[a]=r.optional()}),new k({...this._def,shape:()=>t})}required(e){const t={};return _.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])t[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof M;)s=s._def.innerType;t[a]=s}}),new k({...this._def,shape:()=>t})}keyof(){return ft(_.objectKeys(this.shape))}}k.create=(n,e)=>new k({shape:()=>n,unknownKeys:"strip",catchall:L.create(),typeName:y.ZodObject,...g(e)});k.strictCreate=(n,e)=>new k({shape:()=>n,unknownKeys:"strict",catchall:L.create(),typeName:y.ZodObject,...g(e)});k.lazycreate=(n,e)=>new k({shape:n,unknownKeys:"strip",catchall:L.create(),typeName:y.ZodObject,...g(e)});class fe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function r(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new R(o.ctx.common.issues));return f(t,{code:d.invalid_union,unionErrors:i}),b}if(t.common.async)return Promise.all(a.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(r);{let s;const i=[];for(const u of a){const c={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(u=>new R(u));return f(t,{code:d.invalid_union,unionErrors:o}),b}}get options(){return this._def.options}}fe.create=(n,e)=>new fe({options:n,typeName:y.ZodUnion,...g(e)});const B=n=>n instanceof me?B(n.schema):n instanceof j?B(n.innerType()):n instanceof ye?[n.value]:n instanceof F?n.options:n instanceof be?_.objectValues(n.enum):n instanceof ge?B(n._def.innerType):n instanceof ue?[void 0]:n instanceof le?[null]:n instanceof M?[void 0,...B(n.unwrap())]:n instanceof H?[null,...B(n.unwrap())]:n instanceof Fe||n instanceof _e?B(n.unwrap()):n instanceof ve?B(n._def.innerType):[];class Oe extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return f(t,{code:d.invalid_type,expected:h.object,received:t.parsedType}),b;const a=this.discriminator,r=t.data[a],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(f(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const r=new Map;for(const s of t){const i=B(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,s)}}return new Oe({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...g(a)})}}function Le(n,e){const t=U(n),a=U(e);if(n===e)return{valid:!0,data:n};if(t===h.object&&a===h.object){const r=_.objectKeys(e),s=_.objectKeys(n).filter(o=>r.indexOf(o)!==-1),i={...n,...e};for(const o of s){const u=Le(n[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===h.array&&a===h.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<n.length;s++){const i=n[s],o=e[s],u=Le(i,o);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return t===h.date&&a===h.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class he extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=(s,i)=>{if(Ve(s)||Ve(i))return b;const o=Le(s.value,i.value);return o.valid?((Be(s)||Be(i))&&t.dirty(),{status:t.value,value:o.data}):(f(a,{code:d.invalid_intersection_types}),b)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,i])=>r(s,i)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}he.create=(n,e,t)=>new he({left:n,right:e,typeName:y.ZodIntersection,...g(t)});class $ extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.array)return f(a,{code:d.invalid_type,expected:h.array,received:a.parsedType}),b;if(a.data.length<this._def.items.length)return f(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&a.data.length>this._def.items.length&&(f(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new P(a,i,a.path,o)):null}).filter(i=>!!i);return a.common.async?Promise.all(s).then(i=>E.mergeArray(t,i)):E.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $({...this._def,rest:e})}}$.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:n,typeName:y.ZodTuple,rest:null,...g(e)})};class pe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.object)return f(a,{code:d.invalid_type,expected:h.object,received:a.parsedType}),b;const r=[],s=this._def.keyType,i=this._def.valueType;for(const o in a.data)r.push({key:s._parse(new P(a,o,a.path,o)),value:i._parse(new P(a,a.data[o],a.path,o)),alwaysSet:o in a.data});return a.common.async?E.mergeObjectAsync(t,r):E.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof v?new pe({keyType:e,valueType:t,typeName:y.ZodRecord,...g(a)}):new pe({keyType:O.create(),valueType:e,typeName:y.ZodRecord,...g(t)})}}class Ee extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.map)return f(a,{code:d.invalid_type,expected:h.map,received:a.parsedType}),b;const r=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map(([o,u],c)=>({key:r._parse(new P(a,o,a.path,[c,"key"])),value:s._parse(new P(a,u,a.path,[c,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,m=await u.value;if(c.status==="aborted"||m.status==="aborted")return b;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,m=u.value;if(c.status==="aborted"||m.status==="aborted")return b;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}}}}Ee.create=(n,e,t)=>new Ee({valueType:e,keyType:n,typeName:y.ZodMap,...g(t)});class Q extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.set)return f(a,{code:d.invalid_type,expected:h.set,received:a.parsedType}),b;const r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(f(a,{code:d.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(f(a,{code:d.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function i(u){const c=new Set;for(const m of u){if(m.status==="aborted")return b;m.status==="dirty"&&t.dirty(),c.add(m.value)}return{status:t.value,value:c}}const o=[...a.data.values()].map((u,c)=>s._parse(new P(a,u,a.path,c)));return a.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new Q({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new Q({...this._def,maxSize:{value:e,message:p.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(n,e)=>new Q({valueType:n,minSize:null,maxSize:null,typeName:y.ZodSet,...g(e)});class te extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return f(t,{code:d.invalid_type,expected:h.function,received:t.parsedType}),b;function a(o,u){return Ce({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Te(),ne].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:u}})}function r(o,u){return Ce({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Te(),ne].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof re){const o=this;return N(async function(...u){const c=new R([]),m=await o._def.args.parseAsync(u,s).catch(A=>{throw c.addIssue(a(u,A)),c}),I=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(I,s).catch(A=>{throw c.addIssue(r(I,A)),c})})}else{const o=this;return N(function(...u){const c=o._def.args.safeParse(u,s);if(!c.success)throw new R([a(u,c.error)]);const m=Reflect.apply(i,this,c.data),I=o._def.returns.safeParse(m,s);if(!I.success)throw new R([r(m,I.error)]);return I.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new te({...this._def,args:$.create(e).rest(G.create())})}returns(e){return new te({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new te({args:e||$.create([]).rest(G.create()),returns:t||G.create(),typeName:y.ZodFunction,...g(a)})}}class me extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}me.create=(n,e)=>new me({getter:n,typeName:y.ZodLazy,...g(e)});class ye extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}ye.create=(n,e)=>new ye({value:n,typeName:y.ZodLiteral,...g(e)});function ft(n,e){return new F({values:n,typeName:y.ZodEnum,...g(e)})}class F extends v{constructor(){super(...arguments),se.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{expected:_.joinValues(a),received:t.parsedType,code:d.invalid_type}),b}if(Se(this,se)||ct(this,se,new Set(this._def.values)),!Se(this,se).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{received:t.data,code:d.invalid_enum_value,options:a}),b}return N(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return F.create(e,{...this._def,...t})}exclude(e,t=this._def){return F.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}se=new WeakMap;F.create=ft;class be extends v{constructor(){super(...arguments),ie.set(this,void 0)}_parse(e){const t=_.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==h.string&&a.parsedType!==h.number){const r=_.objectValues(t);return f(a,{expected:_.joinValues(r),received:a.parsedType,code:d.invalid_type}),b}if(Se(this,ie)||ct(this,ie,new Set(_.getValidEnumValues(this._def.values))),!Se(this,ie).has(e.data)){const r=_.objectValues(t);return f(a,{received:a.data,code:d.invalid_enum_value,options:r}),b}return N(e.data)}get enum(){return this._def.values}}ie=new WeakMap;be.create=(n,e)=>new be({values:n,typeName:y.ZodNativeEnum,...g(e)});class re extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return f(t,{code:d.invalid_type,expected:h.promise,received:t.parsedType}),b;const a=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return N(a.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(n,e)=>new re({type:n,typeName:y.ZodPromise,...g(e)});class j extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:i=>{f(a,i),i.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const i=r.transform(a.data,s);if(a.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return b;const u=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return u.status==="aborted"?b:u.status==="dirty"||t.value==="dirty"?ee(u.value):u});{if(t.value==="aborted")return b;const o=this._def.schema._parseSync({data:i,path:a.path,parent:a});return o.status==="aborted"?b:o.status==="dirty"||t.value==="dirty"?ee(o.value):o}}if(r.type==="refinement"){const i=o=>{const u=r.refinement(o,s);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){const i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!oe(i))return i;const o=r.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>oe(i)?Promise.resolve(r.transform(i.value,s)).then(o=>({status:t.value,value:o})):i);_.assertNever(r)}}j.create=(n,e,t)=>new j({schema:n,typeName:y.ZodEffects,effect:e,...g(t)});j.createWithPreprocess=(n,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:n},typeName:y.ZodEffects,...g(t)});class M extends v{_parse(e){return this._getType(e)===h.undefined?N(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(n,e)=>new M({innerType:n,typeName:y.ZodOptional,...g(e)});class H extends v{_parse(e){return this._getType(e)===h.null?N(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}H.create=(n,e)=>new H({innerType:n,typeName:y.ZodNullable,...g(e)});class ge extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ge.create=(n,e)=>new ge({innerType:n,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ve extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ce(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new R(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new R(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ve.create=(n,e)=>new ve({innerType:n,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class Ne extends v{_parse(e){if(this._getType(e)!==h.nan){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.nan,received:a.parsedType}),b}return{status:"valid",value:e.data}}}Ne.create=n=>new Ne({typeName:y.ZodNaN,...g(n)});const kn=Symbol("zod_brand");class Fe extends v{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends v{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?b:s.status==="dirty"?(t.dirty(),ee(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?b:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,t){return new xe({in:e,out:t,typeName:y.ZodPipeline})}}class _e extends v{_parse(e){const t=this._def.innerType._parse(e),a=r=>(oe(r)&&(r.value=Object.freeze(r.value)),r);return ce(t)?t.then(r=>a(r)):a(t)}unwrap(){return this._def.innerType}}_e.create=(n,e)=>new _e({innerType:n,typeName:y.ZodReadonly,...g(e)});function ht(n,e={},t){return n?ae.create().superRefine((a,r)=>{var s,i;if(!n(a)){const o=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,u=(i=(s=o.fatal)!==null&&s!==void 0?s:t)!==null&&i!==void 0?i:!0,c=typeof o=="string"?{message:o}:o;r.addIssue({code:"custom",...c,fatal:u})}}):ae.create()}const Tn={object:k.lazycreate};var y;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(y||(y={}));const Cn=(n,e={message:`Input not instance of ${n.name}`})=>ht(t=>t instanceof n,e),pt=O.create,mt=q.create,Sn=Ne.create,In=W.create,yt=de.create,An=Y.create,En=Ie.create,Nn=ue.create,Rn=le.create,On=ae.create,Zn=G.create,jn=L.create,Mn=Ae.create,Pn=Z.create,$n=k.create,Dn=k.strictCreate,Vn=fe.create,Bn=Oe.create,Ln=he.create,zn=$.create,Un=pe.create,qn=Ee.create,Wn=Q.create,Fn=te.create,Hn=me.create,Gn=ye.create,Jn=F.create,Yn=be.create,Qn=re.create,et=j.create,Kn=M.create,Xn=H.create,ea=j.createWithPreprocess,ta=xe.create,na=()=>pt().optional(),aa=()=>mt().optional(),ra=()=>yt().optional(),sa={string:n=>O.create({...n,coerce:!0}),number:n=>q.create({...n,coerce:!0}),boolean:n=>de.create({...n,coerce:!0}),bigint:n=>W.create({...n,coerce:!0}),date:n=>Y.create({...n,coerce:!0})},ia=b;var l=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:sn,getErrorMap:Te,makeIssue:Ce,EMPTY_PATH:on,addIssueToContext:f,ParseStatus:E,INVALID:b,DIRTY:ee,OK:N,isAborted:Ve,isDirty:Be,isValid:oe,isAsync:ce,get util(){return _},get objectUtil(){return De},ZodParsedType:h,getParsedType:U,ZodType:v,datetimeRegex:lt,ZodString:O,ZodNumber:q,ZodBigInt:W,ZodBoolean:de,ZodDate:Y,ZodSymbol:Ie,ZodUndefined:ue,ZodNull:le,ZodAny:ae,ZodUnknown:G,ZodNever:L,ZodVoid:Ae,ZodArray:Z,ZodObject:k,ZodUnion:fe,ZodDiscriminatedUnion:Oe,ZodIntersection:he,ZodTuple:$,ZodRecord:pe,ZodMap:Ee,ZodSet:Q,ZodFunction:te,ZodLazy:me,ZodLiteral:ye,ZodEnum:F,ZodNativeEnum:be,ZodPromise:re,ZodEffects:j,ZodTransformer:j,ZodOptional:M,ZodNullable:H,ZodDefault:ge,ZodCatch:ve,ZodNaN:Ne,BRAND:kn,ZodBranded:Fe,ZodPipeline:xe,ZodReadonly:_e,custom:ht,Schema:v,ZodSchema:v,late:Tn,get ZodFirstPartyTypeKind(){return y},coerce:sa,any:On,array:Pn,bigint:In,boolean:yt,date:An,discriminatedUnion:Bn,effect:et,enum:Jn,function:Fn,instanceof:Cn,intersection:Ln,lazy:Hn,literal:Gn,map:qn,nan:Sn,nativeEnum:Yn,never:jn,null:Rn,nullable:Xn,number:mt,object:$n,oboolean:ra,onumber:aa,optional:Kn,ostring:na,pipeline:ta,preprocess:ea,promise:Qn,record:Un,set:Wn,strictObject:Dn,string:pt,symbol:En,transformer:et,tuple:zn,undefined:Nn,union:Vn,unknown:Zn,void:Mn,NEVER:ia,ZodIssueCode:d,quotelessJson:rn,ZodError:R});const oa="test test test test test test test test test test test junk",ca=async function(e,t){const a=t.privateKey,r=t.mnemonic??oa,s=t.chain||"anvil",[{config:i,account:o},u]=S.getDeployableOptions({chain:s,rpcUrl:t.rpcUrl,privateKey:a,mnemonic:r}),c=u.id;if(e.at(0)==="generate")return Zt({account:o==null?void 0:o.address,chainId:c});if(e.at(0)==="erc20"){let C=new it({config:i,account:o},{});return await C.deploy(),{erc20:C.assertValidAddress()}}const m=T.BOOST_REGISTRY_ADDRESSES[c];if(!m)throw new Error(`Unable to select a deployed BoostRegistry with chain ID ${c}`);const I=new T.BoostRegistry({config:i,account:o,address:m}),K=T.BOOST_CORE_ADDRESSES[c];if(!K)throw new Error(`Unable to select a deployed BoostCore with chain ID ${c}`);const A=new T.BoostCore({config:i,account:o,address:K});if(!e.length)throw new Error("No seed provided");const jt=await Promise.all(e.map(da));let je,He;const Ge=[];for(const C of jt){let D;if(typeof C.budget=="string"&&S.isAddress(C.budget))D=A.ManagedBudget(C.budget);else if(Pe(He,C.budget)&&je)D=je;else{const x={...C.budget,authorized:[...C.budget.authorized,K],roles:[...C.budget.roles,T.Roles.MANAGER]};D=await I.initialize(crypto.randomUUID(),A.ManagedBudget(x)),je=D,He=C.budget}const Mt=C.incentives.map(async x=>{let V=0n;switch(x.type){case"AllowListIncentive":return A.AllowListIncentive(x);case"PointsIncentive":return A.PointsIncentive(x);case"ERC20Incentive":return x.strategy===T.StrategyType.RAFFLE&&(V+=x.reward),x.strategy===T.StrategyType.POOL&&(V+=x.reward*x.limit),x.shouldMintAndAllocate&&await we(D,V,x.asset,{config:i,account:o}),A.ERC20Incentive(x);case"ERC20VariableCriteriaIncentive":return V+=x.limit,x.shouldMintAndAllocate&&await we(D,V,x.asset,{config:i,account:o}),A.ERC20VariableCriteriaIncentive(x);case"ERC20VariableIncentive":return V+=x.limit,x.shouldMintAndAllocate&&await we(D,V,x.asset,{config:i,account:o}),A.ERC20VariableIncentive(x);case"CGDAIncentive":return V+=x.totalBudget,x.shouldMintAndAllocate&&await we(D,V,x.asset,{config:i,account:o}),A.CGDAIncentive(x)}}),Pt=await Promise.all(Mt),Je={protocolFee:C.protocolFee,maxParticipants:C.maxParticipants,budget:D,action:A.EventAction(C.action),allowList:await fa(C,{core:A}),incentives:Pt};C.validator&&(Je.validator=A.SignerValidator(C.validator));const $t=await A.createBoost(Je);Ge.push($t.id.toString())}return{boostIds:Ge}};async function we(n,e,t,a){if(t&&e){let r=new it(a,t);await ha(a,r,n,tt(e.toString()))}}async function da(n){const e=await Dt.readFile(Vt.normalize(n),{encoding:"utf8"});return Ot.parse(JSON.parse(e))}const ua=l.custom(S.isHex,"invalid Hex payload"),w=l.string().transform((n,e)=>(/^0x[a-fA-F0-9]{40}$/.test(n)||e.addIssue({code:l.ZodIssueCode.custom,message:`Invalid Address ${n}`}),n)).pipe(l.custom(S.isAddress,"invalid eth address")),la=l.coerce.number().min(1).max(2).transform(BigInt).pipe(l.custom()),bt=l.object({type:l.literal("ManagedBudget"),owner:w,authorized:l.array(w),roles:l.array(la)}).refine(n=>n.authorized.length===n.roles.length,"length mismatch authorized and roles"),Ze=l.custom().pipe(l.string().regex(/^(event|function) .*/,{message:"signature must start with `event` or function`"}).transform(n=>{if(n.startsWith("function"))return S.pad(S.toFunctionSelector(n));if(n.startsWith("event"))return S.toEventSelector(n);throw new Error("unreachable")})),gt=l.object({signatureType:l.nativeEnum(T.SignatureType),signature:Ze,fieldIndex:l.number().nonnegative(),targetContract:w,chainid:l.number().nonnegative()}),vt=l.object({filterType:l.nativeEnum(T.FilterType),fieldType:l.nativeEnum(T.PrimitiveType),fieldIndex:l.number().nonnegative(),filterData:ua}),_t=l.object({signature:Ze,signatureType:l.nativeEnum(T.SignatureType),actionType:l.number().optional(),targetContract:w,chainid:l.number().nonnegative(),actionParameter:vt}),xt=l.object({type:l.literal("EventAction"),actionClaimant:gt,actionSteps:l.array(_t).max(4)}),wt=l.object({type:l.literal("SignerValidator"),signers:l.array(w),validatorCaller:w}),kt=l.object({type:l.literal("SimpleDenyList"),owner:w,denied:l.array(w)}),Tt=l.object({type:l.literal("SimpleAllowList"),owner:w,allowed:l.array(w)}),Ct=l.object({type:l.literal("AllowListIncentive"),allowList:w,limit:l.coerce.bigint()}),St=l.object({type:l.literal("ERC20Incentive"),asset:w,shouldMintAndAllocate:l.boolean().optional().default(!1),strategy:l.nativeEnum(T.StrategyType),reward:l.coerce.bigint(),limit:l.coerce.bigint(),manager:w.optional()}),It=l.object({type:l.literal("ERC20VariableIncentive"),asset:w,shouldMintAndAllocate:l.boolean().optional().default(!1),reward:l.coerce.bigint(),limit:l.coerce.bigint(),manager:w}),At=l.object({criteriaType:l.nativeEnum(T.SignatureType),signature:Ze,fieldIndex:l.number().nonnegative(),targetContract:w}),Et=l.object({type:l.literal("ERC20VariableCriteriaIncentive"),asset:w,shouldMintAndAllocate:l.boolean().optional().default(!1),reward:l.coerce.bigint(),limit:l.coerce.bigint(),manager:w.optional(),criteria:At}),Nt=l.object({type:l.literal("CGDAIncentive"),asset:w,shouldMintAndAllocate:l.boolean().optional().default(!1),initialReward:l.coerce.bigint(),rewardDecay:l.coerce.bigint(),rewardBoost:l.coerce.bigint(),totalBudget:l.coerce.bigint(),manager:w}),Rt=l.object({type:l.literal("PointsIncentive"),venue:w,selector:Ze,reward:l.coerce.bigint(),limit:l.coerce.bigint()}),Ot=l.object({protocolFee:l.coerce.bigint(),maxParticipants:l.coerce.bigint(),budget:l.union([w,bt]),action:l.union([w,xt]),validator:l.union([w,wt]).optional(),allowList:l.union([w,kt,Tt]).optional(),incentives:l.array(l.union([Ct,St,Et,It,Nt,Rt]))});async function fa({allowList:n},{core:e}){if(!n)return e.OpenAllowList();if(typeof n=="string"&&S.isAddress(n))return await T.allowListFromAddress({config:e._config,account:e._account},n);switch(n.type){case"SimpleAllowList":return e.SimpleAllowList(n);case"SimpleDenyList":return e.SimpleDenyList(n);default:throw new Error("unusupported AllowList: "+n)}}async function ha(n,e,t,a=tt("110")){return await e.mint(n.account.address,a),await e.approve(t.assertValidAddress(),a),await t.allocate({amount:a,asset:e.assertValidAddress(),target:n.account.address}),{budget:t,erc20:e}}function Zt({asset:n="0xf3B2d0E4f2d8F453DBCc278b10e88b20d7f19f8D",account:e=an[0].account,chainId:t}){return{protocolFee:0n,maxParticipants:10n,budget:{type:"ManagedBudget",owner:e,authorized:[e],roles:[T.Roles.MANAGER]},action:{type:"EventAction",actionClaimant:{signatureType:T.SignatureType.FUNC,signature:"function mint(address to, uint256 amount)",fieldIndex:0,targetContract:Ye,chainid:t},actionSteps:[{signature:"event Minted(address to, uint256 amount)",signatureType:T.SignatureType.FUNC,actionType:0,targetContract:Ye,chainid:t,actionParameter:{filterType:T.FilterType.EQUAL,fieldType:T.PrimitiveType.ADDRESS,fieldIndex:0,filterData:e}}]},validator:{type:"SignerValidator",signers:[e],validatorCaller:e},allowList:{type:"SimpleDenyList",owner:e,denied:[]},incentives:[{type:"ERC20Incentive",asset:n,shouldMintAndAllocate:!1,strategy:0,reward:1n,limit:1n,manager:e}]}}exports.ActionClaimantSchema=gt;exports.ActionStepCriteriaSchema=vt;exports.ActionStepSchema=_t;exports.AllowListIncentiveSchema=Ct;exports.BoostSeedConfigSchema=Ot;exports.CGDAIncentiveSchema=Nt;exports.ERC20IncentiveSchema=St;exports.ERC20VariableCriteriaIncentiveSchema=Et;exports.ERC20VariableIncentiveSchema=It;exports.EventActionSchema=xt;exports.IncentiveCriteriaSchema=At;exports.ManagedBudgetSchema=bt;exports.PointsIncentiveSchema=Rt;exports.SignerValidatorSchema=wt;exports.SimpleAllowListSchema=Tt;exports.SimpleDenyListSchema=kt;exports.makeSeed=Zt;exports.seed=ca;
|