@boostxyz/cli 3.0.0 → 4.0.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.
@@ -1,2 +1,2 @@
1
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 Je="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 Oe(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 H 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 H?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,s=t.cause instanceof H&&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 H{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Ft extends H{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 Wt extends H{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 Yt extends H{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 Yt({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 Wt({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 Ft({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=Oe(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 Ke(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=Oe(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return Ke(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>Ke(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 rt(n,{account:t,chainId:a,connector:r});const{connector:u}=Oe(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 Fe(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=ze(e),s=Oe(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 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"}),Ht=st({abi:z,functionName:"balanceOf"}),Jt=Fe({abi:z,functionName:"approve"}),Kt=Fe({abi:z,functionName:"mint"}),Qt=Fe({abi:z,functionName:"mintPayable"}),Xt=qe({abi:z,functionName:"approve"}),en=qe({abi:z,functionName:"mint"}),tn=qe({abi:z,functionName:"mintPayable"}),nn="0x6080604052348015600e575f80fd5b50610e138061001c5f395ff3fe6080604052600436106100dc575f3560e01c806340c10f191161007e57806395d89b411161005857806395d89b41146102bc578063a9059cbb146102e6578063d505accf14610322578063dd62ed3e1461034a576100dc565b806340c10f191461021c57806370a08231146102445780637ecebe0014610280576100dc565b806318160ddd116100ba57806318160ddd1461016257806323b872dd1461018c578063313ce567146101c85780633644e515146101f2576100dc565b806306fdde03146100e0578063095ea7b31461010a57806317d304b014610146575b5f80fd5b3480156100eb575f80fd5b506100f4610386565b60405161010191906109bf565b60405180910390f35b348015610115575f80fd5b50610130600480360381019061012b9190610a70565b6103c3565b60405161013d9190610ac8565b60405180910390f35b610160600480360381019061015b9190610a70565b610413565b005b34801561016d575f80fd5b50610176610470565b6040516101839190610af0565b60405180910390f35b348015610197575f80fd5b506101b260048036038101906101ad9190610b09565b610481565b6040516101bf9190610ac8565b60405180910390f35b3480156101d3575f80fd5b506101dc610552565b6040516101e99190610b74565b60405180910390f35b3480156101fd575f80fd5b5061020661055a565b6040516102139190610ba5565b60405180910390f35b348015610227575f80fd5b50610242600480360381019061023d9190610a70565b6105ea565b005b34801561024f575f80fd5b5061026a60048036038101906102659190610bbe565b6105f8565b6040516102779190610af0565b60405180910390f35b34801561028b575f80fd5b506102a660048036038101906102a19190610bbe565b610611565b6040516102b39190610af0565b60405180910390f35b3480156102c7575f80fd5b506102d061062a565b6040516102dd91906109bf565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190610a70565b610667565b6040516103199190610ac8565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190610c3d565b6106f5565b005b348015610355575f80fd5b50610370600480360381019061036b9190610cda565b610891565b60405161037d9190610af0565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f636b20455243323000000000000000000000000000000000000000000000815250905090565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b6064816104209190610d45565b341015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045990610dbf565b60405180910390fd5b61046c82826108af565b5050565b5f6805345cdf77eb68f44c54905090565b5f61048d848484610941565b8360601b33602052637f5e9f208117600c526034600c20805460018101156104ca57808511156104c4576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c208054808711156104f05763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610547848484610946565b600190509392505050565b5f6012905090565b5f8061056461094b565b90505f801b810361058157610577610386565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b6105f482826108af565b5050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b60606040518060400160405280600481526020017f4d4f434b00000000000000000000000000000000000000000000000000000000815250905090565b5f610673338484610941565b6387a211a2600c52335f526020600c2080548084111561069a5763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050506106eb338484610946565b6001905092915050565b5f6106fe61094b565b90505f801b810361071b57610711610386565b8051906020012090505b8442111561073057631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d51146108385763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b6108ba5f8383610941565b6805345cdf77eb68f44c54818101818110156108dd5763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350505061093d5f8383610946565b5050565b505050565b505050565b5f90565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6109918261094f565b61099b8185610959565b93506109ab818560208601610969565b6109b481610977565b840191505092915050565b5f6020820190508181035f8301526109d78184610987565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a0c826109e3565b9050919050565b610a1c81610a02565b8114610a26575f80fd5b50565b5f81359050610a3781610a13565b92915050565b5f819050919050565b610a4f81610a3d565b8114610a59575f80fd5b50565b5f81359050610a6a81610a46565b92915050565b5f8060408385031215610a8657610a856109df565b5b5f610a9385828601610a29565b9250506020610aa485828601610a5c565b9150509250929050565b5f8115159050919050565b610ac281610aae565b82525050565b5f602082019050610adb5f830184610ab9565b92915050565b610aea81610a3d565b82525050565b5f602082019050610b035f830184610ae1565b92915050565b5f805f60608486031215610b2057610b1f6109df565b5b5f610b2d86828701610a29565b9350506020610b3e86828701610a29565b9250506040610b4f86828701610a5c565b9150509250925092565b5f60ff82169050919050565b610b6e81610b59565b82525050565b5f602082019050610b875f830184610b65565b92915050565b5f819050919050565b610b9f81610b8d565b82525050565b5f602082019050610bb85f830184610b96565b92915050565b5f60208284031215610bd357610bd26109df565b5b5f610be084828501610a29565b91505092915050565b610bf281610b59565b8114610bfc575f80fd5b50565b5f81359050610c0d81610be9565b92915050565b610c1c81610b8d565b8114610c26575f80fd5b50565b5f81359050610c3781610c13565b92915050565b5f805f805f805f60e0888a031215610c5857610c576109df565b5b5f610c658a828b01610a29565b9750506020610c768a828b01610a29565b9650506040610c878a828b01610a5c565b9550506060610c988a828b01610a5c565b9450506080610ca98a828b01610bff565b93505060a0610cba8a828b01610c29565b92505060c0610ccb8a828b01610c29565b91505092959891949750929550565b5f8060408385031215610cf057610cef6109df565b5b5f610cfd85828601610a29565b9250506020610d0e85828601610a29565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610d4f82610a3d565b9150610d5a83610a3d565b925082610d6a57610d69610d18565b5b828204905092915050565b7f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e657921000000005f82015250565b5f610da9601c83610959565b9150610db482610d75565b602082019050919050565b5f6020820190508181035f830152610dd681610d9d565b905091905056fea264697066735822122014217224d57712700b62f2706b7c6ccac676419103ff9ccb6b43ece3d5b783f164736f6c634300081a0033";class it extends T.Deployable{async balanceOf(e,t){return await Ht(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 Jt(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 Kt(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 Qt(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 O 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 O))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()}}O.create=n=>new O(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 O(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 Y.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 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 R 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 R({...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 R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get 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}}R.create=n=>{var e;return new R({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 F 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 F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new F({...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}}F.create=n=>{var e;return new F({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 J 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 J({...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}}J.create=n=>new J({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 Y?Y.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,Q=await m.value;c.push({key:I,value:Q,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 O(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 O(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 W?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 Y?[null,...B(n.unwrap())]:n instanceof We||n instanceof _e?B(n.unwrap()):n instanceof ve?B(n._def.innerType):[];class Re 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 Re({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:R.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 K 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 K({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new K({...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)}}K.create=(n,e)=>new K({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 O([]),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 O([a(u,c.error)]);const m=Reflect.apply(i,this,c.data),I=o._def.returns.safeParse(m,s);if(!I.success)throw new O([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 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 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 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=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 Y extends v{_parse(e){return this._getType(e)===h.null?N(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Y.create=(n,e)=>new Y({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 O(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new O(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 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 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=R.create,mt=q.create,Sn=Ne.create,In=F.create,yt=de.create,An=J.create,En=Ie.create,Nn=ue.create,On=le.create,Rn=ae.create,Zn=G.create,jn=L.create,Mn=Ae.create,Pn=Z.create,$n=k.create,Dn=k.strictCreate,Vn=fe.create,Bn=Re.create,Ln=he.create,zn=$.create,Un=pe.create,qn=Ee.create,Fn=K.create,Wn=te.create,Yn=me.create,Gn=ye.create,Hn=W.create,Jn=be.create,Kn=re.create,et=j.create,Qn=M.create,Xn=Y.create,ea=j.createWithPreprocess,ta=xe.create,na=()=>pt().optional(),aa=()=>mt().optional(),ra=()=>yt().optional(),sa={string:n=>R.create({...n,coerce:!0}),number:n=>q.create({...n,coerce:!0}),boolean:n=>de.create({...n,coerce:!0}),bigint:n=>F.create({...n,coerce:!0}),date:n=>J.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:R,ZodNumber:q,ZodBigInt:F,ZodBoolean:de,ZodDate:J,ZodSymbol:Ie,ZodUndefined:ue,ZodNull:le,ZodAny:ae,ZodUnknown:G,ZodNever:L,ZodVoid:Ae,ZodArray:Z,ZodObject:k,ZodUnion:fe,ZodDiscriminatedUnion:Re,ZodIntersection:he,ZodTuple:$,ZodRecord:pe,ZodMap:Ee,ZodSet:K,ZodFunction:te,ZodLazy:me,ZodLiteral:ye,ZodEnum:W,ZodNativeEnum:be,ZodPromise:re,ZodEffects:j,ZodTransformer:j,ZodOptional:M,ZodNullable:Y,ZodDefault:ge,ZodCatch:ve,ZodNaN:Ne,BRAND:kn,ZodBranded:We,ZodPipeline:xe,ZodReadonly:_e,custom:ht,Schema:v,ZodSchema:v,late:Tn,get ZodFirstPartyTypeKind(){return y},coerce:sa,any:Rn,array:Pn,bigint:In,boolean:yt,date:An,discriminatedUnion:Bn,effect:et,enum:Hn,function:Wn,instanceof:Cn,intersection:Ln,lazy:Yn,literal:Gn,map:qn,nan:Sn,nativeEnum:Jn,never:jn,null:On,nullable:Xn,number:mt,object:$n,oboolean:ra,onumber:aa,optional:Qn,ostring:na,pipeline:ta,preprocess:ea,promise:Kn,record:Un,set:Fn,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:O});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}),Q=T.BOOST_CORE_ADDRESSES[c];if(!Q)throw new Error(`Unable to select a deployed BoostCore with chain ID ${c}`);const A=new T.BoostCore({config:i,account:o,address:Q});if(!e.length)throw new Error("No seed provided");const jt=await Promise.all(e.map(da));let je,Ye;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(Ye,C.budget)&&je)D=je;else{const x={...C.budget,authorized:[...C.budget.authorized,Q],roles:[...C.budget.roles,T.Roles.MANAGER]};D=await I.initialize(crypto.randomUUID(),A.ManagedBudget(x)),je=D,Ye=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),He={protocolFee:C.protocolFee,maxParticipants:C.maxParticipants,budget:D,action:A.EventAction(C.action),allowList:await fa(C,{core:A}),incentives:Pt};C.validator&&(He.validator=A.SignerValidator(C.validator));const $t=await A.createBoost(He);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 Rt.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}),Ot=l.object({type:l.literal("PointsIncentive"),venue:w,selector:Ze,reward:l.coerce.bigint(),limit:l.coerce.bigint()}),Rt=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,Ot]))});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:Je,chainid:t},actionSteps:[{signature:"event Minted(address to, uint256 amount)",signatureType:T.SignatureType.FUNC,actionType:0,targetContract:Je,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=Rt;exports.CGDAIncentiveSchema=Nt;exports.ERC20IncentiveSchema=St;exports.ERC20VariableCriteriaIncentiveSchema=Et;exports.ERC20VariableIncentiveSchema=It;exports.EventActionSchema=xt;exports.IncentiveCriteriaSchema=At;exports.ManagedBudgetSchema=bt;exports.PointsIncentiveSchema=Ot;exports.SignerValidatorSchema=wt;exports.SimpleAllowListSchema=Tt;exports.SimpleDenyListSchema=kt;exports.makeSeed=Zt;exports.seed=ca;
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 H{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Ft extends H{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 Wt extends H{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 Gt extends H{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 Gt({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 Wt({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 Ft({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=Oe(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 Ke(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=Oe(e),i=(t==null?void 0:t.chainId)??s.chainId??r;return Ke(e,{...t,...n.functionName?{functionName:n.functionName}:{},address:(a=n.address)==null?void 0:a[i],abi:n.abi})}:(e,t)=>Ke(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 rt(n,{account:t,chainId:a,connector:r});const{connector:u}=Oe(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 Fe(n){return n.address!==void 0&&typeof n.address=="object"?(e,t)=>{var a;const r=ze(e),s=Oe(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 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"}],Yt=st({abi:z,functionName:"allowance"}),Ht=st({abi:z,functionName:"balanceOf"}),Jt=Fe({abi:z,functionName:"approve"}),Kt=Fe({abi:z,functionName:"mint"}),Qt=Fe({abi:z,functionName:"mintPayable"}),Xt=qe({abi:z,functionName:"approve"}),en=qe({abi:z,functionName:"mint"}),tn=qe({abi:z,functionName:"mintPayable"}),nn="0x6080604052348015600e575f80fd5b50610e138061001c5f395ff3fe6080604052600436106100dc575f3560e01c806340c10f191161007e57806395d89b411161005857806395d89b41146102bc578063a9059cbb146102e6578063d505accf14610322578063dd62ed3e1461034a576100dc565b806340c10f191461021c57806370a08231146102445780637ecebe0014610280576100dc565b806318160ddd116100ba57806318160ddd1461016257806323b872dd1461018c578063313ce567146101c85780633644e515146101f2576100dc565b806306fdde03146100e0578063095ea7b31461010a57806317d304b014610146575b5f80fd5b3480156100eb575f80fd5b506100f4610386565b60405161010191906109bf565b60405180910390f35b348015610115575f80fd5b50610130600480360381019061012b9190610a70565b6103c3565b60405161013d9190610ac8565b60405180910390f35b610160600480360381019061015b9190610a70565b610413565b005b34801561016d575f80fd5b50610176610470565b6040516101839190610af0565b60405180910390f35b348015610197575f80fd5b506101b260048036038101906101ad9190610b09565b610481565b6040516101bf9190610ac8565b60405180910390f35b3480156101d3575f80fd5b506101dc610552565b6040516101e99190610b74565b60405180910390f35b3480156101fd575f80fd5b5061020661055a565b6040516102139190610ba5565b60405180910390f35b348015610227575f80fd5b50610242600480360381019061023d9190610a70565b6105ea565b005b34801561024f575f80fd5b5061026a60048036038101906102659190610bbe565b6105f8565b6040516102779190610af0565b60405180910390f35b34801561028b575f80fd5b506102a660048036038101906102a19190610bbe565b610611565b6040516102b39190610af0565b60405180910390f35b3480156102c7575f80fd5b506102d061062a565b6040516102dd91906109bf565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190610a70565b610667565b6040516103199190610ac8565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190610c3d565b6106f5565b005b348015610355575f80fd5b50610370600480360381019061036b9190610cda565b610891565b60405161037d9190610af0565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f636b20455243323000000000000000000000000000000000000000000000815250905090565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b6064816104209190610d45565b341015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045990610dbf565b60405180910390fd5b61046c82826108af565b5050565b5f6805345cdf77eb68f44c54905090565b5f61048d848484610941565b8360601b33602052637f5e9f208117600c526034600c20805460018101156104ca57808511156104c4576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c208054808711156104f05763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610547848484610946565b600190509392505050565b5f6012905090565b5f8061056461094b565b90505f801b810361058157610577610386565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b6105f482826108af565b5050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b60606040518060400160405280600481526020017f4d4f434b00000000000000000000000000000000000000000000000000000000815250905090565b5f610673338484610941565b6387a211a2600c52335f526020600c2080548084111561069a5763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050506106eb338484610946565b6001905092915050565b5f6106fe61094b565b90505f801b810361071b57610711610386565b8051906020012090505b8442111561073057631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d51146108385763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b6108ba5f8383610941565b6805345cdf77eb68f44c54818101818110156108dd5763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350505061093d5f8383610946565b5050565b505050565b505050565b5f90565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6109918261094f565b61099b8185610959565b93506109ab818560208601610969565b6109b481610977565b840191505092915050565b5f6020820190508181035f8301526109d78184610987565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a0c826109e3565b9050919050565b610a1c81610a02565b8114610a26575f80fd5b50565b5f81359050610a3781610a13565b92915050565b5f819050919050565b610a4f81610a3d565b8114610a59575f80fd5b50565b5f81359050610a6a81610a46565b92915050565b5f8060408385031215610a8657610a856109df565b5b5f610a9385828601610a29565b9250506020610aa485828601610a5c565b9150509250929050565b5f8115159050919050565b610ac281610aae565b82525050565b5f602082019050610adb5f830184610ab9565b92915050565b610aea81610a3d565b82525050565b5f602082019050610b035f830184610ae1565b92915050565b5f805f60608486031215610b2057610b1f6109df565b5b5f610b2d86828701610a29565b9350506020610b3e86828701610a29565b9250506040610b4f86828701610a5c565b9150509250925092565b5f60ff82169050919050565b610b6e81610b59565b82525050565b5f602082019050610b875f830184610b65565b92915050565b5f819050919050565b610b9f81610b8d565b82525050565b5f602082019050610bb85f830184610b96565b92915050565b5f60208284031215610bd357610bd26109df565b5b5f610be084828501610a29565b91505092915050565b610bf281610b59565b8114610bfc575f80fd5b50565b5f81359050610c0d81610be9565b92915050565b610c1c81610b8d565b8114610c26575f80fd5b50565b5f81359050610c3781610c13565b92915050565b5f805f805f805f60e0888a031215610c5857610c576109df565b5b5f610c658a828b01610a29565b9750506020610c768a828b01610a29565b9650506040610c878a828b01610a5c565b9550506060610c988a828b01610a5c565b9450506080610ca98a828b01610bff565b93505060a0610cba8a828b01610c29565b92505060c0610ccb8a828b01610c29565b91505092959891949750929550565b5f8060408385031215610cf057610cef6109df565b5b5f610cfd85828601610a29565b9250506020610d0e85828601610a29565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610d4f82610a3d565b9150610d5a83610a3d565b925082610d6a57610d69610d18565b5b828204905092915050565b7f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e657921000000005f82015250565b5f610da9601c83610959565b9150610db482610d75565b602082019050919050565b5f6020820190508181035f830152610dd681610d9d565b905091905056fea264697066735822122014217224d57712700b62f2706b7c6ccac676419103ff9ccb6b43ece3d5b783f164736f6c634300081a0033";class it extends T.Deployable{async balanceOf(e,t){return await Ht(this._config,{address:this.assertValidAddress(),args:[e],...t})}async allowance(e,t,a){return await Yt(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 Jt(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 Kt(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 Qt(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 O 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 O))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()}}O.create=n=>new O(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 O(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 G.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 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 R 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 R({...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 R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get 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}}R.create=n=>{var e;return new R({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 F 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 F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:p.toString(r)}]})}_addCheck(e){return new F({...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}}F.create=n=>{var e;return new F({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 J 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 J({...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}}J.create=n=>new J({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 Y extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return N(e.data)}}Y.create=n=>new Y({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 G?G.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,Q=await m.value;c.push({key:I,value:Q,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 O(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 O(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 W?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 G?[null,...B(n.unwrap())]:n instanceof We||n instanceof _e?B(n.unwrap()):n instanceof ve?B(n._def.innerType):[];class Re 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 Re({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:R.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 K 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 K({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new K({...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)}}K.create=(n,e)=>new K({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 O([]),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 O([a(u,c.error)]);const m=Reflect.apply(i,this,c.data),I=o._def.returns.safeParse(m,s);if(!I.success)throw new O([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(Y.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(Y.create()),returns:t||Y.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 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 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 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=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 G extends v{_parse(e){return this._getType(e)===h.null?N(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}G.create=(n,e)=>new G({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 O(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new O(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 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 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=R.create,mt=q.create,Sn=Ne.create,In=F.create,yt=de.create,An=J.create,En=Ie.create,Nn=ue.create,On=le.create,Rn=ae.create,Zn=Y.create,jn=L.create,Mn=Ae.create,Pn=Z.create,$n=k.create,Dn=k.strictCreate,Vn=fe.create,Bn=Re.create,Ln=he.create,zn=$.create,Un=pe.create,qn=Ee.create,Fn=K.create,Wn=te.create,Gn=me.create,Yn=ye.create,Hn=W.create,Jn=be.create,Kn=re.create,et=j.create,Qn=M.create,Xn=G.create,ea=j.createWithPreprocess,ta=xe.create,na=()=>pt().optional(),aa=()=>mt().optional(),ra=()=>yt().optional(),sa={string:n=>R.create({...n,coerce:!0}),number:n=>q.create({...n,coerce:!0}),boolean:n=>de.create({...n,coerce:!0}),bigint:n=>F.create({...n,coerce:!0}),date:n=>J.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:R,ZodNumber:q,ZodBigInt:F,ZodBoolean:de,ZodDate:J,ZodSymbol:Ie,ZodUndefined:ue,ZodNull:le,ZodAny:ae,ZodUnknown:Y,ZodNever:L,ZodVoid:Ae,ZodArray:Z,ZodObject:k,ZodUnion:fe,ZodDiscriminatedUnion:Re,ZodIntersection:he,ZodTuple:$,ZodRecord:pe,ZodMap:Ee,ZodSet:K,ZodFunction:te,ZodLazy:me,ZodLiteral:ye,ZodEnum:W,ZodNativeEnum:be,ZodPromise:re,ZodEffects:j,ZodTransformer:j,ZodOptional:M,ZodNullable:G,ZodDefault:ge,ZodCatch:ve,ZodNaN:Ne,BRAND:kn,ZodBranded:We,ZodPipeline:xe,ZodReadonly:_e,custom:ht,Schema:v,ZodSchema:v,late:Tn,get ZodFirstPartyTypeKind(){return y},coerce:sa,any:Rn,array:Pn,bigint:In,boolean:yt,date:An,discriminatedUnion:Bn,effect:et,enum:Hn,function:Wn,instanceof:Cn,intersection:Ln,lazy:Gn,literal:Yn,map:qn,nan:Sn,nativeEnum:Jn,never:jn,null:On,nullable:Xn,number:mt,object:$n,oboolean:ra,onumber:aa,optional:Qn,ostring:na,pipeline:ta,preprocess:ea,promise:Kn,record:Un,set:Fn,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:O});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}),Q=T.BOOST_CORE_ADDRESSES[c];if(!Q)throw new Error(`Unable to select a deployed BoostCore with chain ID ${c}`);const A=new T.BoostCore({config:i,account:o,address:Q});if(!e.length)throw new Error("No seed provided");const jt=await Promise.all(e.map(da));let je,Ge;const Ye=[];for(const C of jt){let D;if(typeof C.budget=="string"&&S.isAddress(C.budget))D=A.ManagedBudget(C.budget);else if(Pe(Ge,C.budget)&&je)D=je;else{const x={...C.budget,authorized:[...C.budget.authorized,Q],roles:[...C.budget.roles,T.Roles.MANAGER]};D=await I.initialize(crypto.randomUUID(),A.ManagedBudget(x)),je=D,Ge=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),He={protocolFee:C.protocolFee,maxParticipants:C.maxParticipants,budget:D,action:A.EventAction(C.action),allowList:await fa(C,{core:A}),incentives:Pt};C.validator&&(He.validator=A.SignerValidator(C.validator));const $t=await A.createBoost(He);Ye.push($t.id.toString())}return{boostIds:Ye}};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 Rt.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}),Ot=l.object({type:l.literal("PointsIncentive"),venue:w,selector:Ze,reward:l.coerce.bigint(),limit:l.coerce.bigint()}),Rt=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,Ot]))});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:Je,chainid:t},actionSteps:[{signature:"event Minted(address to, uint256 amount)",signatureType:T.SignatureType.FUNC,actionType:0,targetContract:Je,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=Rt;exports.CGDAIncentiveSchema=Nt;exports.ERC20IncentiveSchema=St;exports.ERC20VariableCriteriaIncentiveSchema=Et;exports.ERC20VariableIncentiveSchema=It;exports.EventActionSchema=xt;exports.IncentiveCriteriaSchema=At;exports.ManagedBudgetSchema=bt;exports.PointsIncentiveSchema=Ot;exports.SignerValidatorSchema=wt;exports.SimpleAllowListSchema=Tt;exports.SimpleDenyListSchema=kt;exports.makeSeed=Zt;exports.seed=ca;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boostxyz/cli",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "A repository of useful scripts to interact with the protocol",
5
5
  "repository": "https://github.com/boostxyz/boost-protocol",
6
6
  "author": "Boost Team<boost-team@boost.xyz>",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "license": "GPL-3.0-or-later",
47
47
  "optionalDependencies": {
48
- "@boostxyz/sdk": "4.0.0"
48
+ "@boostxyz/sdk": "5.0.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vite build",