@tossplace/pos-plugin-sdk 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- var e={452:(e,t,n)=>{var r,a;n.r(t),n.d(t,{assert:()=>G,ensured:()=>J,is:()=>Y,isFulfilled:()=>W,isNotNull:()=>q,isRejected:()=>K,notNull:()=>H}),function(e){e.SYSTEM="SYSTEM",e.MAINTENANCE="MAINTENANCE",e.USER_WARNING="USER_WARNING",e.VENDOR_SYSTEM="VENDOR_SYSTEM",e.VENDOR_WARNING="VENDOR_WARNING",e.SYSTEM_WARNING="SYSTEM_WARNING",e.NETWORK="NETWORK",e.ASSERT="ASSERT"}(r||(r={}));class s extends Error{constructor(e,t={}){super(e),this.origin="unknown",t.cause instanceof Error&&(this.cause=t.cause),"string"==typeof t.origin&&(this.origin=origin),delete t.cause,this.debugInfo=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!0,writable:!0,configurable:!0}),Object.defineProperty(this,"_stack",{value:this.stack,enumerable:!1,writable:!0,configurable:!0}),Object.setPrototypeOf?Object.setPrototypeOf(this,new.target.prototype):this.__proto__=new.target.prototype,Error.captureStackTrace?.(this,this.constructor),Reflect.set(this,"_stack",this.stack),Object.defineProperties(this,{stack:{enumerable:!0,get(){return this._stack},set(e){this._stack=e},configurable:!0},message:{enumerable:!0,writable:!0,configurable:!0}})}}class i extends s{constructor(){super(...arguments),this.errorType=r.SYSTEM}}class o extends s{constructor(){super(...arguments),this.errorType=r.MAINTENANCE}}class d extends s{constructor(){super(...arguments),this.errorType=r.USER_WARNING}}class u extends s{constructor(){super(...arguments),this.errorType=r.VENDOR_SYSTEM}}class c extends s{constructor(){super(...arguments),this.errorType=r.VENDOR_WARNING}}class l extends s{constructor(){super(...arguments),this.errorType=r.SYSTEM_WARNING}}class p extends s{constructor(){super(...arguments),this.errorType=r.NETWORK}}class h extends s{constructor(){super(...arguments),this.errorType=r.ASSERT}}function m(e){throw e}!function(e){e.RUNTIME_ERROR="SYSTEM",e.BAD_REQUEST="ASSERT",e.PARSE_ERROR="SYSTEM",e.RETRYABLE_VENDOR_ERROR="VENDOR_WARNING",e.RETRYABLE_SYSTEM_ERROR="SYSTEM_WARNING"}(a||(a={})),new Proxy({},{get:(e,t)=>e=>e instanceof s&&e.errorType===t}),m.assert=function(e,t){throw new h(e,t)},m.system=function(e,t){throw new i(e,t)},m.systemWarning=function(e,t){throw new l(e,t)},m.userWarning=function(e,t){throw new d(e,t)},m.vendorWarning=function(e,t){throw new c(e,t)},m.vendorSystem=function(e,t){throw new u(e,t)},m.maintenance=function(e,t){throw new o(e,t)},m.network=function(e,t){throw new p(e,t)};const f=(e,...t)=>{throw function(e){if(!(e instanceof Error))return!1;if(!("debugInfo"in e))return!1;const t=e;return"object"==typeof t?.debugInfo&&null!==t.debugInfo}(e)||(e.debugInfo={}),e.debugInfo.args=t,e};function y({typeName:e,args:t,cause:n}){throw new h(`'${e}' 타입이어야 합니다.`,{cause:n,args:t})}f.withMasking=function(e){return(t,...n)=>{const r=e(...n);Array.isArray(r)&&f(t,...r),f(t,r)}};const g=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],v=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...g],_=["null","undefined","string","number","bigint","boolean","symbol"];function b(e){return t=>typeof t===e}const{toString:P}=Object.prototype,k=e=>{const t=P.call(e).slice(8,-1);return/HTML\w+Element/.test(t)&&I.domElement(e)?"HTMLElement":(n=t,v.includes(n)?t:void 0);var n},w=e=>t=>k(t)===e;function I(e){if(null===e)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol"}if(I.observable(e))return"Observable";if(I.array(e))return"Array";if(I.buffer(e))return"Buffer";const t=k(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}I.undefined=b("undefined"),I.string=b("string");const x=b("number");I.number=e=>x(e)&&!I.nan(e),I.bigint=b("bigint"),I.function_=b("function"),I.null_=e=>null===e,I.class_=e=>I.function_(e)&&e.toString().startsWith("class "),I.boolean=e=>!0===e||!1===e,I.symbol=b("symbol"),I.numericString=e=>I.string(e)&&!I.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e)),I.array=(e,t)=>!!Array.isArray(e)&&(!I.function_(t)||e.every(t)),I.buffer=e=>e?.constructor?.isBuffer?.(e)??!1,I.blob=e=>w("Blob")(e),I.nullOrUndefined=e=>I.null_(e)||I.undefined(e),I.object=e=>!I.null_(e)&&("object"==typeof e||I.function_(e)),I.iterable=e=>I.function_(e?.[Symbol.iterator]),I.asyncIterable=e=>I.function_(e?.[Symbol.asyncIterator]),I.generator=e=>I.iterable(e)&&I.function_(e?.next)&&I.function_(e?.throw),I.asyncGenerator=e=>I.asyncIterable(e)&&I.function_(e.next)&&I.function_(e.throw),I.nativePromise=e=>w("Promise")(e),I.promise=e=>I.nativePromise(e)||(e=>I.function_(e?.then)&&I.function_(e?.catch))(e),I.generatorFunction=w("GeneratorFunction"),I.asyncGeneratorFunction=e=>"AsyncGeneratorFunction"===k(e),I.asyncFunction=e=>"AsyncFunction"===k(e),I.boundFunction=e=>I.function_(e)&&!e.hasOwnProperty("prototype"),I.regExp=w("RegExp"),I.date=w("Date"),I.error=w("Error"),I.map=e=>w("Map")(e),I.set=e=>w("Set")(e),I.weakMap=e=>w("WeakMap")(e),I.weakSet=e=>w("WeakSet")(e),I.int8Array=w("Int8Array"),I.uint8Array=w("Uint8Array"),I.uint8ClampedArray=w("Uint8ClampedArray"),I.int16Array=w("Int16Array"),I.uint16Array=w("Uint16Array"),I.int32Array=w("Int32Array"),I.uint32Array=w("Uint32Array"),I.float32Array=w("Float32Array"),I.float64Array=w("Float64Array"),I.bigInt64Array=w("BigInt64Array"),I.bigUint64Array=w("BigUint64Array"),I.arrayBuffer=w("ArrayBuffer"),I.sharedArrayBuffer=w("SharedArrayBuffer"),I.dataView=w("DataView"),I.enumCase=(e,t)=>Object.values(t).includes(e),I.directInstanceOf=(e,t)=>Object.getPrototypeOf(e)===t.prototype,I.urlInstance=e=>w("URL")(e),I.urlString=e=>{if(!I.string(e))return!1;try{return new URL(e),!0}catch{return!1}},I.truthy=e=>Boolean(e),I.falsy=e=>!e,I.nan=e=>Number.isNaN(e),I.primitive=e=>{return I.null_(e)||(t=typeof e,_.includes(t));var t},I.integer=e=>Number.isInteger(e),I.safeInteger=e=>Number.isSafeInteger(e),I.plainObject=e=>{if("[object Object]"!==P.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})},I.typedArray=e=>{return t=k(e),g.includes(t);var t},I.arrayLike=e=>!I.nullOrUndefined(e)&&!I.function_(e)&&(e=>I.safeInteger(e)&&e>=0)(e.length),I.inRange=(e,t)=>{if(I.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(I.array(t)&&2===t.length)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)};const O=["innerHTML","ownerDocument","style","attributes","nodeValue"];I.domElement=e=>I.object(e)&&1===e.nodeType&&I.string(e.nodeName)&&!I.plainObject(e)&&O.every((t=>t in e)),I.observable=e=>!!e&&(e===e[Symbol.observable]?.()||e===e["@@observable"]?.()),I.nodeStream=e=>I.object(e)&&I.function_(e.pipe)&&!I.observable(e),I.infinite=e=>e===1/0||e===-1/0;const T=e=>t=>I.integer(t)&&Math.abs(t%2)===e;I.evenInteger=T(0),I.oddInteger=T(1),I.emptyArray=e=>I.array(e)&&0===e.length,I.nonEmptyArray=e=>I.array(e)&&e.length>0,I.emptyString=e=>I.string(e)&&0===e.length,I.emptyStringOrWhitespace=e=>I.emptyString(e)||(e=>I.string(e)&&!/\S/.test(e))(e),I.nonEmptyString=e=>I.string(e)&&e.length>0,I.nonEmptyStringAndNotWhitespace=e=>I.string(e)&&!I.emptyStringOrWhitespace(e),I.emptyObject=e=>I.object(e)&&!I.map(e)&&!I.set(e)&&0===Object.keys(e).length,I.nonEmptyObject=e=>I.object(e)&&!I.map(e)&&!I.set(e)&&Object.keys(e).length>0,I.emptySet=e=>I.set(e)&&0===e.size,I.nonEmptySet=e=>I.set(e)&&e.size>0,I.emptyMap=e=>I.map(e)&&0===e.size,I.nonEmptyMap=e=>I.map(e)&&e.size>0,I.propertyKey=e=>I.any([I.string,I.number,I.symbol],e),I.formData=e=>w("FormData")(e),I.urlSearchParams=e=>w("URLSearchParams")(e);const S=(e,t,n)=>{if(!I.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(0===n.length)throw new TypeError("Invalid number of values");return e.call(n,t)};I.any=(e,...t)=>(I.array(e)?e:[e]).some((e=>S(Array.prototype.some,e,t))),I.all=(e,...t)=>S(Array.prototype.every,e,t);const C=(e,t,n,r={})=>{if(!e){const{multipleValues:e}=r,a=e?`received values of types ${[...new Set(n.map((e=>`\`${I(e)}\``)))].join(", ")}`:`received value of type \`${I(n)}\``;throw new TypeError(`Expected value which is \`${t}\`, ${a}.`)}},Z={undefined:e=>C(I.undefined(e),"undefined",e),string:e=>C(I.string(e),"string",e),number:e=>C(I.number(e),"number",e),bigint:e=>C(I.bigint(e),"bigint",e),function_:e=>C(I.function_(e),"Function",e),null_:e=>C(I.null_(e),"null",e),class_:e=>C(I.class_(e),"Class",e),boolean:e=>C(I.boolean(e),"boolean",e),symbol:e=>C(I.symbol(e),"symbol",e),numericString:e=>C(I.numericString(e),"string with a number",e),array:(e,t)=>{C(I.array(e),"Array",e),t&&e.forEach(t)},buffer:e=>C(I.buffer(e),"Buffer",e),blob:e=>C(I.blob(e),"Blob",e),nullOrUndefined:e=>C(I.nullOrUndefined(e),"null or undefined",e),object:e=>C(I.object(e),"Object",e),iterable:e=>C(I.iterable(e),"Iterable",e),asyncIterable:e=>C(I.asyncIterable(e),"AsyncIterable",e),generator:e=>C(I.generator(e),"Generator",e),asyncGenerator:e=>C(I.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>C(I.nativePromise(e),"native Promise",e),promise:e=>C(I.promise(e),"Promise",e),generatorFunction:e=>C(I.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>C(I.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>C(I.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>C(I.boundFunction(e),"Function",e),regExp:e=>C(I.regExp(e),"RegExp",e),date:e=>C(I.date(e),"Date",e),error:e=>C(I.error(e),"Error",e),map:e=>C(I.map(e),"Map",e),set:e=>C(I.set(e),"Set",e),weakMap:e=>C(I.weakMap(e),"WeakMap",e),weakSet:e=>C(I.weakSet(e),"WeakSet",e),int8Array:e=>C(I.int8Array(e),"Int8Array",e),uint8Array:e=>C(I.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>C(I.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>C(I.int16Array(e),"Int16Array",e),uint16Array:e=>C(I.uint16Array(e),"Uint16Array",e),int32Array:e=>C(I.int32Array(e),"Int32Array",e),uint32Array:e=>C(I.uint32Array(e),"Uint32Array",e),float32Array:e=>C(I.float32Array(e),"Float32Array",e),float64Array:e=>C(I.float64Array(e),"Float64Array",e),bigInt64Array:e=>C(I.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>C(I.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>C(I.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>C(I.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>C(I.dataView(e),"DataView",e),enumCase:(e,t)=>C(I.enumCase(e,t),"EnumCase",e),urlInstance:e=>C(I.urlInstance(e),"URL",e),urlString:e=>C(I.urlString(e),"string with a URL",e),truthy:e=>C(I.truthy(e),"truthy",e),falsy:e=>C(I.falsy(e),"falsy",e),nan:e=>C(I.nan(e),"NaN",e),primitive:e=>C(I.primitive(e),"primitive",e),integer:e=>C(I.integer(e),"integer",e),safeInteger:e=>C(I.safeInteger(e),"integer",e),plainObject:e=>C(I.plainObject(e),"plain object",e),typedArray:e=>C(I.typedArray(e),"TypedArray",e),arrayLike:e=>C(I.arrayLike(e),"array-like",e),domElement:e=>C(I.domElement(e),"HTMLElement",e),observable:e=>C(I.observable(e),"Observable",e),nodeStream:e=>C(I.nodeStream(e),"Node.js Stream",e),infinite:e=>C(I.infinite(e),"infinite number",e),emptyArray:e=>C(I.emptyArray(e),"empty array",e),nonEmptyArray:e=>C(I.nonEmptyArray(e),"non-empty array",e),emptyString:e=>C(I.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>C(I.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>C(I.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>C(I.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>C(I.emptyObject(e),"empty object",e),nonEmptyObject:e=>C(I.nonEmptyObject(e),"non-empty object",e),emptySet:e=>C(I.emptySet(e),"empty set",e),nonEmptySet:e=>C(I.nonEmptySet(e),"non-empty set",e),emptyMap:e=>C(I.emptyMap(e),"empty map",e),nonEmptyMap:e=>C(I.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>C(I.propertyKey(e),"PropertyKey",e),formData:e=>C(I.formData(e),"FormData",e),urlSearchParams:e=>C(I.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>C(I.evenInteger(e),"even integer",e),oddInteger:e=>C(I.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>C(I.directInstanceOf(e,t),"T",e),inRange:(e,t)=>C(I.inRange(e,t),"in range",e),any:(e,...t)=>C(I.any(e,...t),"predicate returns truthy for any value",t,{multipleValues:!0}),all:(e,...t)=>C(I.all(e,...t),"predicate returns truthy for all values",t,{multipleValues:!0})};Object.defineProperties(I,{class:{value:I.class_},function:{value:I.function_},null:{value:I.null_}}),Object.defineProperties(Z,{class:{value:Z.class_},function:{value:Z.function_},null:{value:Z.null_}});const A=I;function E(e,t){return{name:e,is:t,assert:(n,...r)=>function({condition:e,typeName:t,args:n,cause:r}){e||y({typeName:t,args:n,cause:r})}({condition:t(n,...r),typeName:e,args:[n]})}}const j=E("businessRegistrationNumber",(e=>{if(null==e||!A.string(e))return!1;const t=e.replace(/\D/g,"");return!["9999999999","1111111111","999999999","0000000000","4444444444"].some((e=>e===t))&&10===t.length})),N=E("datePattern",((e,t)=>{if(!A.string(e))return!1;switch(t){case"YYYYMMDD":return/^\d{8}$/.test(e)&&n(e.slice(4,6))&&r(e.slice(6,8));case"YYMMDD":return/^\d{6}$/.test(e)&&n(e.slice(2,4))&&r(e.slice(4,6));case"YYYY-MM-DD":return/^\d{4}-\d{2}-\d{2}$/.test(e)&&n(e.slice(5,7))&&r(e.slice(8,10));case"YY-MM-DD":return/^\d{2}-\d{2}-\d{2}$/.test(e)&&n(e.slice(3,5))&&r(e.slice(6,8));default:throw new i(`Unknown date pattern: ${t}`,{pattern:t,value:e})}function n(e){const t=Number(e);return t>=1&&t<=12}function r(e){const t=Number(e);return t>=1&&t<=31}})),R=E("false",(e=>!1===e)),M=E("html",(e=>A.string(e)&&/<[a-z]+>[^<]*<\/[a-z]+>/g.test(e))),z=E("jsonString",(e=>{try{return!!A.string(e)&&(JSON.parse(e),!0)}catch{return!1}})),D=E("mailOrderBusinessNumber",(e=>{if(null==e||!A.string(e)||0===e.trim().length)return!1;const t=e.replace(/-/g,"");return!["(중복말소)"].some((e=>e===t))&&!!/[^0]/g.test(t)&&Boolean(e.match(/^[\dㄱ-ㅎ가-힣\w]/))})),F=E("objectOrArrayString",(e=>{try{if(A.string(e)){const t=JSON.parse(e);return A.array(t)||A.plainObject(t)}return!1}catch{return!1}})),L=E("residentRegistrationNumber",(e=>{if(null==e||!A.string(e))return!1;const t=e.replace(/-/g,"");return!!A.numericString(t)&&13===t.length&&(!function(e){const t=parseInt(e.slice(0,2)),n=parseInt(e.slice(2,4));return!(t>=20&&n>=10)}(t)||function(e){const t=parseInt(e[e.length-1]);return(11-e.slice(0,e.length-1).split("").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t*(n%8+2)),0)%11)%10===t}(t))})),U={datePatternType:N,falseType:R,trueType:E("true",(e=>!0===e)),htmlType:M,jsonStringType:z,objectOrArrayStringType:F,businessRegistrationNumberType:j,mailOrderBusinessNumberType:D,residentRegistrationNumberType:L};function V(e){return Object.entries(U).reduce(((t,[n,r])=>{if(n!==`${r.name}Type`)throw new i(`Handler이름은 {{name}}Type이어야 합니다.\n- ${n} !== ${r.name}Type`,{handlerVariable:n,handlerName:r.name});return{...t,[r.name]:r[e]}}),{})}const $=V("is"),B=V("assert");function W(e){return"fulfilled"===e.status}function q(e){return null!=e}function K(e){return"rejected"===e.status}function H(e,t=()=>{throw new h("예상하지 못한 Nullable 값을 받았습니다.")}){return null==e&&t(),e}const Y=function(e,t){for(const n in t)e[n]=t[n];return function(e){const t=new Proxy({},{get:(t,n)=>(n in t||(t[n]=(...t)=>!e[n].apply(null,t)),t[n])});return e.not=t,e}(e)}(A,$),G=function(e,t){const n={...t};return new Proxy(e,{get(e,t){if(!(t in n)){const r=e[t];n[t]=(...e)=>{try{return r(...e)}catch(n){y({typeName:t,args:e,cause:n})}}}return n[t]}})}(Z,B),J=function(e){return new Proxy({},{get:(t,n)=>(n in t||(t[n]=(...t)=>((0,e[n])(...t),t[0])),t[n])})}(G)},2726:(e,t,n)=>{var r,a,s;n.r(t),n.d(t,{Validate:()=>Ft,safeParseJson:()=>Dt,typeGuard:()=>zt,validate:()=>Mt,validateWith:()=>Lt}),function(e){e.SYSTEM="SYSTEM",e.MAINTENANCE="MAINTENANCE",e.USER_WARNING="USER_WARNING",e.VENDOR_SYSTEM="VENDOR_SYSTEM",e.VENDOR_WARNING="VENDOR_WARNING",e.SYSTEM_WARNING="SYSTEM_WARNING",e.NETWORK="NETWORK",e.ASSERT="ASSERT",e.INFO="INFO"}(r||(r={}));class i extends Error{static isWebAutomationError(e){const t="function"==typeof(n=e)&&n.toString().startsWith("class ")?function(e){const t=new WeakMap;let n=e;for(;;)try{return t.has(n)?null:(t.set(n,!0),new n(""))}catch(e){if(!Object.getPrototypeOf(n))return null;n=Object.getPrototypeOf(n)}}(e):e;var n;if("object"!=typeof t)return!1;try{return"origin"in t&&"debugInfo"in t&&"errorType"in t&&"string"==typeof t.origin&&"object"==typeof t.debugInfo&&"string"==typeof t.errorType}catch(e){return!1}}constructor(e,t={}){super(e),this.origin="unknown",t.cause instanceof Error&&(this.cause=t.cause),"string"==typeof t.origin&&(this.origin=t.origin),this.errorType||(this.errorType=r.SYSTEM),delete t.cause,this.debugInfo=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!0,writable:!0,configurable:!0}),Object.defineProperty(this,"_stack",{value:this.stack,enumerable:!1,writable:!0,configurable:!0}),Object.setPrototypeOf?Object.setPrototypeOf(this,new.target.prototype):this.__proto__=new.target.prototype,Error.captureStackTrace?.(this,this.constructor),Reflect.set(this,"_stack",this.stack),Object.defineProperties(this,{stack:{enumerable:!0,get(){return this._stack},set(e){this._stack=e},configurable:!0},message:{enumerable:!0,writable:!0,configurable:!0}})}}class o extends i{constructor(){super(...arguments),this.errorType=r.SYSTEM}}class d extends i{constructor(){super(...arguments),this.errorType=r.ASSERT}}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(s||(s={}));const u=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),c=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}},l=a.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"]);class p extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof p))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];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))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const h=(e,t)=>{let n;switch(e.code){case l.invalid_type:n=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case l.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:n=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case l.invalid_union:n="Invalid input";break;case l.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case l.invalid_enum_value:n=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case l.invalid_arguments:n="Invalid function arguments";break;case l.invalid_return_type:n="Invalid function return type";break;case l.invalid_date:n="Invalid date";break;case l.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case l.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case l.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case l.custom:n="Invalid input";break;case l.invalid_intersection_types:n="Intersection results could not be merged";break;case l.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case l.not_finite:n="Number must be finite";break;default:n=t.defaultError,a.assertNever(e)}return{message:n}};let m=h;function f(){return m}const y=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function g(e,t){const n=f(),r=y({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===h?void 0:h].filter((e=>!!e))});e.common.issues.push(r)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return _;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return v.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return _;if("aborted"===a.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),b=e=>({status:"dirty",value:e}),P=e=>({status:"valid",value:e}),k=e=>"aborted"===e.status,w=e=>"dirty"===e.status,I=e=>"valid"===e.status,x=e=>"undefined"!=typeof Promise&&e instanceof Promise;function O(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function T(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n}var S,C,Z;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(S||(S={}));class A{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,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 E=(e,t)=>{if(I(t))return{success:!0,data:t.value};if(!e.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 p(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class N{get description(){return this._def.description}_getType(e){return c(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:c(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:c(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(x(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c(e)},a=this._parseSync({data:e,path:r.path,parent:r});return E(r,a)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:r});return I(t)?{value:t.value}:{issues:r.common.issues}}catch(e){(null===(n=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then((e=>I(e)?{value:e.value}:{issues:r.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:c(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(x(r)?r:Promise.resolve(r));return E(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:l.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ne({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Re.create(this,this._def)}nullable(){return Me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return je.create(this,this._def)}or(e){return ve.create([this,e],this._def)}and(e){return ke.create(this,e,this._def)}transform(e){return new Ne({...j(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ze({...j(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new Ue({typeName:Ke.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new De({...j(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ve.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R=/^c[^\s-]{8,}$/i,M=/^[0-9a-z]+$/,z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,D=/^[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,F=/^[a-z0-9_-]{21}$/i,L=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U=/^[-+]?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)?)??$/,V=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let $;const B=/^(?:(?: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])$/,W=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Y=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\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])))",J=new RegExp(`^${G}$`);function X(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function Q(e){let t=`${G}T${X(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ee(e,t){if(!L.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!("object"!=typeof a||null===a||!a.typ||!a.alg||t&&a.alg!==t)}catch(e){return!1}}function te(e,t){return!("v4"!==t&&t||!W.test(e))||!("v6"!==t&&t||!K.test(e))}class ne extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.string,received:t.parsedType}),_}const t=new v;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:l.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:l.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?g(n,{code:l.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&g(n,{code:l.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)V.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"email",code:l.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)$||($=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"emoji",code:l.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"uuid",code:l.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)F.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"nanoid",code:l.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"cuid",code:l.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"cuid2",code:l.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)z.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"ulid",code:l.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),g(n,{validation:"url",code:l.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"regex",code:l.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?Q(i).test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?J.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${X(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:l.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?U.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"duration",code:l.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(r=e.data,("v4"!==(s=i.version)&&s||!B.test(r))&&("v6"!==s&&s||!q.test(r))&&(n=this._getOrReturnCtx(e,n),g(n,{validation:"ip",code:l.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?ee(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"jwt",code:l.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?te(e.data,i.version)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"cidr",code:l.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?H.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"base64",code:l.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?Y.test(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{validation:"base64url",code:l.invalid_string,message:i.message}),t.dirty()):a.assertNever(i);var r,s;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:l.invalid_string,...S.errToObj(n)})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...S.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...S.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new ne({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function re(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}ne.create=e=>{var t;return new ne({checks:[],typeName:Ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class ae extends N{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)!==u.number){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.number,received:t.parsedType}),_}let t;const n=new v;for(const r of this._def.checks)"int"===r.kind?a.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:l.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==re(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:l.not_finite,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,r){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(r)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ae.create=e=>new ae({checks:[],typeName:Ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class se extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let t;const n=new v;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),g(t,{code:l.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,r){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(r)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}se.create=e=>{var t;return new se({checks:[],typeName:Ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class ie extends N{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.boolean,received:t.parsedType}),_}return P(e.data)}}ie.create=e=>new ie({typeName:Ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class oe extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.date,received:t.parsedType}),_}if(isNaN(e.data.getTime()))return g(this._getOrReturnCtx(e),{code:l.invalid_date}),_;const t=new v;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:l.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:l.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):a.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}oe.create=e=>new oe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ke.ZodDate,...j(e)});class de extends N{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.symbol,received:t.parsedType}),_}return P(e.data)}}de.create=e=>new de({typeName:Ke.ZodSymbol,...j(e)});class ue extends N{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.undefined,received:t.parsedType}),_}return P(e.data)}}ue.create=e=>new ue({typeName:Ke.ZodUndefined,...j(e)});class ce extends N{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.null,received:t.parsedType}),_}return P(e.data)}}ce.create=e=>new ce({typeName:Ke.ZodNull,...j(e)});class le extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}}le.create=e=>new le({typeName:Ke.ZodAny,...j(e)});class pe extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}}pe.create=e=>new pe({typeName:Ke.ZodUnknown,...j(e)});class he extends N{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.never,received:t.parsedType}),_}}he.create=e=>new he({typeName:Ke.ZodNever,...j(e)});class me extends N{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.void,received:t.parsedType}),_}return P(e.data)}}me.create=e=>new me({typeName:Ke.ZodVoid,...j(e)});class fe extends N{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==u.array)return g(t,{code:l.invalid_type,expected:u.array,received:t.parsedType}),_;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(g(t,{code:e?l.too_big:l.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(g(t,{code:l.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(g(t,{code:l.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new A(t,e,t.path,n))))).then((e=>v.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new A(t,e,t.path,n))));return v.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new fe({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new fe({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new fe({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function ye(e){if(e instanceof ge){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Re.create(ye(r))}return new ge({...e._def,shape:()=>t})}return e instanceof fe?new fe({...e._def,type:ye(e.element)}):e instanceof Re?Re.create(ye(e.unwrap())):e instanceof Me?Me.create(ye(e.unwrap())):e instanceof we?we.create(e.items.map((e=>ye(e)))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...j(t)});class ge extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.object,received:t.parsedType}),_}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof he&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||s.push(e);const i=[];for(const e of a){const t=r[e],a=n.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new A(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof he){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(g(n,{code:l.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new A(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new ge({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=S.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ge({...this._def,unknownKeys:"strip"})}passthrough(){return new ge({...this._def,unknownKeys:"passthrough"})}extend(e){return new ge({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ge({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ge({...this._def,catchall:e})}pick(e){const t={};return a.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ge({...this._def,shape:()=>t})}omit(e){const t={};return a.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ge({...this._def,shape:()=>t})}deepPartial(){return ye(this)}partial(e){const t={};return a.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ge({...this._def,shape:()=>t})}required(e){const t={};return a.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Re;)e=e._def.innerType;t[n]=e}})),new ge({...this._def,shape:()=>t})}keyof(){return Ze(a.objectKeys(this.shape))}}ge.create=(e,t)=>new ge({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ge.strictCreate=(e,t)=>new ge({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ge.lazycreate=(e,t)=>new ge({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)});class ve extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new p(e.ctx.common.issues)));return g(t,{code:l.invalid_union,unionErrors:n}),_}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new p(e)));return g(t,{code:l.invalid_union,unionErrors:a}),_}}get options(){return this._def.options}}ve.create=(e,t)=>new ve({options:e,typeName:Ke.ZodUnion,...j(t)});const _e=e=>e instanceof Se?_e(e.schema):e instanceof Ne?_e(e.innerType()):e instanceof Ce?[e.value]:e instanceof Ae?e.options:e instanceof Ee?a.objectValues(e.enum):e instanceof ze?_e(e._def.innerType):e instanceof ue?[void 0]:e instanceof ce?[null]:e instanceof Re?[void 0,..._e(e.unwrap())]:e instanceof Me?[null,..._e(e.unwrap())]:e instanceof Ue||e instanceof $e?_e(e.unwrap()):e instanceof De?_e(e._def.innerType):[];class be extends N{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return g(t,{code:l.invalid_type,expected:u.object,received:t.parsedType}),_;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:l.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=_e(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new be({typeName:Ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...j(n)})}}function Pe(e,t){const n=c(e),r=c(t);if(e===t)return{valid:!0,data:e};if(n===u.object&&r===u.object){const n=a.objectKeys(t),r=a.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const r=Pe(e[n],t[n]);if(!r.valid)return{valid:!1};s[n]=r.data}return{valid:!0,data:s}}if(n===u.array&&r===u.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=Pe(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===u.date&&r===u.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ke extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(k(e)||k(r))return _;const a=Pe(e.value,r.value);return a.valid?((w(e)||w(r))&&t.dirty(),{status:t.value,value:a.data}):(g(n,{code:l.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ke.create=(e,t,n)=>new ke({left:e,right:t,typeName:Ke.ZodIntersection,...j(n)});class we extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.array)return g(n,{code:l.invalid_type,expected:u.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return g(n,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new A(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>v.mergeArray(t,e))):v.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new we({...this._def,rest:e})}}we.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:e,typeName:Ke.ZodTuple,rest:null,...j(t)})};class Ie extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.object)return g(n,{code:l.invalid_type,expected:u.object,received:n.parsedType}),_;const r=[],a=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new A(n,e,n.path,e)),value:s._parse(new A(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?v.mergeObjectAsync(t,r):v.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ie(t instanceof N?{keyType:e,valueType:t,typeName:Ke.ZodRecord,...j(n)}:{keyType:ne.create(),valueType:e,typeName:Ke.ZodRecord,...j(t)})}}class xe extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.map)return g(n,{code:l.invalid_type,expected:u.map,received:n.parsedType}),_;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new A(n,e,n.path,[s,"key"])),value:a._parse(new A(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return _;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return _;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}xe.create=(e,t,n)=>new xe({valueType:t,keyType:e,typeName:Ke.ZodMap,...j(n)});class Oe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.set)return g(n,{code:l.invalid_type,expected:u.set,received:n.parsedType}),_;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(g(n,{code:l.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(g(n,{code:l.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return _;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new A(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new Oe({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new Oe({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Oe.create=(e,t)=>new Oe({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...j(t)});class Te extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return g(t,{code:l.invalid_type,expected:u.function,received:t.parsedType}),_;function n(e,n){return y({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),h].filter((e=>!!e)),issueData:{code:l.invalid_arguments,argumentsError:n}})}function r(e,n){return y({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),h].filter((e=>!!e)),issueData:{code:l.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof je){const e=this;return P((async function(...t){const i=new p([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw i.addIssue(r(d,e)),i}))}))}{const e=this;return P((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new p([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new p([r(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Te({...this._def,args:we.create(e).rest(pe.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,n){return new Te({args:e||we.create([]).rest(pe.create()),returns:t||pe.create(),typeName:Ke.ZodFunction,...j(n)})}}class Se extends N{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})}}Se.create=(e,t)=>new Se({getter:e,typeName:Ke.ZodLazy,...j(t)});class Ce extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:l.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ze(e,t){return new Ae({values:e,typeName:Ke.ZodEnum,...j(t)})}Ce.create=(e,t)=>new Ce({value:e,typeName:Ke.ZodLiteral,...j(t)});class Ae extends N{constructor(){super(...arguments),C.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return g(t,{expected:a.joinValues(n),received:t.parsedType,code:l.invalid_type}),_}if(O(this,C,"f")||T(this,C,new Set(this._def.values),"f"),!O(this,C,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return g(t,{received:t.data,code:l.invalid_enum_value,options:n}),_}return P(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 Ae.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ae.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}C=new WeakMap,Ae.create=Ze;class Ee extends N{constructor(){super(...arguments),Z.set(this,void 0)}_parse(e){const t=a.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==u.string&&n.parsedType!==u.number){const e=a.objectValues(t);return g(n,{expected:a.joinValues(e),received:n.parsedType,code:l.invalid_type}),_}if(O(this,Z,"f")||T(this,Z,new Set(a.getValidEnumValues(this._def.values)),"f"),!O(this,Z,"f").has(e.data)){const e=a.objectValues(t);return g(n,{received:n.data,code:l.invalid_enum_value,options:e}),_}return P(e.data)}get enum(){return this._def.values}}Z=new WeakMap,Ee.create=(e,t)=>new Ee({values:e,typeName:Ke.ZodNativeEnum,...j(t)});class je extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return g(t,{code:l.invalid_type,expected:u.promise,received:t.parsedType}),_;const n=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return P(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}je.create=(e,t)=>new je({type:e,typeName:Ke.ZodPromise,...j(t)});class Ne extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{g(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return _;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}));{if("aborted"===t.value)return _;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?_:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!I(e))return e;const a=r.transform(e.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>I(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}a.assertNever(r)}}Ne.create=(e,t,n)=>new Ne({schema:e,typeName:Ke.ZodEffects,effect:t,...j(n)}),Ne.createWithPreprocess=(e,t,n)=>new Ne({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...j(n)});class Re extends N{_parse(e){return this._getType(e)===u.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:Ke.ZodOptional,...j(t)});class Me extends N{_parse(e){return this._getType(e)===u.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:Ke.ZodNullable,...j(t)});class ze extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===u.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ze.create=(e,t)=>new ze({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class De extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return x(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new p(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class Fe extends N{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return g(t,{code:l.invalid_type,expected:u.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}Fe.create=e=>new Fe({typeName:Ke.ZodNaN,...j(e)});const Le=Symbol("zod_brand");class Ue extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ve extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),b(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Ve({in:e,out:t,typeName:Ke.ZodPipeline})}}class $e extends N{_parse(e){const t=this._def.innerType._parse(e),n=e=>(I(e)&&(e.value=Object.freeze(e.value)),e);return x(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Be(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function We(e,t={},n){return e?le.create().superRefine(((r,a)=>{var s,i;const o=e(r);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Be(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Be(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):le.create()}$e.create=(e,t)=>new $e({innerType:e,typeName:Ke.ZodReadonly,...j(t)});const qe={object:ge.lazycreate};var Ke;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ke||(Ke={}));const He=ne.create,Ye=ae.create,Ge=Fe.create,Je=se.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ue.create,nt=ce.create,rt=le.create,at=pe.create,st=he.create,it=me.create,ot=fe.create,dt=ge.create,ut=ge.strictCreate,ct=ve.create,lt=be.create,pt=ke.create,ht=we.create,mt=Ie.create,ft=xe.create,yt=Oe.create,gt=Te.create,vt=Se.create,_t=Ce.create,bt=Ae.create,Pt=Ee.create,kt=je.create,wt=Ne.create,It=Re.create,xt=Me.create,Ot=Ne.createWithPreprocess,Tt=Ve.create,St={string:e=>ne.create({...e,coerce:!0}),number:e=>ae.create({...e,coerce:!0}),boolean:e=>ie.create({...e,coerce:!0}),bigint:e=>se.create({...e,coerce:!0}),date:e=>oe.create({...e,coerce:!0})},Ct=_;var Zt=Object.freeze({__proto__:null,defaultErrorMap:h,setErrorMap:function(e){m=e},getErrorMap:f,makeIssue:y,EMPTY_PATH:[],addIssueToContext:g,ParseStatus:v,INVALID:_,DIRTY:b,OK:P,isAborted:k,isDirty:w,isValid:I,isAsync:x,get util(){return a},get objectUtil(){return s},ZodParsedType:u,getParsedType:c,ZodType:N,datetimeRegex:Q,ZodString:ne,ZodNumber:ae,ZodBigInt:se,ZodBoolean:ie,ZodDate:oe,ZodSymbol:de,ZodUndefined:ue,ZodNull:ce,ZodAny:le,ZodUnknown:pe,ZodNever:he,ZodVoid:me,ZodArray:fe,ZodObject:ge,ZodUnion:ve,ZodDiscriminatedUnion:be,ZodIntersection:ke,ZodTuple:we,ZodRecord:Ie,ZodMap:xe,ZodSet:Oe,ZodFunction:Te,ZodLazy:Se,ZodLiteral:Ce,ZodEnum:Ae,ZodNativeEnum:Ee,ZodPromise:je,ZodEffects:Ne,ZodTransformer:Ne,ZodOptional:Re,ZodNullable:Me,ZodDefault:ze,ZodCatch:De,ZodNaN:Fe,BRAND:Le,ZodBranded:Ue,ZodPipeline:Ve,ZodReadonly:$e,custom:We,Schema:N,ZodSchema:N,late:qe,get ZodFirstPartyTypeKind(){return Ke},coerce:St,any:rt,array:ot,bigint:Je,boolean:Xe,date:Qe,discriminatedUnion:lt,effect:wt,enum:bt,function:gt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>We((t=>t instanceof e),t),intersection:pt,lazy:vt,literal:_t,map:ft,nan:Ge,nativeEnum:Pt,never:st,null:nt,nullable:xt,number:Ye,object:dt,oboolean:()=>Xe().optional(),onumber:()=>Ye().optional(),optional:It,ostring:()=>He().optional(),pipeline:Tt,preprocess:Ot,promise:kt,record:mt,set:yt,strictObject:ut,string:He,symbol:et,transformer:wt,tuple:ht,undefined:tt,union:ct,unknown:at,void:it,NEVER:Ct,ZodIssueCode:l,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:p});function At(e){return e instanceof Promise||"function"==typeof e?.then&&"function"==typeof e?.catch}function Et(e){return e.map((({message:e,path:t})=>`- ${e}`+(t.length?` at given${function(e){return e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}(t)}`:""))).join("\n")}const jt=(e,t)=>{throw new d("Schema validation에 실패했습니다.\n"+Et(t),{errors:t})},Nt=e=>(t,n)=>{throw new d("Input schema validation에 실패했습니다.\n"+Et(n)+`\nat ${e}`,{errors:n})},Rt=e=>(t,n)=>{throw new d("Output schema validation에 실패했습니다.\n"+Et(n)+`\nat ${e}`,{errors:n})};function Mt(e,t=jt){return n=>{const r=e.safeParse(n);if(!r.success){const e=r.error.errors;if("string"==typeof t)throw new d(t,{errors:e});return t(n,e)}return r.data}}function zt(e,t=jt){return n=>{Mt(e,t)(n)}}function Dt(e,t=Zt.any(),n){try{return Mt(t,n)(JSON.parse(e))}catch(t){if(t instanceof SyntaxError){if("function"==typeof n)return n(e,[]);if("string"==typeof n)throw new o(n,{cause:t})}throw t}}const Ft={Arguments:function(...e){return(t,n,r)=>{const a=r.value,s=Zt.tuple(e);r.value=function(...e){const r=Mt(s,Nt(`${t.constructor.name}.${String(n)}`))(e);return a.apply(this,r)}}},Return:function(e){let t;return t=Array.isArray(e)?e.length>=2?Zt.union(e):e[0]:e,(e,n,r)=>{const a=r.value;r.value=function(...r){const s=a.apply(this,r),i=Mt(t,Rt(`${e.constructor.name}.${String(n)}`));return At(s)?s.then(i):i(s)}}}};function Lt(e,t,n){return function(...r){const a=null==n?t:n,s=a.name||"anonymous",i=null==n?Zt.any():t;Array.isArray(e)||(e=[e]);const o=Mt(Zt.tuple(e),Nt(s))(r),d=a.apply(this,o);return At(d)?d.then(Mt(i,Rt(s))):Mt(i,Rt(s))(d)}}},2615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CashReceiptSchema=void 0;const r=n(8211);t.CashReceiptSchema=r.z.object({orderId:r.z.string(),amount:r.z.number(),issueDate:r.z.string(),issueNumber:r.z.string(),cardNumber:r.z.string()})},5236:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCatalogCategorySchema=void 0;const r=n(8211),a=n(3041);t.PluginCatalogCategorySchema=r.z.object({id:r.z.number(),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).optional()})},8963:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7889:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9414:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCatalogItemOptionChoiceSchema=void 0;const r=n(8211),a=n(3041);t.PluginCatalogItemOptionChoiceSchema=r.z.object({id:r.z.number(),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).optional(),priceValue:r.z.number(),imageUrl:r.z.string().nullable().optional(),state:r.z.enum(["ON_SALE","SOLD_OUT"])})},6738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3340:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDeliverySchema=t.DeliveryPaymentMethodSchema=t.PickupStatusSchema=t.DeliveryStatusSchema=void 0;const r=n(8211);t.DeliveryStatusSchema=r.z.enum(["NEW","ACCEPTED","REJECTED","PARTIALLY_CANCELLED","CANCELLED","RIDER_ASSIGNED","RIDER_ARRIVED_SHOP","RIDER_PICKUP_COMPLETED","DONE"]),t.PickupStatusSchema=r.z.enum(["NEW","ACCEPTED","REJECTED","PARTIALLY_CANCELLED","CANCELLED","DONE"]),t.DeliveryPaymentMethodSchema=r.z.enum(["PAID","MEET_CARD","MEET_CASH","ETC"]);const a=r.z.object({deliveryType:r.z.enum(["DELIVERY_COMPANY","STORE"]),serviceName:r.z.string(),orderAt:r.z.string(),icon:r.z.string(),preparationTimeMin:r.z.number().optional(),deliveryId:r.z.string(),origin:r.z.string().optional(),shop:r.z.object({id:r.z.string(),name:r.z.string()}),paymentMethod:t.DeliveryPaymentMethodSchema,customerChargedPrice:r.z.number()}),s=a.extend({type:r.z.literal("DELIVERY"),memo:r.z.object({store:r.z.string().optional(),delivery:r.z.string().optional()}).optional(),address:r.z.object({road:r.z.string().optional(),lot:r.z.string().optional()}).optional(),phone:r.z.string().optional(),deliveryStatus:t.DeliveryStatusSchema}),i=a.extend({type:r.z.literal("PICKUP"),memo:r.z.object({store:r.z.string().optional()}).optional(),pickUpId:r.z.string(),phone:r.z.string().optional(),pickupStatus:t.PickupStatusSchema});t.PluginDeliverySchema=r.z.discriminatedUnion("type",[i,s])},5245:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5384:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6303:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7859:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2529:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8264:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2066:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginHttpRequestSchema=t.HttpRequestSchema=void 0;const r=n(8211),a=r.z.enum(["GET","POST","DELETE","HEAD","OPTIONS","PUT","PATCH"]);t.HttpRequestSchema=r.z.object({method:a,payload:r.z.any().nullable().optional(),headers:r.z.array(r.z.tuple([r.z.string(),r.z.string()]))}),t.PluginHttpRequestSchema=t.HttpRequestSchema.extend({url:r.z.string()})},9594:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderState=t.PluginOrderItemSchema=t.PluginOrderItem=t.PluginOrderDiningOption=t.PluginOrderDtoSchema=t.PluginOrderDto=t.PluginOrderSchema=t.PluginOrder=t.PluginDeliveryOrderDtoSchema=t.PluginDeliveryOrderDto=t.PluginMessageResponse=t.PluginMessageNames=t.PluginMessage=t.FromWorkerMessage=t.FromWebviewMessage=t.TossMerchant=t.PluginLanguagePack=t.PluginHttpResponse=t.PluginHttpRequestSchema=t.PluginHttpRequest=t.HttpRequestSchema=t.HttpMethod=t.MapStringToType=t.FFIApiReturn=t.FFIApiParams=t.ExtractApiNameWithParams=t.ExtractApiNameWithNoParams=t.FFILibrary=t.FFIFunctionReturn=t.FFIFunctionParam=t.FFIFunctionOptions=t.FFIFunction=t.FFIApi=t.FFIAbiType=t.DeliveryConnectionStatus=t.PluginDelivery=t.PickupStatus=t.DeliveryStatus=t.PluginCatalogItemPriceType=t.PluginCatalogItemPrice=t.PluginCatalogItemOptionChoiceSchema=t.PluginCatalogItemOptionChoice=t.PluginCatalogItemOption=t.CatalogItemOptionChoiceState=t.PluginCatalogItemLabel=t.PluginCatalogItemDto=t.PluginCatalogItem=t.PluginCatalogCategory=t.CashReceiptSchema=t.CashReceipt=void 0,t.hasCallbackId=t.PopupElements=t.PopupActionResponse=t.BarcodeResponseSchema=t.BarcodeElementsSchema=t.AllPopupType=t.AllPopupResponseSchema=t.AllPopupElementsSchema=t.AlertResponseSchema=t.AlertElementsSchema=t.PluginTableSchema=t.PluginTableGroupSchema=t.PluginTableGroup=t.PluginTable=t.PluginHallSchema=t.PluginHall=t.PluginSettingForm=t.PluginInputType=t.PluginInput=t.PluginServerOnHttpRequest=t.PluginPaymentSourceType=t.PluginPaymentInstallment=t.PluginPaymentDtoSchema=t.PluginPaymentDto=t.PluginCancelledPaymentDto=t.PluginPaymentStateSchema=t.PluginPaymentState=t.PluginPaymentBaseSchema=t.PluginPaymentBase=t.PluginPaymentOf=t.PluginPayment=t.PluginExternalPayment=t.PluginCashReceiptSchema=t.PluginCashReceiptIssuerTypeSchema=t.PluginCashReceiptIssuerType=t.PluginCashReceiptIssuanceTypeSchema=t.PluginCashReceiptIssuanceType=t.PluginCashReceipt=t.PluginCashPayment=t.VanTypeSchema=t.VanType=t.PluginPaymentCardTypeSchema=t.PluginPaymentCardType=t.PluginCardPaymentSchema=t.PluginCardPayment=t.PluginPrice=t.PaymentMethodResponse=t.ExternalPaymentMethodResponse=t.PluginDiscount=void 0;var r=n(2615);Object.defineProperty(t,"CashReceipt",{enumerable:!0,get:function(){return r.CashReceipt}}),Object.defineProperty(t,"CashReceiptSchema",{enumerable:!0,get:function(){return r.CashReceiptSchema}});var a=n(5236);Object.defineProperty(t,"PluginCatalogCategory",{enumerable:!0,get:function(){return a.PluginCatalogCategory}});var s=n(8963);Object.defineProperty(t,"PluginCatalogItem",{enumerable:!0,get:function(){return s.PluginCatalogItem}}),Object.defineProperty(t,"PluginCatalogItemDto",{enumerable:!0,get:function(){return s.PluginCatalogItemDto}});var i=n(7889);Object.defineProperty(t,"PluginCatalogItemLabel",{enumerable:!0,get:function(){return i.PluginCatalogItemLabel}});var o=n(9414);Object.defineProperty(t,"CatalogItemOptionChoiceState",{enumerable:!0,get:function(){return o.CatalogItemOptionChoiceState}}),Object.defineProperty(t,"PluginCatalogItemOption",{enumerable:!0,get:function(){return o.PluginCatalogItemOption}}),Object.defineProperty(t,"PluginCatalogItemOptionChoice",{enumerable:!0,get:function(){return o.PluginCatalogItemOptionChoice}}),Object.defineProperty(t,"PluginCatalogItemOptionChoiceSchema",{enumerable:!0,get:function(){return o.PluginCatalogItemOptionChoiceSchema}});var d=n(6738);Object.defineProperty(t,"PluginCatalogItemPrice",{enumerable:!0,get:function(){return d.PluginCatalogItemPrice}}),Object.defineProperty(t,"PluginCatalogItemPriceType",{enumerable:!0,get:function(){return d.PluginCatalogItemPriceType}});var u=n(3340);Object.defineProperty(t,"DeliveryStatus",{enumerable:!0,get:function(){return u.DeliveryStatus}}),Object.defineProperty(t,"PickupStatus",{enumerable:!0,get:function(){return u.PickupStatus}}),Object.defineProperty(t,"PluginDelivery",{enumerable:!0,get:function(){return u.PluginDelivery}});var c=n(5245);Object.defineProperty(t,"DeliveryConnectionStatus",{enumerable:!0,get:function(){return c.DeliveryConnectionStatus}});var l=n(5384);Object.defineProperty(t,"FFIAbiType",{enumerable:!0,get:function(){return l.FFIAbiType}}),Object.defineProperty(t,"FFIApi",{enumerable:!0,get:function(){return l.FFIApi}}),Object.defineProperty(t,"FFIFunction",{enumerable:!0,get:function(){return l.FFIFunction}}),Object.defineProperty(t,"FFIFunctionOptions",{enumerable:!0,get:function(){return l.FFIFunctionOptions}}),Object.defineProperty(t,"FFIFunctionParam",{enumerable:!0,get:function(){return l.FFIFunctionParam}}),Object.defineProperty(t,"FFIFunctionReturn",{enumerable:!0,get:function(){return l.FFIFunctionReturn}});var p=n(6303);Object.defineProperty(t,"FFILibrary",{enumerable:!0,get:function(){return p.FFILibrary}});var h=n(7859);Object.defineProperty(t,"ExtractApiNameWithNoParams",{enumerable:!0,get:function(){return h.ExtractApiNameWithNoParams}}),Object.defineProperty(t,"ExtractApiNameWithParams",{enumerable:!0,get:function(){return h.ExtractApiNameWithParams}});var m=n(2529);Object.defineProperty(t,"FFIApiParams",{enumerable:!0,get:function(){return m.FFIApiParams}});var f=n(8264);Object.defineProperty(t,"FFIApiReturn",{enumerable:!0,get:function(){return f.FFIApiReturn}});var y=n(2066);Object.defineProperty(t,"MapStringToType",{enumerable:!0,get:function(){return y.MapStringToType}});var g=n(407);Object.defineProperty(t,"HttpMethod",{enumerable:!0,get:function(){return g.HttpMethod}}),Object.defineProperty(t,"HttpRequestSchema",{enumerable:!0,get:function(){return g.HttpRequestSchema}}),Object.defineProperty(t,"PluginHttpRequest",{enumerable:!0,get:function(){return g.PluginHttpRequest}}),Object.defineProperty(t,"PluginHttpRequestSchema",{enumerable:!0,get:function(){return g.PluginHttpRequestSchema}}),Object.defineProperty(t,"PluginHttpResponse",{enumerable:!0,get:function(){return g.PluginHttpResponse}});var v=n(5269);Object.defineProperty(t,"PluginLanguagePack",{enumerable:!0,get:function(){return v.PluginLanguagePack}});var _=n(4763);Object.defineProperty(t,"TossMerchant",{enumerable:!0,get:function(){return _.TossMerchant}});var b=n(4992);Object.defineProperty(t,"FromWebviewMessage",{enumerable:!0,get:function(){return b.FromWebviewMessage}}),Object.defineProperty(t,"FromWorkerMessage",{enumerable:!0,get:function(){return b.FromWorkerMessage}}),Object.defineProperty(t,"PluginMessage",{enumerable:!0,get:function(){return b.PluginMessage}}),Object.defineProperty(t,"PluginMessageNames",{enumerable:!0,get:function(){return b.PluginMessageNames}}),Object.defineProperty(t,"PluginMessageResponse",{enumerable:!0,get:function(){return b.PluginMessageResponse}});var P=n(4655);Object.defineProperty(t,"PluginDeliveryOrderDto",{enumerable:!0,get:function(){return P.PluginDeliveryOrderDto}}),Object.defineProperty(t,"PluginDeliveryOrderDtoSchema",{enumerable:!0,get:function(){return P.PluginDeliveryOrderDtoSchema}});var k=n(9068);Object.defineProperty(t,"PluginOrder",{enumerable:!0,get:function(){return k.PluginOrder}}),Object.defineProperty(t,"PluginOrderSchema",{enumerable:!0,get:function(){return k.PluginOrderSchema}});var w=n(5287);Object.defineProperty(t,"PluginOrderDto",{enumerable:!0,get:function(){return w.PluginOrderDto}}),Object.defineProperty(t,"PluginOrderDtoSchema",{enumerable:!0,get:function(){return w.PluginOrderDtoSchema}});var I=n(7615);Object.defineProperty(t,"PluginOrderDiningOption",{enumerable:!0,get:function(){return I.PluginOrderDiningOption}}),Object.defineProperty(t,"PluginOrderItem",{enumerable:!0,get:function(){return I.PluginOrderItem}}),Object.defineProperty(t,"PluginOrderItemSchema",{enumerable:!0,get:function(){return I.PluginOrderItemSchema}});var x=n(6191);Object.defineProperty(t,"PluginOrderState",{enumerable:!0,get:function(){return x.PluginOrderState}});var O=n(5513);Object.defineProperty(t,"PluginDiscount",{enumerable:!0,get:function(){return O.PluginDiscount}});var T=n(8375);Object.defineProperty(t,"ExternalPaymentMethodResponse",{enumerable:!0,get:function(){return T.ExternalPaymentMethodResponse}}),Object.defineProperty(t,"PaymentMethodResponse",{enumerable:!0,get:function(){return T.PaymentMethodResponse}});var S=n(9339);Object.defineProperty(t,"PluginPrice",{enumerable:!0,get:function(){return S.PluginPrice}});var C=n(2874);Object.defineProperty(t,"PluginCardPayment",{enumerable:!0,get:function(){return C.PluginCardPayment}}),Object.defineProperty(t,"PluginCardPaymentSchema",{enumerable:!0,get:function(){return C.PluginCardPaymentSchema}}),Object.defineProperty(t,"PluginPaymentCardType",{enumerable:!0,get:function(){return C.PluginPaymentCardType}}),Object.defineProperty(t,"PluginPaymentCardTypeSchema",{enumerable:!0,get:function(){return C.PluginPaymentCardTypeSchema}}),Object.defineProperty(t,"VanType",{enumerable:!0,get:function(){return C.VanType}}),Object.defineProperty(t,"VanTypeSchema",{enumerable:!0,get:function(){return C.VanTypeSchema}});var Z=n(6113);Object.defineProperty(t,"PluginCashPayment",{enumerable:!0,get:function(){return Z.PluginCashPayment}});var A=n(3307);Object.defineProperty(t,"PluginCashReceipt",{enumerable:!0,get:function(){return A.PluginCashReceipt}}),Object.defineProperty(t,"PluginCashReceiptIssuanceType",{enumerable:!0,get:function(){return A.PluginCashReceiptIssuanceType}}),Object.defineProperty(t,"PluginCashReceiptIssuanceTypeSchema",{enumerable:!0,get:function(){return A.PluginCashReceiptIssuanceTypeSchema}}),Object.defineProperty(t,"PluginCashReceiptIssuerType",{enumerable:!0,get:function(){return A.PluginCashReceiptIssuerType}}),Object.defineProperty(t,"PluginCashReceiptIssuerTypeSchema",{enumerable:!0,get:function(){return A.PluginCashReceiptIssuerTypeSchema}}),Object.defineProperty(t,"PluginCashReceiptSchema",{enumerable:!0,get:function(){return A.PluginCashReceiptSchema}});var E=n(4665);Object.defineProperty(t,"PluginExternalPayment",{enumerable:!0,get:function(){return E.PluginExternalPayment}});var j=n(80);Object.defineProperty(t,"PluginPayment",{enumerable:!0,get:function(){return j.PluginPayment}}),Object.defineProperty(t,"PluginPaymentOf",{enumerable:!0,get:function(){return j.PluginPaymentOf}});var N=n(677);Object.defineProperty(t,"PluginPaymentBase",{enumerable:!0,get:function(){return N.PluginPaymentBase}}),Object.defineProperty(t,"PluginPaymentBaseSchema",{enumerable:!0,get:function(){return N.PluginPaymentBaseSchema}}),Object.defineProperty(t,"PluginPaymentState",{enumerable:!0,get:function(){return N.PluginPaymentState}}),Object.defineProperty(t,"PluginPaymentStateSchema",{enumerable:!0,get:function(){return N.PluginPaymentStateSchema}});var R=n(5147);Object.defineProperty(t,"PluginCancelledPaymentDto",{enumerable:!0,get:function(){return R.PluginCancelledPaymentDto}}),Object.defineProperty(t,"PluginPaymentDto",{enumerable:!0,get:function(){return R.PluginPaymentDto}}),Object.defineProperty(t,"PluginPaymentDtoSchema",{enumerable:!0,get:function(){return R.PluginPaymentDtoSchema}});var M=n(8865);Object.defineProperty(t,"PluginPaymentInstallment",{enumerable:!0,get:function(){return M.PluginPaymentInstallment}});var z=n(6397);Object.defineProperty(t,"PluginPaymentSourceType",{enumerable:!0,get:function(){return z.PluginPaymentSourceType}});var D=n(5720);Object.defineProperty(t,"PluginServerOnHttpRequest",{enumerable:!0,get:function(){return D.PluginServerOnHttpRequest}});var F=n(5272);Object.defineProperty(t,"PluginInput",{enumerable:!0,get:function(){return F.PluginInput}}),Object.defineProperty(t,"PluginInputType",{enumerable:!0,get:function(){return F.PluginInputType}}),Object.defineProperty(t,"PluginSettingForm",{enumerable:!0,get:function(){return F.PluginSettingForm}});var L=n(6193);Object.defineProperty(t,"PluginHall",{enumerable:!0,get:function(){return L.PluginHall}}),Object.defineProperty(t,"PluginHallSchema",{enumerable:!0,get:function(){return L.PluginHallSchema}});var U=n(692);Object.defineProperty(t,"PluginTable",{enumerable:!0,get:function(){return U.PluginTable}}),Object.defineProperty(t,"PluginTableGroup",{enumerable:!0,get:function(){return U.PluginTableGroup}}),Object.defineProperty(t,"PluginTableGroupSchema",{enumerable:!0,get:function(){return U.PluginTableGroupSchema}}),Object.defineProperty(t,"PluginTableSchema",{enumerable:!0,get:function(){return U.PluginTableSchema}});var V=n(8759);Object.defineProperty(t,"AlertElementsSchema",{enumerable:!0,get:function(){return V.AlertElementsSchema}}),Object.defineProperty(t,"AlertResponseSchema",{enumerable:!0,get:function(){return V.AlertResponseSchema}}),Object.defineProperty(t,"AllPopupElementsSchema",{enumerable:!0,get:function(){return V.AllPopupElementsSchema}}),Object.defineProperty(t,"AllPopupResponseSchema",{enumerable:!0,get:function(){return V.AllPopupResponseSchema}}),Object.defineProperty(t,"AllPopupType",{enumerable:!0,get:function(){return V.AllPopupType}}),Object.defineProperty(t,"BarcodeElementsSchema",{enumerable:!0,get:function(){return V.BarcodeElementsSchema}}),Object.defineProperty(t,"BarcodeResponseSchema",{enumerable:!0,get:function(){return V.BarcodeResponseSchema}}),Object.defineProperty(t,"PopupActionResponse",{enumerable:!0,get:function(){return V.PopupActionResponse}}),Object.defineProperty(t,"PopupElements",{enumerable:!0,get:function(){return V.PopupElements}});var $=n(5478);Object.defineProperty(t,"hasCallbackId",{enumerable:!0,get:function(){return $.hasCallbackId}})},2817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5269:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginLanguagePackSchema=void 0;const r=n(8211);t.PluginLanguagePackSchema=r.z.object({languages:r.z.record(r.z.string(),r.z.string())})},3041:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(5269),t),a(n(2817),t)},4763:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDeliveryOrderDtoSchema=void 0;const r=n(8211),a=n(3340),s=n(5287),i=n(7615);t.PluginDeliveryOrderDtoSchema=s.PluginOrderDtoSchema.extend({delivery:a.PluginDeliverySchema,lineItems:r.z.array(i.PluginOrderItemSchema.omit({id:!0,orderId:!0,item:!0,optionChoices:!0}).extend({item:r.z.object({title:r.z.string(),type:r.z.enum(["ITEM","DELIVERY_FEE"])}),optionChoices:r.z.array(r.z.object({title:r.z.string(),priceValue:r.z.number()}))}))})},9068:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderSchema=t.PluginOrderRequestInfoSchema=t.PluginOrderPaymentPriceSchema=t.PluginOrderChargePriceSchema=void 0;const r=n(5513),a=n(7615),s=n(692),i=n(80),o=n(8211);t.PluginOrderChargePriceSchema=o.z.object({chargeDiscountValue:o.z.number(),chargeListPriceValue:o.z.number(),chargePriceValue:o.z.number(),chargeSupplyValue:o.z.number(),chargeTaxValue:o.z.number(),chargeTipValue:o.z.number()}),t.PluginOrderPaymentPriceSchema=o.z.object({paymentUnpaidValue:o.z.number(),paymentPaidValue:o.z.number()}),t.PluginOrderRequestInfoSchema=o.z.object({requestAt:o.z.string(),expiredAt:o.z.string(),expectedReadyAt:o.z.string(),estimatedReadyAt:o.z.string().nullable().optional(),acceptedAt:o.z.string().nullable().optional(),declinedAt:o.z.string().nullable().optional(),declinedReason:o.z.string().nullable().optional()}),t.PluginOrderSchema=o.z.object({id:o.z.string(),tableId:o.z.number().nullable().optional(),table:o.z.lazy((()=>s.PluginTableSchema)).nullable().optional(),orderKey:o.z.string(),state:o.z.enum(["OPENED","PAID","CANCELLED","COMPLETED","REFUNDED"]),lineItems:o.z.array(o.z.lazy((()=>a.PluginOrderItemSchema))),discounts:o.z.array(o.z.lazy((()=>r.PluginDiscountSchema))).nullable().optional(),payments:o.z.array(o.z.lazy((()=>i.PluginPaymentSchema))),chargePrice:o.z.lazy((()=>t.PluginOrderChargePriceSchema)),paymentPrice:o.z.lazy((()=>t.PluginOrderPaymentPriceSchema)),requestedInfo:o.z.lazy((()=>t.PluginOrderRequestInfoSchema)).nullable().optional(),source:o.z.string(),memo:o.z.string().nullable().optional(),openedAt:o.z.string().nullable().optional(),createdAt:o.z.string(),updatedAt:o.z.string().nullable().optional(),cancelledAt:o.z.string().nullable().optional(),completedAt:o.z.string().nullable().optional()})},5287:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderDtoSchema=void 0;const r=n(8211),a=n(7615),s=n(5513);t.PluginOrderDtoSchema=r.z.object({memo:r.z.string().optional(),discounts:r.z.array(s.PluginDiscountSchema),tableId:r.z.number().optional(),lineItems:r.z.array(a.PluginOrderItemSchema.omit({id:!0,orderId:!0}))})},7615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderItemSchema=void 0;const r=n(8211),a=n(5513),s=n(9414),i=n(5236);t.PluginOrderItemSchema=r.z.object({id:r.z.string(),orderId:r.z.string(),diningOption:r.z.enum(["HERE","TOGO","DELIVERY","PICKUP"]),item:r.z.object({id:r.z.number(),title:r.z.string(),category:r.z.lazy((()=>i.PluginCatalogCategorySchema)),type:r.z.enum(["ITEM","DELIVERY_FEE","PREPAID_CARD"])}),quantity:r.z.object({value:r.z.number()}),chargePrice:r.z.object({value:r.z.number()}),optionChoices:r.z.array(r.z.lazy((()=>s.PluginCatalogItemOptionChoiceSchema))),discounts:r.z.array(r.z.lazy((()=>a.PluginDiscountSchema))).optional(),memo:r.z.string().optional()})},6191:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5513:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDiscountSchema=void 0;const r=n(8211),a=n(3041);t.PluginDiscountSchema=r.z.object({amountMoney:r.z.object({value:r.z.number()}),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).optional()})},8375:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9339:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2874:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCardDetailsSchema=t.PluginCardPaymentSchema=t.PluginPaymentCardTypeSchema=t.VanTypeSchema=void 0;const r=n(8211),a=n(677);t.VanTypeSchema=r.z.enum(["NICE","KIS","SMARTRO","KOVAN"]),t.PluginPaymentCardTypeSchema=r.z.enum(["CREDIT","DEBIT","PREPAID","FOREIGN"]),t.PluginCardPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("CARD"),cardDetails:r.z.lazy((()=>t.PluginCardDetailsSchema))}),t.PluginCardDetailsSchema=r.z.object({installmentMonth:r.z.string().max(2),cardType:t.PluginPaymentCardTypeSchema,cardBrand:r.z.string(),cardBrandId:r.z.string().nullable().optional(),cardNo:r.z.string().refine((e=>e.length>=12),{message:"카드번호는 최소 12자리여야합니다"}),source:r.z.string().nullable().optional(),sourceId:r.z.string().nullable().optional(),balance:r.z.number().nullable().optional(),van:t.VanTypeSchema.nullable().optional()})},6113:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCashPaymentSchema=void 0;const r=n(8211),a=n(677);t.PluginCashPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("CASH")})},3307:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCashReceiptSchema=t.PluginCashReceiptIssuanceTypeSchema=t.PluginCashReceiptIssuerTypeSchema=void 0;const r=n(8211);t.PluginCashReceiptIssuerTypeSchema=r.z.enum(["CONSUMER","BUSINESSES"]),t.PluginCashReceiptIssuanceTypeSchema=r.z.enum(["PHONE","BUSINESS_NUMBER","CARD"]),t.PluginCashReceiptSchema=r.z.object({identityNumber:r.z.string(),issuerType:t.PluginCashReceiptIssuerTypeSchema,issuanceType:t.PluginCashReceiptIssuanceTypeSchema,selfIssuance:r.z.boolean()})},4665:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginExternalPaymentSchema=void 0;const r=n(8211),a=n(677);t.PluginExternalPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("EXTERNAL"),externalDetails:r.z.object({source:r.z.string().nullable().optional(),sourceId:r.z.string().nullable().optional()})})},80:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentSchema=void 0;const r=n(8211),a=n(2874),s=n(6113),i=n(4665);t.PluginPaymentSchema=r.z.object({paymentKey:r.z.string()}).and(r.z.discriminatedUnion("sourceType",[a.PluginCardPaymentSchema,s.PluginCashPaymentSchema,i.PluginExternalPaymentSchema]))},677:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentBaseSchema=t.PluginPaymentStateSchema=void 0;const r=n(8211);t.PluginPaymentStateSchema=r.z.enum(["APPROVED","COMPLETED","CANCELLED"]),t.PluginPaymentBaseSchema=r.z.object({id:r.z.string(),orderId:r.z.string(),state:t.PluginPaymentStateSchema,sourceType:r.z.custom(),amountMoney:r.z.number(),taxMoney:r.z.number(),supplyMoney:r.z.number(),tipMoney:r.z.number(),taxExemptMoney:r.z.number().nullable().optional(),approvedNo:r.z.string(),approvedAt:r.z.string(),cancelledAt:r.z.string().nullable().optional(),cashReceipt:r.z.custom().nullable().optional()})},5147:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentDtoSchema=void 0;const r=n(8211),a=n(3307),s=n(2874),i=r.z.object({orderId:r.z.string(),sourceType:r.z.custom(),amountMoney:r.z.number(),taxMoney:r.z.number(),approvedNo:r.z.string(),approvedAt:r.z.string(),paymentKey:r.z.string(),supplyMoney:r.z.number(),tipMoney:r.z.number(),taxExemptMoney:r.z.number().nullable().optional()}),o=i.extend({sourceType:r.z.literal("CARD"),cardDetails:r.z.lazy((()=>s.PluginCardDetailsSchema))}),d=i.extend({sourceType:r.z.literal("CASH"),cashReceipt:a.PluginCashReceiptSchema.nullable().optional()}),u=i.extend({sourceType:r.z.literal("EXTERNAL")});t.PluginPaymentDtoSchema=r.z.discriminatedUnion("sourceType",[o,d,u])},8865:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6397:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5720:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginHallSchema=void 0;const r=n(8211);t.PluginHallSchema=r.z.object({id:r.z.number(),title:r.z.string(),order:r.z.number()})},692:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginTableSchema=t.PluginTableGroupSchema=void 0;const r=n(8211);t.PluginTableGroupSchema=r.z.object({id:r.z.number(),color:r.z.string(),merchantId:r.z.number(),tableIds:r.z.array(r.z.number())}),t.PluginTableSchema=r.z.object({id:r.z.number(),hallId:r.z.number(),title:r.z.string(),group:t.PluginTableGroupSchema.nullable().optional()})},8759:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AllPopupResponseSchema=t.AllPopupElementsSchema=t.BarcodeResponseSchema=t.AlertResponseSchema=t.BarcodeElementsSchema=t.AlertElementsSchema=void 0;const r=n(8211);t.AlertElementsSchema=r.z.object({type:r.z.literal("alert"),title:r.z.string(),description:r.z.string(),image:r.z.string(),cta:r.z.string()}),t.BarcodeElementsSchema=r.z.object({type:r.z.literal("barcode"),productName:r.z.string()}),t.AlertResponseSchema=r.z.object({type:r.z.literal("alert")}),t.BarcodeResponseSchema=r.z.discriminatedUnion("complete",[r.z.object({type:r.z.literal("barcode"),complete:r.z.literal(!0),data:r.z.discriminatedUnion("result",[r.z.object({barcode:r.z.string(),result:r.z.literal("SUCCESS")}),r.z.object({result:r.z.literal("CANCELLED")})])}),r.z.object({type:r.z.literal("barcode"),complete:r.z.literal(!1),errorMessage:r.z.string()})]),t.AllPopupElementsSchema=r.z.discriminatedUnion("type",[t.AlertElementsSchema,t.BarcodeElementsSchema]),t.AllPopupResponseSchema=r.z.union([t.AlertResponseSchema,t.BarcodeResponseSchema])},5478:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasCallbackId=void 0,t.hasCallbackId=function(e){return"callbackId"in e}},1837:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.notRequireResultHandler=void 0,t.notRequireResultHandler=(n=new Map,{set:(e,t)=>{n.set(e,t)},get:e=>n.get(e)})},9574:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.requireResultHandler=void 0;const r=n(9594);var a;t.requireResultHandler=(a=new Map,{has:e=>(0,r.hasCallbackId)(e)&&a.has(e.callbackId),set:(e,t)=>{(0,r.hasCallbackId)(e)&&a.set(e.callbackId,t)},get:e=>{if((0,r.hasCallbackId)(e))return a.get(e.callbackId)},del:e=>{(0,r.hasCallbackId)(e)&&a.delete(e.callbackId)}})},1369:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.webview=void 0;const r=n(9594),a=n(452),s=n(9574),i=n(1837);self.onmessage=({data:e})=>{if(!a.is.nullOrUndefined(e)&&!a.is.nullOrUndefined(e.name))if("undefined"==typeof PROFILE||"dev"!==PROFILE&&"local"!==PROFILE||(console.log("======= webview >> worker ======="),console.log(e)),self.postMessage({name:"log",data:{log:JSON.stringify({type:"fromWebview",data:e})}}),s.requireResultHandler.has(e)){const t=s.requireResultHandler.get(e);if(a.is.falsy(t))throw new Error(`${e.name}의 callback id를 찾지 못 했어요. 이미 실행되었을 가능성이 있습니다`);t(e)}else{const t=i.notRequireResultHandler.get(e.name);if(a.is.falsy(t))return;t(e)}},self.onerror=(e,t,n,r,s)=>{a.is.truthy(s)&&console.error("error on message",s),console.log("error event",{event:e,source:t,lineno:n,colno:r})},t.webview={send:function(e){if("undefined"==typeof PROFILE||"dev"!==PROFILE&&"local"!==PROFILE||(console.log("======= worker >> webview ======="),console.log(e)),self.postMessage({name:"log",data:{log:JSON.stringify({type:"fromWorker",message:e})}}),(0,r.hasCallbackId)(e))return new Promise((t=>{s.requireResultHandler.set(e,(e=>{t(e),s.requireResultHandler.del(e)})),self.postMessage(e)}));self.postMessage(e)},addHandler:function(e,t){i.notRequireResultHandler.set(e,t)}}},8137:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.webview=void 0;var r=n(1369);Object.defineProperty(t,"webview",{enumerable:!0,get:function(){return r.webview}})},8924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createCallbackId=void 0,t.createCallbackId=function(e=10){let t="";for(let n=0;n<e;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}},7147:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.cashReceipt=void 0;const a=n(8924),s=n(8137),i=n(9594),o=n(6788),d=n(2726);t.cashReceipt={add:function(e){return r(this,void 0,void 0,(function*(){(0,d.validate)(i.CashReceiptSchema)(e);const t=yield s.webview.send({name:"cash-receipt.issue.request",callbackId:(0,a.createCallbackId)(),data:e});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage)}))}}},6485:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.catalog=void 0;const a=n(8924),s=n(8137),i=n(6788),o=new Map;t.catalog={getCatalogs:function(){return r(this,void 0,void 0,(function*(){const e=yield s.webview.send({name:"catalog.list.request",callbackId:(0,a.createCallbackId)(),data:{}});if(!e.data.complete)throw new i.PosPluginSdkError(e.data.errorMessage);return e.data.catalogs}))},on:function(e,t){return r(this,void 0,void 0,(function*(){o.set(e,t),s.webview.addHandler("catalog.change.event",(({data:e})=>{const t=o.get(e.event);t&&t(e.catalog)}))}))}}},7687:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.category=void 0;const a=n(8924),s=n(8137),i=n(6788);t.category={getCategories:function(){return r(this,void 0,void 0,(function*(){const e=yield s.webview.send({name:"category.list.request",callbackId:(0,a.createCallbackId)(),data:{}});if(!e.data.complete)throw new i.PosPluginSdkError(e.data.errorMessage);return e.data.categories}))}}},6788:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PosPluginSdkError=void 0;class n extends Error{constructor(e){super(e)}static isPosPluginSdkError(e){return e instanceof n}}t.PosPluginSdkError=n},5349:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ffi=void 0;const a=n(8137),s=n(8924),i=n(6788),o=new Map,d=new Map;t.ffi={download:function(e,t){return r(this,void 0,void 0,(function*(){const n=yield a.webview.send({name:"ffi.download.request",callbackId:(0,s.createCallbackId)(),data:{downloadUrl:e,filePath:t}});if(!n.data.complete)throw new i.PosPluginSdkError(n.data.errorMessage)}))},load:function(e,t){return r(this,void 0,void 0,(function*(){const n=yield a.webview.send({name:"ffi.load.request",callbackId:(0,s.createCallbackId)(),data:{filePath:e,apis:t}});if(!n.data.complete)throw new i.PosPluginSdkError(n.data.errorMessage)}))},unload:function(e){return r(this,void 0,void 0,(function*(){const t=yield a.webview.send({name:"ffi.unload.request",callbackId:(0,s.createCallbackId)(),data:{filePath:e}});if(!t.data.complete)throw new i.PosPluginSdkError(t.data.errorMessage)}))},invoke:function(e,t,n){return r(this,void 0,void 0,(function*(){const r=yield a.webview.send({name:"ffi.invoke.request",callbackId:(0,s.createCallbackId)(),data:{filePath:e,apiName:t,params:n}});if(!r.data.complete)throw new i.PosPluginSdkError(r.data.errorMessage)}))},registerCallback:function(e,t,n){return r(this,void 0,void 0,(function*(){const u=yield a.webview.send({name:"ffi.register-callback.request",callbackId:(0,s.createCallbackId)(),data:{filePath:e,signature:t}});if(!u.data.complete)throw new i.PosPluginSdkError(u.data.errorMessage);if(d.size>100)throw new Error("too many callbacks registered");return d.set(u.data.callbackId,n),function(e,t){r(this,void 0,void 0,(function*(){o.set("ffi.callback-executed.event",t),a.webview.addHandler("ffi.callback-executed.event",(({data:e,name:t})=>{const n=o.get(t);n&&n(e)}))}))}(0,(({ffiCallbackId:e,args:t})=>{const n=d.get(e);n&&n(t)})),{ffiCallbackId:u.data.callbackId}}))}}},4347:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.http=void 0;const a=n(8137),s=n(9594),i=n(8924),o=n(2726);function d(e){return t=>r(this,void 0,void 0,(function*(){return(0,o.validate)(s.PluginHttpRequestSchema)(Object.assign(Object.assign({},t),{method:e})),(yield a.webview.send({name:"http.client.request",callbackId:(0,i.createCallbackId)(),data:{url:t.url,method:e,payload:t.payload,headers:t.headers}})).data}))}t.http={get:(e,t)=>d("GET")({url:e,payload:void 0,headers:t||[]}),post:(e,t,n)=>d("POST")({url:e,payload:t,headers:n||[]}),delete:(e,t)=>d("DELETE")({url:e,payload:void 0,headers:t||[]}),head:(e,t)=>d("HEAD")({url:e,payload:void 0,headers:t||[]}),options:(e,t)=>d("OPTIONS")({url:e,payload:void 0,headers:t||[]}),put:(e,t,n)=>d("PUT")({url:e,payload:t,headers:n||[]}),patch:(e,t,n)=>d("PATCH")({url:e,payload:t,headers:n||[]})}},4591:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.merchant=t.getMerchant=void 0;const a=n(8137),s=n(8924),i=n(6788);function o(){var e;return r(this,void 0,void 0,(function*(){const{data:t}=yield a.webview.send({name:"merchant.info.request",callbackId:(0,s.createCallbackId)(),data:{}});if(!t.complete)throw new i.PosPluginSdkError(null!==(e=t.errorMessage)&&void 0!==e?e:"Unknown error");return t.merchant}))}t.getMerchant=o,t.merchant={getMerchant:o}},2765:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.option=void 0;const a=n(8924),s=n(8137),i=n(6788),o=new Map;t.option={getOptions:function(){return r(this,void 0,void 0,(function*(){const e=yield s.webview.send({name:"option.list.request",callbackId:(0,a.createCallbackId)(),data:{}});if(!e.data.complete)throw new i.PosPluginSdkError(e.data.errorMessage);return e.data.options}))},on:function(e,t){return r(this,void 0,void 0,(function*(){o.set(e,t),s.webview.addHandler("option.change.event",(({data:e})=>{const t=o.get(e.event);t&&t(e.option)}))}))}}},6605:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.order=void 0;const a=n(8924),s=n(9594),i=n(8137),o=n(6788),d=n(2726),u=new Map;t.order={getOrder:function(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"order.get.request",callbackId:(0,a.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage);return t.data.order}))},on:function(e,t){return r(this,void 0,void 0,(function*(){u.set(e,t),i.webview.addHandler("order.change.event",(({data:e})=>{const t=u.get(e.event);t&&t(e.order)}))}))},add:function(e){return r(this,void 0,void 0,(function*(){(0,d.validate)(s.PluginOrderDtoSchema)(e);const t=yield i.webview.send({name:"order.add.request",callbackId:(0,a.createCallbackId)(),data:{order:e}});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage);return t.data.order}))},cancel:function(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"order.cancel.request",callbackId:(0,a.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage)}))},addMenu:function(e,t){return r(this,void 0,void 0,(function*(){(0,d.validate)(s.PluginOrderDtoSchema)(t);const n=yield i.webview.send({name:"order.add-menu.request",callbackId:(0,a.createCallbackId)(),data:{id:e,order:t}});if(!n.data.complete)throw new o.PosPluginSdkError(n.data.errorMessage);return n.data.order}))},complete:function(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"order.complete.request",callbackId:(0,a.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage);return t.data.order}))}}},2799:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.paymentMethod=void 0;const a=n(8137),s=new Map,i=new Map;t.paymentMethod={add:function({data:e,payCallback:t,cancelCallback:n}){s.set(e.id,t),i.set(e.id,n),a.webview.addHandler("payment.method.event.request",(t=>r(this,void 0,void 0,(function*(){const n="pay"===t.data.event?s.get(t.data.id):i.get(t.data.id);if(n)try{if("pay"===t.data.event){const e=yield n(t.data.order,t.data.price);a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!0,paymentDto:e?{approvedNo:e.approvedNo,approvedAt:e.approvedAt,paymentKey:e.paymentKey,sourceType:"EXTERNAL"}:void 0}})}else if("cancel"===t.data.event){const e=yield n(t.data.order,t.data.payment);a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!0,cancelledPaymentDto:e}})}}catch(e){a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!1,errorMessage:e.message}})}else a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!1,errorMessage:`${e.paymentName}로 ${"pay"===t.data.event?"결제":"결제취소"} 할 수 없습니다.`}})})))),a.webview.send({name:"payment.method.add",data:e})}}},8925:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.payment=void 0;const a=n(8137),s=n(9594),i=n(8924),o=n(6788),d=n(2726),u=new Map;t.payment={on:function(e,t){return r(this,void 0,void 0,(function*(){u.set(e,t),a.webview.addHandler("payment.change.event",(({data:e})=>{const t=u.get(e.event);t&&t(e.payment)}))}))},add:function(e,t){return r(this,void 0,void 0,(function*(){(0,d.validate)(s.PluginPaymentDtoSchema)(t);const n=yield a.webview.send({name:"payment.add.request",callbackId:(0,i.createCallbackId)(),data:{order:e,paymentDto:t}});if(!n.data.complete)throw new o.PosPluginSdkError(n.data.errorMessage);return n.data.payment}))},cancel:function(e,t){return r(this,void 0,void 0,(function*(){const n=yield a.webview.send({name:"payment.cancel.request",callbackId:(0,i.createCallbackId)(),data:{order:e,payment:t}});if(!n.data.complete)throw new o.PosPluginSdkError(n.data.errorMessage)}))}}},7567:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pos=void 0;const r=n(7147),a=n(853),s=n(4513),i=n(7687),o=n(6485),d=n(2765),u=n(6605),c=n(4347),l=n(8925),p=n(3061),h=n(4591),m=n(5179),f=n(2799),y=n(9397),g=n(5349);t.pos={storage:a.storage,table:s.table,category:i.category,catalog:o.catalog,option:d.option,cashReceipt:r.cashReceipt,order:u.order,payment:l.payment,http:c.http,toast:p.toast,merchant:h.merchant,ui:m.ui,paymentMethod:f.paymentMethod,websocket:y.websocket,ffi:g.ffi}},853:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;const a=n(8924),s=n(8137),i=n(6788);t.storage={get:function(e){var t;return r(this,void 0,void 0,(function*(){const{data:n}=yield s.webview.send({name:"storage.get.request",callbackId:(0,a.createCallbackId)(),data:{key:e}});if(!n.complete)throw new i.PosPluginSdkError(null!==(t=n.errorMessage)&&void 0!==t?t:"Unknown error");return n.value}))},set:function(e,t){var n;return r(this,void 0,void 0,(function*(){const{data:r}=yield s.webview.send({name:"storage.set.request",callbackId:(0,a.createCallbackId)(),data:{key:e,value:t}});if(!r.complete)throw new i.PosPluginSdkError(null!==(n=r.errorMessage)&&void 0!==n?n:"Unknown error")}))},del:function(e){var t;return r(this,void 0,void 0,(function*(){const{data:n}=yield s.webview.send({name:"storage.delete.request",callbackId:(0,a.createCallbackId)(),data:{key:e}});if(!n.complete)throw new i.PosPluginSdkError(null!==(t=n.errorMessage)&&void 0!==t?t:"Unknown error")}))}}},4513:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.table=void 0;const a=n(8924),s=n(8137),i=n(9594),o=n(6788),d=n(2726),u=new Map;t.table={getTables:function(){return r(this,void 0,void 0,(function*(){const e=yield s.webview.send({name:"table.list.request",callbackId:(0,a.createCallbackId)(),data:{}});if(!e.data.complete)throw new o.PosPluginSdkError(e.data.errorMessage);return e.data.tables}))},on:function(e,t){u.set(e,t),s.webview.addHandler("table.change.event",(({data:e})=>{const t=u.get(e.event);t&&("order-update"===e.event||"add"===e.event||"clear"===e.event?t(e.table):"swap"!==e.event&&"move"!==e.event&&"merge"!==e.event||t(e.from,e.to))}))},clearTable:function({table:e,order:t}){return r(this,void 0,void 0,(function*(){(0,d.validate)(i.PluginTableSchema)(e),(0,d.validate)(i.PluginOrderSchema)(t);const n=yield s.webview.send({name:"table.clear.request",callbackId:(0,a.createCallbackId)(),data:{table:e,order:t}});if(!n.data.complete)throw new o.PosPluginSdkError(n.data.errorMessage)}))}}},3061:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toast=void 0;const r=n(8137),a=n(8924);t.toast={open:function(e){r.webview.send({name:"toast.open",callbackId:(0,a.createCallbackId)(),data:{message:e}})}}},3086:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.openPopup=void 0;const a=n(8924),s=n(9594),i=n(8137),o=n(2726);t.openPopup=function(e){return r(this,void 0,void 0,(function*(){return(0,o.validate)(s.AllPopupElementsSchema)(e),(yield i.webview.send({name:"popup.request",callbackId:(0,a.createCallbackId)(),data:e})).data}))}},5179:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ui=void 0;const r=n(3086);t.ui={openPopup:r.openPopup}},9397:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.websocket=t.Websocket=void 0;const a=n(8137),s=n(8924),i=new Map;class o{constructor(e,t,n){this.url=e,this.headers=t,this.options=n,this.onMessageCallback=void 0,this.onErrorCallback=void 0,this.onCloseCallback=void 0,this.onOpenCallback=void 0}connect(){return r(this,void 0,void 0,(function*(){const e=yield a.webview.send({name:"websocket.connect.request",callbackId:(0,s.createCallbackId)(),data:Object.assign({url:this.url,headers:this.headers},this.options)});if(!e.data.complete)throw new Error(e.data.errorMessage)}))}disconnect(){return r(this,void 0,void 0,(function*(){yield a.webview.send({name:"websocket.disconnect.request",callbackId:(0,s.createCallbackId)(),data:{url:this.url}})}))}send(e){a.webview.send({name:"websocket.send",data:{url:this.url,data:e.data,option:e.option}})}onMessage(e){this.onMessageCallback=e}onError(e){this.onErrorCallback=e}onClose(e){this.onCloseCallback=e}onOpen(e){this.onOpenCallback=e}}t.Websocket=o,t.websocket={create:function(e,t,n){return r(this,void 0,void 0,(function*(){0===i.size&&a.webview.addHandler("websocket.event",(e=>{const t=i.get(e.data.url);t&&("open"===e.data.event&&t.onOpenCallback&&t.onOpenCallback(),"close"===e.data.event&&t.onCloseCallback&&t.onCloseCallback(e.data.code),"message"===e.data.event&&t.onMessageCallback&&t.onMessageCallback(e.data.data),"error"===e.data.event&&t.onErrorCallback&&t.onErrorCallback(e.data.errorName,e.data.errorMessage))}));const r=new o(e,t,n);return yield r.connect(),i.set(e,r),r}))}}},7498:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const r=n(1721);t.ZodIssueCode=r.util.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"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];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))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=a,a.create=e=>new a(e)},8652:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const a=r(n(548));t.defaultErrorMap=a.default;let s=a.default;t.setErrorMap=function(e){s=e},t.getErrorMap=function(){return s}},5772:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(8652),t),a(n(9082),t),a(n(5209),t),a(n(1721),t),a(n(1554),t),a(n(7498),t)},4439:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(n||(t.errorUtil=n={}))},9082:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const a=n(8652),s=r(n(548));t.makeIssue=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,n){const r=(0,a.getErrorMap)(),i=(0,t.makeIssue)({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===s.default?void 0:s.default].filter((e=>!!e))});e.common.issues.push(i)};class i{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if("aborted"===a.status)return t.INVALID;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return i.mergeObjectSync(e,n)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:n,value:s}=a;if("aborted"===n.status)return t.INVALID;if("aborted"===s.status)return t.INVALID;"dirty"===n.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===n.value||void 0===s.value&&!a.alwaysSet||(r[n.value]=s.value)}return{status:e.value,value:r}}}t.ParseStatus=i,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},5209:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1721:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(t.util=n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(t.objectUtil=r={})),t.ZodParsedType=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},8211:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t},i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const o=s(n(5772));t.z=o,i(n(5772),t),t.default=o},548:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(1721),a=n(7498);t.default=(e,t)=>{let n;switch(e.code){case a.ZodIssueCode.invalid_type:n=e.received===r.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.util.jsonStringifyReplacer)}`;break;case a.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.util.joinValues(e.keys,", ")}`;break;case a.ZodIssueCode.invalid_union:n="Invalid input";break;case a.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.util.joinValues(e.options)}`;break;case a.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${r.util.joinValues(e.options)}, received '${e.received}'`;break;case a.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case a.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case a.ZodIssueCode.invalid_date:n="Invalid date";break;case a.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.ZodIssueCode.custom:n="Invalid input";break;case a.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case a.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case a.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.util.assertNever(e)}return{message:n}}},1554:function(e,t,n){var r,a,s=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const o=n(8652),d=n(4439),u=n(9082),c=n(1721),l=n(7498);class p{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,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 h=(e,t)=>{if((0,u.isValid)(t))return{success:!0,data:t.value};if(!e.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 l.ZodError(e.common.issues);return this._error=t,this._error}}};function m(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class f{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,u.isAsync)(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parseSync({data:e,path:r.path,parent:r});return h(r,a)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:r});return(0,u.isValid)(t)?{value:t.value}:{issues:r.common.issues}}catch(e){(null===(n=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then((e=>(0,u.isValid)(e)?{value:e.value}:{issues:r.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await((0,u.isAsync)(r)?r:Promise.resolve(r));return h(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:l.ZodIssueCode.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new fe({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ye.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return G.create(this)}promise(){return me.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return re.create(this,e,this._def)}transform(e){return new fe({...m(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ve({...m(this._def),innerType:this,defaultValue:t,typeName:Oe.ZodDefault})}brand(){return new Pe({typeName:Oe.ZodBranded,type:this,...m(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new _e({...m(this._def),innerType:this,catchValue:t,typeName:Oe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return we.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=f,t.Schema=f,t.ZodSchema=f;const y=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,v=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_=/^[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,b=/^[a-z0-9_-]{21}$/i,P=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,k=/^[-+]?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)?)??$/,w=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let I;const x=/^(?:(?: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])$/,O=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,T=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,C=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,A="((\\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])))",E=new RegExp(`^${A}$`);function j(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function N(e){let t=`${A}T${j(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function R(e,t){if(!P.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!("object"!=typeof a||null===a||!a.typ||!a.alg||t&&a.alg!==t)}catch(e){return!1}}function M(e,t){return!("v4"!==t&&t||!O.test(e))||!("v6"!==t&&t||!S.test(e))}t.datetimeRegex=N;class z extends f{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:t.parsedType}),u.INVALID}const t=new u.ParseStatus;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const r=e.data.length>s.value,a=e.data.length<s.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)w.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"email",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)I||(I=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),I.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"emoji",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)_.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"uuid",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)b.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"nanoid",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)y.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cuid",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)g.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cuid2",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)v.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"ulid",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"url",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"regex",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?N(s).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?E.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${j(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?k.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"duration",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(a=s.version)&&a||!x.test(r))&&("v6"!==a&&a||!T.test(r))&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"ip",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty())):"jwt"===s.kind?R(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"jwt",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?M(e.data,s.version)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cidr",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?C.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"base64",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?Z.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"base64url",code:l.ZodIssueCode.invalid_string,message:s.message}),t.dirty()):c.util.assertNever(s);var r,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:l.ZodIssueCode.invalid_string,...d.errorUtil.errToObj(n)})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...d.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...d.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...d.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...d.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...d.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...d.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...d.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...d.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...d.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...d.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...d.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...d.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...d.errorUtil.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...d.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...d.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...d.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...d.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...d.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...d.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...d.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...d.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...d.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...d.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,d.errorUtil.errToObj(e))}trim(){return new z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new z({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function D(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}t.ZodString=z,z.create=e=>{var t;return new z({checks:[],typeName:Oe.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...m(e)})};class F extends f{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)!==c.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:t.parsedType}),u.INVALID}let t;const n=new u.ParseStatus;for(const r of this._def.checks)"int"===r.kind?c.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==D(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_finite,message:r.message}),n.dirty()):c.util.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,n,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:d.errorUtil.toString(r)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:d.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:d.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=F,F.create=e=>new F({checks:[],typeName:Oe.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...m(e)});class L extends f{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let t;const n=new u.ParseStatus;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):c.util.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),u.INVALID}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,n,r){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:d.errorUtil.toString(r)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}t.ZodBigInt=L,L.create=e=>{var t;return new L({checks:[],typeName:Oe.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...m(e)})};class U extends f{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==c.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodBoolean=U,U.create=e=>new U({typeName:Oe.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...m(e)});class V extends f{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:t.parsedType}),u.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_date}),u.INVALID}const t=new u.ParseStatus;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):c.util.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:d.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:d.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}t.ZodDate=V,V.create=e=>new V({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Oe.ZodDate,...m(e)});class $ extends f{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodSymbol=$,$.create=e=>new $({typeName:Oe.ZodSymbol,...m(e)});class B extends f{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodUndefined=B,B.create=e=>new B({typeName:Oe.ZodUndefined,...m(e)});class W extends f{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodNull=W,W.create=e=>new W({typeName:Oe.ZodNull,...m(e)});class q extends f{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodAny=q,q.create=e=>new q({typeName:Oe.ZodAny,...m(e)});class K extends f{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodUnknown=K,K.create=e=>new K({typeName:Oe.ZodUnknown,...m(e)});class H extends f{_parse(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),u.INVALID}}t.ZodNever=H,H.create=e=>new H({typeName:Oe.ZodNever,...m(e)});class Y extends f{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodVoid=Y,Y.create=e=>new Y({typeName:Oe.ZodVoid,...m(e)});class G extends f{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),u.INVALID;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&((0,u.addIssueToContext)(t,{code:e?l.ZodIssueCode.too_big:l.ZodIssueCode.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new p(t,e,t.path,n))))).then((e=>u.ParseStatus.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new p(t,e,t.path,n))));return u.ParseStatus.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new G({...this._def,minLength:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new G({...this._def,maxLength:{value:e,message:d.errorUtil.toString(t)}})}length(e,t){return new G({...this._def,exactLength:{value:e,message:d.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function J(e){if(e instanceof X){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ye.create(J(r))}return new X({...e._def,shape:()=>t})}return e instanceof G?new G({...e._def,type:J(e.element)}):e instanceof ye?ye.create(J(e.unwrap())):e instanceof ge?ge.create(J(e.unwrap())):e instanceof ae?ae.create(e.items.map((e=>J(e)))):e}t.ZodArray=G,G.create=(e,t)=>new G({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...m(t)});class X extends f{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof H&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||s.push(e);const i=[];for(const e of a){const t=r[e],a=n.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new p(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof H){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new p(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>u.ParseStatus.mergeObjectSync(t,e))):u.ParseStatus.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return d.errorUtil.errToObj,new X({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=d.errorUtil.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new X({...this._def,unknownKeys:"strip"})}passthrough(){return new X({...this._def,unknownKeys:"passthrough"})}extend(e){return new X({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new X({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Oe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new X({...this._def,catchall:e})}pick(e){const t={};return c.util.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new X({...this._def,shape:()=>t})}omit(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new X({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new X({...this._def,shape:()=>t})}required(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ye;)e=e._def.innerType;t[n]=e}})),new X({...this._def,shape:()=>t})}keyof(){return le(c.util.objectKeys(this.shape))}}t.ZodObject=X,X.create=(e,t)=>new X({shape:()=>e,unknownKeys:"strip",catchall:H.create(),typeName:Oe.ZodObject,...m(t)}),X.strictCreate=(e,t)=>new X({shape:()=>e,unknownKeys:"strict",catchall:H.create(),typeName:Oe.ZodObject,...m(t)}),X.lazycreate=(e,t)=>new X({shape:e,unknownKeys:"strip",catchall:H.create(),typeName:Oe.ZodObject,...m(t)});class Q extends f{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new l.ZodError(e.ctx.common.issues)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:n}),u.INVALID}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new l.ZodError(e)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:a}),u.INVALID}}get options(){return this._def.options}}t.ZodUnion=Q,Q.create=(e,t)=>new Q({options:e,typeName:Oe.ZodUnion,...m(t)});const ee=e=>e instanceof ue?ee(e.schema):e instanceof fe?ee(e.innerType()):e instanceof ce?[e.value]:e instanceof pe?e.options:e instanceof he?c.util.objectValues(e.enum):e instanceof ve?ee(e._def.innerType):e instanceof B?[void 0]:e instanceof W?[null]:e instanceof ye?[void 0,...ee(e.unwrap())]:e instanceof ge?[null,...ee(e.unwrap())]:e instanceof Pe||e instanceof we?ee(e.unwrap()):e instanceof _e?ee(e._def.innerType):[];class te extends f{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),u.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=ee(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new te({typeName:Oe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...m(n)})}}function ne(e,t){const n=(0,c.getParsedType)(e),r=(0,c.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===c.ZodParsedType.object&&r===c.ZodParsedType.object){const n=c.util.objectKeys(t),r=c.util.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=ne(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===c.ZodParsedType.array&&r===c.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=ne(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===c.ZodParsedType.date&&r===c.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}t.ZodDiscriminatedUnion=te;class re extends f{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if((0,u.isAborted)(e)||(0,u.isAborted)(r))return u.INVALID;const a=ne(e.value,r.value);return a.valid?(((0,u.isDirty)(e)||(0,u.isDirty)(r))&&t.dirty(),{status:t.value,value:a.data}):((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_intersection_types}),u.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}t.ZodIntersection=re,re.create=(e,t,n)=>new re({left:e,right:t,typeName:Oe.ZodIntersection,...m(n)});class ae extends f{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:n.parsedType}),u.INVALID;if(n.data.length<this._def.items.length)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new p(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>u.ParseStatus.mergeArray(t,e))):u.ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ae({...this._def,rest:e})}}t.ZodTuple=ae,ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:Oe.ZodTuple,rest:null,...m(t)})};class se extends f{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:n.parsedType}),u.INVALID;const r=[],a=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new p(n,e,n.path,e)),value:s._parse(new p(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?u.ParseStatus.mergeObjectAsync(t,r):u.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new se(t instanceof f?{keyType:e,valueType:t,typeName:Oe.ZodRecord,...m(n)}:{keyType:z.create(),valueType:e,typeName:Oe.ZodRecord,...m(t)})}}t.ZodRecord=se;class ie extends f{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.map)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:n.parsedType}),u.INVALID;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new p(n,e,n.path,[s,"key"])),value:a._parse(new p(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return u.INVALID;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return u.INVALID;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}t.ZodMap=ie,ie.create=(e,t,n)=>new ie({valueType:t,keyType:e,typeName:Oe.ZodMap,...m(n)});class oe extends f{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.set)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:n.parsedType}),u.INVALID;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return u.INVALID;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new p(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new oe({...this._def,minSize:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new oe({...this._def,maxSize:{value:e,message:d.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=oe,oe.create=(e,t)=>new oe({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...m(t)});class de extends f{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),u.INVALID;function n(e,n){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_arguments,argumentsError:n}})}function r(e,n){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof me){const e=this;return(0,u.OK)((async function(...t){const i=new l.ZodError([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw i.addIssue(r(d,e)),i}))}))}{const e=this;return(0,u.OK)((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new l.ZodError([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new l.ZodError([r(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new de({...this._def,args:ae.create(e).rest(K.create())})}returns(e){return new de({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new de({args:e||ae.create([]).rest(K.create()),returns:t||K.create(),typeName:Oe.ZodFunction,...m(n)})}}t.ZodFunction=de;class ue extends f{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})}}t.ZodLazy=ue,ue.create=(e,t)=>new ue({getter:e,typeName:Oe.ZodLazy,...m(t)});class ce extends f{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_literal,expected:this._def.value}),u.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function le(e,t){return new pe({values:e,typeName:Oe.ZodEnum,...m(t)})}t.ZodLiteral=ce,ce.create=(e,t)=>new ce({value:e,typeName:Oe.ZodLiteral,...m(t)});class pe extends f{constructor(){super(...arguments),r.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,u.addIssueToContext)(t,{expected:c.util.joinValues(n),received:t.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(s(this,r,"f")||i(this,r,new Set(this._def.values),"f"),!s(this,r,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_enum_value,options:n}),u.INVALID}return(0,u.OK)(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 pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=pe,r=new WeakMap,pe.create=le;class he extends f{constructor(){super(...arguments),a.set(this,void 0)}_parse(e){const t=c.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==c.ZodParsedType.string&&n.parsedType!==c.ZodParsedType.number){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(n,{expected:c.util.joinValues(e),received:n.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(s(this,a,"f")||i(this,a,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!s(this,a,"f").has(e.data)){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(n,{received:n.data,code:l.ZodIssueCode.invalid_enum_value,options:e}),u.INVALID}return(0,u.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=he,a=new WeakMap,he.create=(e,t)=>new he({values:e,typeName:Oe.ZodNativeEnum,...m(t)});class me extends f{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&!1===t.common.async)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),u.INVALID;const n=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=me,me.create=(e,t)=>new me({type:e,typeName:Oe.ZodPromise,...m(t)});class fe extends f{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{(0,u.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return u.INVALID;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:"dirty"===r.status||"dirty"===t.value?(0,u.DIRTY)(r.value):r}));{if("aborted"===t.value)return u.INVALID;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:"dirty"===r.status||"dirty"===t.value?(0,u.DIRTY)(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?u.INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,u.isValid)(e))return e;const s=r.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>(0,u.isValid)(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}c.util.assertNever(r)}}t.ZodEffects=fe,t.ZodTransformer=fe,fe.create=(e,t,n)=>new fe({schema:e,typeName:Oe.ZodEffects,effect:t,...m(n)}),fe.createWithPreprocess=(e,t,n)=>new fe({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...m(n)});class ye extends f{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:Oe.ZodOptional,...m(t)});class ge extends f{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ge,ge.create=(e,t)=>new ge({innerType:e,typeName:Oe.ZodNullable,...m(t)});class ve extends f{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===c.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=ve,ve.create=(e,t)=>new ve({innerType:e,typeName:Oe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...m(t)});class _e extends f{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,u.isAsync)(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l.ZodError(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new l.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=_e,_e.create=(e,t)=>new _e({innerType:e,typeName:Oe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...m(t)});class be extends f{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:t.parsedType}),u.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=be,be.create=e=>new be({typeName:Oe.ZodNaN,...m(e)}),t.BRAND=Symbol("zod_brand");class Pe extends f{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=Pe;class ke extends f{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),(0,u.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ke({in:e,out:t,typeName:Oe.ZodPipeline})}}t.ZodPipeline=ke;class we extends f{_parse(e){const t=this._def.innerType._parse(e),n=e=>((0,u.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.isAsync)(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Ie(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function xe(e,t={},n){return e?q.create().superRefine(((r,a)=>{var s,i;const o=e(r);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Ie(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Ie(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):q.create()}var Oe;t.ZodReadonly=we,we.create=(e,t)=>new we({innerType:e,typeName:Oe.ZodReadonly,...m(t)}),t.custom=xe,t.late={object:X.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Oe||(t.ZodFirstPartyTypeKind=Oe={})),t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>xe((t=>t instanceof e),t);const Te=z.create;t.string=Te;const Se=F.create;t.number=Se;const Ce=be.create;t.nan=Ce;const Ze=L.create;t.bigint=Ze;const Ae=U.create;t.boolean=Ae;const Ee=V.create;t.date=Ee;const je=$.create;t.symbol=je;const Ne=B.create;t.undefined=Ne;const Re=W.create;t.null=Re;const Me=q.create;t.any=Me;const ze=K.create;t.unknown=ze;const De=H.create;t.never=De;const Fe=Y.create;t.void=Fe;const Le=G.create;t.array=Le;const Ue=X.create;t.object=Ue;const Ve=X.strictCreate;t.strictObject=Ve;const $e=Q.create;t.union=$e;const Be=te.create;t.discriminatedUnion=Be;const We=re.create;t.intersection=We;const qe=ae.create;t.tuple=qe;const Ke=se.create;t.record=Ke;const He=ie.create;t.map=He;const Ye=oe.create;t.set=Ye;const Ge=de.create;t.function=Ge;const Je=ue.create;t.lazy=Je;const Xe=ce.create;t.literal=Xe;const Qe=pe.create;t.enum=Qe;const et=he.create;t.nativeEnum=et;const tt=me.create;t.promise=tt;const nt=fe.create;t.effect=nt,t.transformer=nt;const rt=ye.create;t.optional=rt;const at=ge.create;t.nullable=at;const st=fe.createWithPreprocess;t.preprocess=st;const it=ke.create;t.pipeline=it,t.ostring=()=>Te().optional(),t.onumber=()=>Se().optional(),t.oboolean=()=>Ae().optional(),t.coerce={string:e=>z.create({...e,coerce:!0}),number:e=>F.create({...e,coerce:!0}),boolean:e=>U.create({...e,coerce:!0}),bigint:e=>L.create({...e,coerce:!0}),date:e=>V.create({...e,coerce:!0})},t.NEVER=u.INVALID}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e=r;Object.defineProperty(e,"BJ",{value:!0}),e.dx=e.n1=e.pd=e.kt=e.Sm=e.qn=e.YY=e.A5=e.eP=e.JC=void 0;var t=n(6485);Object.defineProperty(e,"JC",{enumerable:!0,get:function(){return t.CatalogTypes}});var a=n(7687);Object.defineProperty(e,"eP",{enumerable:!0,get:function(){return a.CategoryTypes}});var s=n(6788);Object.defineProperty(e,"A5",{enumerable:!0,get:function(){return s.PosPluginSdkError}});var i=n(4347);Object.defineProperty(e,"YY",{enumerable:!0,get:function(){return i.HttpTypes}});var o=n(4591);Object.defineProperty(e,"qn",{enumerable:!0,get:function(){return o.MerchantTypes}});var d=n(2765);Object.defineProperty(e,"Sm",{enumerable:!0,get:function(){return d.MenuOptionTypes}});var u=n(6605);Object.defineProperty(e,"kt",{enumerable:!0,get:function(){return u.OrderTypes}});var c=n(7567);Object.defineProperty(e,"pd",{enumerable:!0,get:function(){return c.Sdk}}),Object.defineProperty(e,"n1",{enumerable:!0,get:function(){return c.pos}});var l=n(853);Object.defineProperty(e,"dx",{enumerable:!0,get:function(){return l.StorageTypes}})})();var a=r.JC,s=r.eP,i=r.YY,o=r.Sm,d=r.qn,u=r.kt,c=r.A5,l=r.pd,p=r.dx,h=r.BJ,m=r.n1;export{a as CatalogTypes,s as CategoryTypes,i as HttpTypes,o as MenuOptionTypes,d as MerchantTypes,u as OrderTypes,c as PosPluginSdkError,l as Sdk,p as StorageTypes,h as __esModule,m as pos};
1
+ var e={9421:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(6772),t),a(n(5876),t),a(n(5426),t)},5426:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SlideLimiter=void 0;class n{constructor(e,t){this._store=e,this._options={windowMs:(null==t?void 0:t.windowMs)||n.defaultWindowMs,maxLimit:(null==t?void 0:t.maxLimit)||n.defaultMaxLimit}}get options(){return this._options}get store(){return this._store}async hit(e,t,n={windowMs:this._options.windowMs,maxLimit:this._options.maxLimit}){return this._store.hit(e,t,Object.assign({},n))}}t.SlideLimiter=n,n.defaultWindowMs=6e4,n.defaultMaxLimit=10},5876:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(2672),t),a(n(7402),t)},2672:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryStore=void 0;const r=n(6772);class a extends r.RateLimiterStore{constructor(){super(...arguments),this._buckets={}}slideWindow(e,t,n,r){const a=this._buckets[e][t]||[];for(;a[0]<=n-r;)a.shift()}get buckets(){return this._buckets}async hit(e,t,n){const{windowMs:r,maxLimit:a}=n,i=Date.now();return null==this._buckets[e]&&(this._buckets[e]={[t]:[]}),null==this._buckets[e][t]&&(this._buckets[e][t]=[]),this.slideWindow(e,t,i,r),this._buckets[e][t].length<a&&this._buckets[e][t].push(i),a-this._buckets[e][t].length}}t.MemoryStore=a},7402:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RedisStore=void 0;const r=n(6772);class a extends r.RateLimiterStore{constructor(e){super(),this._db=e,this.initialize()}initialize(){this._db.defineCommand("hit",{numberOfKeys:2,lua:"\n local current_time = redis.call('TIME')\n local bucket = KEYS[1]\n local id = KEYS[2]\n\n local key = bucket .. \":\" .. id\n local window = tonumber(ARGV[1]) / 1000\n local limit = tonumber(ARGV[2])\n\n local trim_time = tonumber(current_time[1]) - window\n redis.call('ZREMRANGEBYSCORE', key, 0, trim_time)\n local request_count = redis.call('ZCARD', key)\n\n if request_count < limit then\n redis.call('ZADD', key, current_time[1], current_time[1] .. current_time[2])\n redis.call('EXPIRE', key, window)\n return limit - request_count - 1;\n end\n return 0\n "})}get db(){return this._db}async hit(e,t,n){const{windowMs:r,maxLimit:a}=n;return this._db.hit(e,t,r,a)}}t.RedisStore=a},6772:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RateLimiterStore=void 0,t.RateLimiterStore=class{constructor(e={}){this.config=e}async hit(e,t,n){throw new Error("Method Not implemented")}}},2615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CashReceiptSchema=void 0;const r=n(8211);t.CashReceiptSchema=r.z.object({orderId:r.z.string(),amount:r.z.number(),issueDate:r.z.string(),issueNumber:r.z.string(),cardNumber:r.z.string()})},5236:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCatalogCategorySchema=void 0;const r=n(8211),a=n(3041);t.PluginCatalogCategorySchema=r.z.object({id:r.z.number(),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).optional()})},8963:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7889:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9414:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCatalogItemOptionChoiceSchema=void 0;const r=n(8211),a=n(3041);t.PluginCatalogItemOptionChoiceSchema=r.z.object({id:r.z.number(),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).nullable().optional(),priceValue:r.z.number(),imageUrl:r.z.string().nullable().optional(),state:r.z.enum(["ON_SALE","SOLD_OUT"])})},6738:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCatalogItemPriceTypeSchema=void 0;const r=n(8211);t.PluginCatalogItemPriceTypeSchema=r.z.enum(["FIXED","VARIABLE","UNIT"])},3340:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDeliverySchema=t.DeliveryPaymentMethodSchema=t.StoreOrderStatusSchema=t.DeliveryStatusSchema=void 0;const r=n(8211);t.DeliveryStatusSchema=r.z.enum(["NEW","ACCEPTED","REJECTED","PARTIALLY_CANCELLED","CANCELLED","RIDER_ASSIGNED","RIDER_ARRIVE_SOON","RIDER_PICKUP_COMPLETED","DONE"]),t.StoreOrderStatusSchema=r.z.enum(["NEW","ACCEPTED","REJECTED","PARTIALLY_CANCELLED","CANCELLED","DONE"]),t.DeliveryPaymentMethodSchema=r.z.enum(["결제완료","만나서 카드결제","만나서 현금결제","선불결제"]);const a=r.z.object({deliveryId:r.z.string(),serviceName:r.z.string(),deliveryName:r.z.string(),orderAt:r.z.string(),icon:r.z.string(),shop:r.z.object({id:r.z.string(),name:r.z.string()}),paymentMethod:t.DeliveryPaymentMethodSchema,customerChargedPrice:r.z.number(),preparationTimeMin:r.z.number().optional(),reservedDateTime:r.z.string().optional(),origin:r.z.string().optional()}),i=a.extend({type:r.z.literal("DELIVERY"),deliveryBy:r.z.enum(["DELIVERY_COMPANY","STORE","AGENCY"]),memo:r.z.object({store:r.z.string().optional(),delivery:r.z.string().optional()}).optional(),address:r.z.object({road:r.z.string().optional(),lot:r.z.string().optional()}).optional(),phone:r.z.string().optional(),status:t.DeliveryStatusSchema}),o=a.extend({type:r.z.literal("PICKUP"),memo:r.z.object({store:r.z.string().optional()}).optional(),phone:r.z.string().optional(),status:t.StoreOrderStatusSchema}),s=a.extend({type:r.z.literal("HERE"),memo:r.z.object({store:r.z.string().optional()}),phone:r.z.string().optional(),status:t.StoreOrderStatusSchema});t.PluginDeliverySchema=r.z.discriminatedUnion("type",[o,i,s])},5245:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5914:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4623:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8670:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDraftOrderItemDtoSchema=void 0;const r=n(8211),a=n(5513),i=n(7615),o=n(6738),s=n(9414),d=n(5236);t.PluginDraftOrderItemDtoSchema=r.z.object({key:r.z.string().optional(),item:r.z.object({id:r.z.number(),title:r.z.string(),category:r.z.lazy((()=>d.PluginCatalogCategorySchema)),type:r.z.lazy((()=>i.OrderItemTypeSchema))}),itemPrice:r.z.object({id:r.z.number(),isTaxFree:r.z.boolean(),priceType:r.z.lazy((()=>o.PluginCatalogItemPriceTypeSchema)),priceUnit:r.z.number(),priceValue:r.z.number(),sku:r.z.string().optional(),title:r.z.string()}),discount:r.z.array(a.PluginDiscountSchema),memo:r.z.string().optional(),optionChoices:r.z.array(s.PluginCatalogItemOptionChoiceSchema),quantity:r.z.number(),diningOption:r.z.lazy((()=>i.PluginOrderDiningOptionSchema)),metadata:r.z.object({memoFixed:r.z.boolean().optional(),optionFixed:r.z.boolean().optional(),quantityFixed:r.z.boolean().optional()}).optional()})},5384:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6303:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7859:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2529:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8264:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2066:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginHttpRequestSchema=t.HttpRequestSchema=void 0;const r=n(8211),a=r.z.enum(["GET","POST","DELETE","HEAD","OPTIONS","PUT","PATCH"]);t.HttpRequestSchema=r.z.object({method:a,payload:r.z.any().nullable().optional(),headers:r.z.array(r.z.tuple([r.z.string(),r.z.string()]))}),t.PluginHttpRequestSchema=t.HttpRequestSchema.extend({url:r.z.string()})},9594:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TossMerchant=t.PluginLanguagePack=t.SettingInputsLegacy=t.PluginInputsUnionSchema=t.PluginInputsLegacy=t.LegacyPluginInputType=t.PluginInputs=t.PluginInputSchema=t.PluginHttpResponse=t.PluginHttpRequestSchema=t.PluginHttpRequest=t.HttpRequestSchema=t.HttpMethod=t.FFIDownloadInfo=t.MapStringToType=t.FFIApiReturn=t.FFIApiParams=t.ExtractApiNameWithParams=t.ExtractApiNameWithNoParams=t.FFILibrary=t.FFIFunctionReturn=t.FFIFunctionParam=t.FFIFunctionOptions=t.FFIFunction=t.FFIApi=t.FFIAbiType=t.PluginDraftOrderItemDtoSchema=t.PluginDraftOrderItemDto=t.PluginDraftOrderItem=t.PluginDraftOrder=t.Platform=t.DeviceInfo=t.DeliveryConnectionStatusErrorCode=t.DeliveryConnectionStatus=t.StoreStatus=t.PluginDelivery=t.DeliveryStatus=t.PluginCatalogItemPriceType=t.PluginCatalogItemPrice=t.PluginCatalogItemOptionChoiceSchema=t.PluginCatalogItemOptionChoice=t.PluginCatalogItemOption=t.CatalogItemOptionChoiceState=t.PluginCatalogItemLabel=t.PluginCatalogItemPriceDto=t.PluginCatalogItemDto=t.PluginCatalogItem=t.PluginCatalogCategory=t.CashReceiptSchema=t.CashReceipt=void 0,t.PluginServerOnHttpRequest=t.PluginPaymentSourceType=t.PluginPaymentInstallment=t.PluginPaymentDtoSchema=t.PluginPaymentDto=t.PluginCancelledPaymentDto=t.PluginPaymentStateSchema=t.PluginPaymentState=t.PluginPaymentBaseSchema=t.PluginPaymentBase=t.PluginPaymentOf=t.PluginPayment=t.PluginExternalPayment=t.PluginCashReceiptSchema=t.PluginCashReceiptIssuerTypeSchema=t.PluginCashReceiptIssuerType=t.PluginCashReceiptIssuanceTypeSchema=t.PluginCashReceiptIssuanceType=t.PluginCashReceipt=t.PluginCashPayment=t.VanTypeSchema=t.VanType=t.PluginPaymentCardTypeSchema=t.PluginPaymentCardType=t.PluginCardPaymentSchema=t.PluginCardPayment=t.PluginPaymentExternalSourceType=t.PluginBarcodePayment=t.PluginAccountTransferPayment=t.PluginPrice=t.PaymentMethodResponse=t.PluginDiscount=t.PluginDeliveryDiscountSchema=t.PluginDeliveryDiscount=t.PluginOrderState=t.PluginOrderPaymentState=t.PluginOrderItemSchema=t.PluginOrderItem=t.PluginOrderDiningOption=t.PluginOrderDtoSchema=t.PluginOrderDto=t.PluginOrderSchema=t.PluginOrder=t.PluginDeliveryOrderDtoSchema=t.PluginDeliveryOrderDto=t.PluginMessageResponse=t.PluginMessageNames=t.PluginMessage=t.FromWorkerMessage=t.FromWebviewMessage=void 0,t.hasCallbackId=t.PopupType=t.PopupElement=t.PopupActionResponse=t.BarcodeResponseSchema=t.BarcodeElementsSchema=t.AllPopupElementsSchema=t.PageResponseData=t.PageRequestData=t.PluginTableSchema=t.PluginTableGroupSchema=t.PluginTableGroup=t.PluginTable=t.PluginHallSchema=t.PluginHall=void 0;var r=n(2615);Object.defineProperty(t,"CashReceipt",{enumerable:!0,get:function(){return r.CashReceipt}}),Object.defineProperty(t,"CashReceiptSchema",{enumerable:!0,get:function(){return r.CashReceiptSchema}});var a=n(5236);Object.defineProperty(t,"PluginCatalogCategory",{enumerable:!0,get:function(){return a.PluginCatalogCategory}});var i=n(8963);Object.defineProperty(t,"PluginCatalogItem",{enumerable:!0,get:function(){return i.PluginCatalogItem}});var o=n(3318);Object.defineProperty(t,"PluginCatalogItemDto",{enumerable:!0,get:function(){return o.PluginCatalogItemDto}}),Object.defineProperty(t,"PluginCatalogItemPriceDto",{enumerable:!0,get:function(){return o.PluginCatalogItemPriceDto}});var s=n(7889);Object.defineProperty(t,"PluginCatalogItemLabel",{enumerable:!0,get:function(){return s.PluginCatalogItemLabel}});var d=n(9414);Object.defineProperty(t,"CatalogItemOptionChoiceState",{enumerable:!0,get:function(){return d.CatalogItemOptionChoiceState}}),Object.defineProperty(t,"PluginCatalogItemOption",{enumerable:!0,get:function(){return d.PluginCatalogItemOption}}),Object.defineProperty(t,"PluginCatalogItemOptionChoice",{enumerable:!0,get:function(){return d.PluginCatalogItemOptionChoice}}),Object.defineProperty(t,"PluginCatalogItemOptionChoiceSchema",{enumerable:!0,get:function(){return d.PluginCatalogItemOptionChoiceSchema}});var u=n(6738);Object.defineProperty(t,"PluginCatalogItemPrice",{enumerable:!0,get:function(){return u.PluginCatalogItemPrice}}),Object.defineProperty(t,"PluginCatalogItemPriceType",{enumerable:!0,get:function(){return u.PluginCatalogItemPriceType}});var c=n(3340);Object.defineProperty(t,"DeliveryStatus",{enumerable:!0,get:function(){return c.DeliveryStatus}}),Object.defineProperty(t,"PluginDelivery",{enumerable:!0,get:function(){return c.PluginDelivery}}),Object.defineProperty(t,"StoreStatus",{enumerable:!0,get:function(){return c.StoreStatus}});var l=n(5245);Object.defineProperty(t,"DeliveryConnectionStatus",{enumerable:!0,get:function(){return l.DeliveryConnectionStatus}});var p=n(5914);Object.defineProperty(t,"DeliveryConnectionStatusErrorCode",{enumerable:!0,get:function(){return p.DeliveryConnectionStatusErrorCode}});var m=n(4623);Object.defineProperty(t,"DeviceInfo",{enumerable:!0,get:function(){return m.DeviceInfo}}),Object.defineProperty(t,"Platform",{enumerable:!0,get:function(){return m.Platform}});var f=n(8670);Object.defineProperty(t,"PluginDraftOrder",{enumerable:!0,get:function(){return f.PluginDraftOrder}}),Object.defineProperty(t,"PluginDraftOrderItem",{enumerable:!0,get:function(){return f.PluginDraftOrderItem}}),Object.defineProperty(t,"PluginDraftOrderItemDto",{enumerable:!0,get:function(){return f.PluginDraftOrderItemDto}}),Object.defineProperty(t,"PluginDraftOrderItemDtoSchema",{enumerable:!0,get:function(){return f.PluginDraftOrderItemDtoSchema}});var h=n(5384);Object.defineProperty(t,"FFIAbiType",{enumerable:!0,get:function(){return h.FFIAbiType}}),Object.defineProperty(t,"FFIApi",{enumerable:!0,get:function(){return h.FFIApi}}),Object.defineProperty(t,"FFIFunction",{enumerable:!0,get:function(){return h.FFIFunction}}),Object.defineProperty(t,"FFIFunctionOptions",{enumerable:!0,get:function(){return h.FFIFunctionOptions}}),Object.defineProperty(t,"FFIFunctionParam",{enumerable:!0,get:function(){return h.FFIFunctionParam}}),Object.defineProperty(t,"FFIFunctionReturn",{enumerable:!0,get:function(){return h.FFIFunctionReturn}});var g=n(6303);Object.defineProperty(t,"FFILibrary",{enumerable:!0,get:function(){return g.FFILibrary}});var y=n(7859);Object.defineProperty(t,"ExtractApiNameWithNoParams",{enumerable:!0,get:function(){return y.ExtractApiNameWithNoParams}}),Object.defineProperty(t,"ExtractApiNameWithParams",{enumerable:!0,get:function(){return y.ExtractApiNameWithParams}});var P=n(2529);Object.defineProperty(t,"FFIApiParams",{enumerable:!0,get:function(){return P.FFIApiParams}});var v=n(8264);Object.defineProperty(t,"FFIApiReturn",{enumerable:!0,get:function(){return v.FFIApiReturn}});var b=n(2066);Object.defineProperty(t,"MapStringToType",{enumerable:!0,get:function(){return b.MapStringToType}});var _=n(4752);Object.defineProperty(t,"FFIDownloadInfo",{enumerable:!0,get:function(){return _.FFIDownloadInfo}});var I=n(407);Object.defineProperty(t,"HttpMethod",{enumerable:!0,get:function(){return I.HttpMethod}}),Object.defineProperty(t,"HttpRequestSchema",{enumerable:!0,get:function(){return I.HttpRequestSchema}}),Object.defineProperty(t,"PluginHttpRequest",{enumerable:!0,get:function(){return I.PluginHttpRequest}}),Object.defineProperty(t,"PluginHttpRequestSchema",{enumerable:!0,get:function(){return I.PluginHttpRequestSchema}}),Object.defineProperty(t,"PluginHttpResponse",{enumerable:!0,get:function(){return I.PluginHttpResponse}});var O=n(8360);Object.defineProperty(t,"PluginInputSchema",{enumerable:!0,get:function(){return O.PluginInputSchema}}),Object.defineProperty(t,"PluginInputs",{enumerable:!0,get:function(){return O.PluginInputs}});var w=n(9960);Object.defineProperty(t,"LegacyPluginInputType",{enumerable:!0,get:function(){return w.LegacyPluginInputType}}),Object.defineProperty(t,"PluginInputsLegacy",{enumerable:!0,get:function(){return w.PluginInputsLegacy}}),Object.defineProperty(t,"PluginInputsUnionSchema",{enumerable:!0,get:function(){return w.PluginInputsUnionSchema}}),Object.defineProperty(t,"SettingInputsLegacy",{enumerable:!0,get:function(){return w.SettingInputsLegacy}});var C=n(5269);Object.defineProperty(t,"PluginLanguagePack",{enumerable:!0,get:function(){return C.PluginLanguagePack}});var k=n(4763);Object.defineProperty(t,"TossMerchant",{enumerable:!0,get:function(){return k.TossMerchant}});var j=n(4992);Object.defineProperty(t,"FromWebviewMessage",{enumerable:!0,get:function(){return j.FromWebviewMessage}}),Object.defineProperty(t,"FromWorkerMessage",{enumerable:!0,get:function(){return j.FromWorkerMessage}}),Object.defineProperty(t,"PluginMessage",{enumerable:!0,get:function(){return j.PluginMessage}}),Object.defineProperty(t,"PluginMessageNames",{enumerable:!0,get:function(){return j.PluginMessageNames}}),Object.defineProperty(t,"PluginMessageResponse",{enumerable:!0,get:function(){return j.PluginMessageResponse}});var S=n(4655);Object.defineProperty(t,"PluginDeliveryOrderDto",{enumerable:!0,get:function(){return S.PluginDeliveryOrderDto}}),Object.defineProperty(t,"PluginDeliveryOrderDtoSchema",{enumerable:!0,get:function(){return S.PluginDeliveryOrderDtoSchema}});var T=n(9068);Object.defineProperty(t,"PluginOrder",{enumerable:!0,get:function(){return T.PluginOrder}}),Object.defineProperty(t,"PluginOrderSchema",{enumerable:!0,get:function(){return T.PluginOrderSchema}});var x=n(5287);Object.defineProperty(t,"PluginOrderDto",{enumerable:!0,get:function(){return x.PluginOrderDto}}),Object.defineProperty(t,"PluginOrderDtoSchema",{enumerable:!0,get:function(){return x.PluginOrderDtoSchema}});var z=n(7615);Object.defineProperty(t,"PluginOrderDiningOption",{enumerable:!0,get:function(){return z.PluginOrderDiningOption}}),Object.defineProperty(t,"PluginOrderItem",{enumerable:!0,get:function(){return z.PluginOrderItem}}),Object.defineProperty(t,"PluginOrderItemSchema",{enumerable:!0,get:function(){return z.PluginOrderItemSchema}});var Z=n(2475);Object.defineProperty(t,"PluginOrderPaymentState",{enumerable:!0,get:function(){return Z.PluginOrderPaymentState}});var M=n(6191);Object.defineProperty(t,"PluginOrderState",{enumerable:!0,get:function(){return M.PluginOrderState}});var E=n(6281);Object.defineProperty(t,"PluginDeliveryDiscount",{enumerable:!0,get:function(){return E.PluginDeliveryDiscount}}),Object.defineProperty(t,"PluginDeliveryDiscountSchema",{enumerable:!0,get:function(){return E.PluginDeliveryDiscountSchema}});var D=n(5513);Object.defineProperty(t,"PluginDiscount",{enumerable:!0,get:function(){return D.PluginDiscount}});var R=n(8375);Object.defineProperty(t,"PaymentMethodResponse",{enumerable:!0,get:function(){return R.PaymentMethodResponse}});var A=n(9339);Object.defineProperty(t,"PluginPrice",{enumerable:!0,get:function(){return A.PluginPrice}});var N=n(7850);Object.defineProperty(t,"PluginAccountTransferPayment",{enumerable:!0,get:function(){return N.PluginAccountTransferPayment}});var L=n(4530);Object.defineProperty(t,"PluginBarcodePayment",{enumerable:!0,get:function(){return L.PluginBarcodePayment}}),Object.defineProperty(t,"PluginPaymentExternalSourceType",{enumerable:!0,get:function(){return L.PluginPaymentExternalSourceType}});var F=n(2874);Object.defineProperty(t,"PluginCardPayment",{enumerable:!0,get:function(){return F.PluginCardPayment}}),Object.defineProperty(t,"PluginCardPaymentSchema",{enumerable:!0,get:function(){return F.PluginCardPaymentSchema}}),Object.defineProperty(t,"PluginPaymentCardType",{enumerable:!0,get:function(){return F.PluginPaymentCardType}}),Object.defineProperty(t,"PluginPaymentCardTypeSchema",{enumerable:!0,get:function(){return F.PluginPaymentCardTypeSchema}}),Object.defineProperty(t,"VanType",{enumerable:!0,get:function(){return F.VanType}}),Object.defineProperty(t,"VanTypeSchema",{enumerable:!0,get:function(){return F.VanTypeSchema}});var U=n(6113);Object.defineProperty(t,"PluginCashPayment",{enumerable:!0,get:function(){return U.PluginCashPayment}});var V=n(3307);Object.defineProperty(t,"PluginCashReceipt",{enumerable:!0,get:function(){return V.PluginCashReceipt}}),Object.defineProperty(t,"PluginCashReceiptIssuanceType",{enumerable:!0,get:function(){return V.PluginCashReceiptIssuanceType}}),Object.defineProperty(t,"PluginCashReceiptIssuanceTypeSchema",{enumerable:!0,get:function(){return V.PluginCashReceiptIssuanceTypeSchema}}),Object.defineProperty(t,"PluginCashReceiptIssuerType",{enumerable:!0,get:function(){return V.PluginCashReceiptIssuerType}}),Object.defineProperty(t,"PluginCashReceiptIssuerTypeSchema",{enumerable:!0,get:function(){return V.PluginCashReceiptIssuerTypeSchema}}),Object.defineProperty(t,"PluginCashReceiptSchema",{enumerable:!0,get:function(){return V.PluginCashReceiptSchema}});var q=n(4665);Object.defineProperty(t,"PluginExternalPayment",{enumerable:!0,get:function(){return q.PluginExternalPayment}});var H=n(80);Object.defineProperty(t,"PluginPayment",{enumerable:!0,get:function(){return H.PluginPayment}}),Object.defineProperty(t,"PluginPaymentOf",{enumerable:!0,get:function(){return H.PluginPaymentOf}});var $=n(677);Object.defineProperty(t,"PluginPaymentBase",{enumerable:!0,get:function(){return $.PluginPaymentBase}}),Object.defineProperty(t,"PluginPaymentBaseSchema",{enumerable:!0,get:function(){return $.PluginPaymentBaseSchema}}),Object.defineProperty(t,"PluginPaymentState",{enumerable:!0,get:function(){return $.PluginPaymentState}}),Object.defineProperty(t,"PluginPaymentStateSchema",{enumerable:!0,get:function(){return $.PluginPaymentStateSchema}});var B=n(5147);Object.defineProperty(t,"PluginCancelledPaymentDto",{enumerable:!0,get:function(){return B.PluginCancelledPaymentDto}}),Object.defineProperty(t,"PluginPaymentDto",{enumerable:!0,get:function(){return B.PluginPaymentDto}}),Object.defineProperty(t,"PluginPaymentDtoSchema",{enumerable:!0,get:function(){return B.PluginPaymentDtoSchema}});var K=n(8865);Object.defineProperty(t,"PluginPaymentInstallment",{enumerable:!0,get:function(){return K.PluginPaymentInstallment}});var W=n(6397);Object.defineProperty(t,"PluginPaymentSourceType",{enumerable:!0,get:function(){return W.PluginPaymentSourceType}});var Y=n(5720);Object.defineProperty(t,"PluginServerOnHttpRequest",{enumerable:!0,get:function(){return Y.PluginServerOnHttpRequest}});var G=n(6193);Object.defineProperty(t,"PluginHall",{enumerable:!0,get:function(){return G.PluginHall}}),Object.defineProperty(t,"PluginHallSchema",{enumerable:!0,get:function(){return G.PluginHallSchema}});var Q=n(692);Object.defineProperty(t,"PluginTable",{enumerable:!0,get:function(){return Q.PluginTable}}),Object.defineProperty(t,"PluginTableGroup",{enumerable:!0,get:function(){return Q.PluginTableGroup}}),Object.defineProperty(t,"PluginTableGroupSchema",{enumerable:!0,get:function(){return Q.PluginTableGroupSchema}}),Object.defineProperty(t,"PluginTableSchema",{enumerable:!0,get:function(){return Q.PluginTableSchema}});var J=n(7494);Object.defineProperty(t,"PageRequestData",{enumerable:!0,get:function(){return J.PageRequestData}}),Object.defineProperty(t,"PageResponseData",{enumerable:!0,get:function(){return J.PageResponseData}});var X=n(8759);Object.defineProperty(t,"AllPopupElementsSchema",{enumerable:!0,get:function(){return X.AllPopupElementsSchema}}),Object.defineProperty(t,"BarcodeElementsSchema",{enumerable:!0,get:function(){return X.BarcodeElementsSchema}}),Object.defineProperty(t,"BarcodeResponseSchema",{enumerable:!0,get:function(){return X.BarcodeResponseSchema}}),Object.defineProperty(t,"PopupActionResponse",{enumerable:!0,get:function(){return X.PopupActionResponse}}),Object.defineProperty(t,"PopupElement",{enumerable:!0,get:function(){return X.PopupElement}}),Object.defineProperty(t,"PopupType",{enumerable:!0,get:function(){return X.PopupType}});var ee=n(5478);Object.defineProperty(t,"hasCallbackId",{enumerable:!0,get:function(){return ee.hasCallbackId}})},8360:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginInputSchema=void 0;const r=n(8211),a=r.z.object({id:r.z.string(),label:r.z.string(),required:r.z.boolean()}),i=a.extend({type:r.z.literal("text"),default:r.z.string(),placeholder:r.z.string().optional(),candidates:r.z.array(r.z.object({text:r.z.string(),value:r.z.string()})).optional()}),o=a.extend({type:r.z.literal("number"),default:r.z.string(),placeholder:r.z.string().optional(),candidates:r.z.array(r.z.object({text:r.z.string(),value:r.z.string()})).optional()}),s=a.extend({type:r.z.literal("password"),default:r.z.string(),placeholder:r.z.string().optional()}),d=r.z.object({id:r.z.string(),label:r.z.string()}),u=a.extend({type:r.z.literal("radio"),values:r.z.array(d),default:r.z.string()}),c=a.extend({type:r.z.literal("checkbox"),values:r.z.array(d),default:r.z.array(r.z.string())}),l=a.extend({type:r.z.literal("toggle"),default:r.z.boolean()}),p=a.extend({type:r.z.literal("slider"),default:r.z.number(),min:r.z.number(),max:r.z.number(),step:r.z.number()}),m=r.z.object({id:r.z.string(),text:r.z.string(),type:r.z.enum(["primary","danger","weak"])});t.PluginInputSchema=r.z.union([i,o,s,u,c,l,p,m])},9960:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginInputsUnionSchema=void 0;const r=n(8211),a=r.z.object({label:r.z.string(),required:r.z.boolean()}),i=a.extend({type:r.z.literal("text"),default:r.z.string(),placeholder:r.z.string().optional()}),o=a.extend({type:r.z.literal("password"),default:r.z.string(),placeholder:r.z.string().optional()}),s=r.z.object({id:r.z.string(),label:r.z.string()}),d=a.extend({type:r.z.literal("radio"),values:r.z.array(s),default:r.z.string()}),u=a.extend({type:r.z.literal("checkbox"),values:r.z.array(s),default:r.z.array(r.z.string())}),c=a.extend({type:r.z.literal("toggle"),default:r.z.boolean()}),l=a.extend({type:r.z.literal("slider"),default:r.z.number(),min:r.z.number(),max:r.z.number(),step:r.z.number()});t.PluginInputsUnionSchema=r.z.union([i,o,d,u,c,l])},2817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5269:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginLanguagePackSchema=void 0;const r=n(8211);t.PluginLanguagePackSchema=r.z.object({languages:r.z.record(r.z.string(),r.z.string())})},3041:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(5269),t),a(n(2817),t)},4763:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDeliveryOrderDtoSchema=void 0;const r=n(8211),a=n(3340),i=n(5287),o=n(7615),s=n(6281);t.PluginDeliveryOrderDtoSchema=i.PluginOrderDtoSchema.extend({cancelled:r.z.boolean(),delivery:a.PluginDeliverySchema,lineItems:r.z.array(o.PluginOrderItemSchema.omit({id:!0,orderId:!0,item:!0,optionChoices:!0}).extend({item:r.z.object({title:r.z.string(),type:r.z.enum(["ITEM","DELIVERY_FEE"])}),optionChoices:r.z.array(r.z.object({title:r.z.string(),priceValue:r.z.number()})),discounts:r.z.array(s.PluginDeliveryDiscountSchema).optional()})),discounts:r.z.array(s.PluginDeliveryDiscountSchema)})},9068:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderSchema=t.PluginOrderRequestInfoSchema=t.PluginOrderPaymentPriceSchema=t.PluginOrderChargePriceSchema=void 0;const r=n(5513),a=n(7615),i=n(692),o=n(80),s=n(8211);t.PluginOrderChargePriceSchema=s.z.object({chargeDiscountValue:s.z.number(),chargeListPriceValue:s.z.number(),chargePriceValue:s.z.number(),chargeSupplyValue:s.z.number(),chargeTaxValue:s.z.number(),chargeTipValue:s.z.number()}),t.PluginOrderPaymentPriceSchema=s.z.object({paymentUnpaidValue:s.z.number(),paymentPaidValue:s.z.number()}),t.PluginOrderRequestInfoSchema=s.z.object({requestAt:s.z.string(),expiredAt:s.z.string(),expectedReadyAt:s.z.string(),estimatedReadyAt:s.z.string().nullable().optional(),acceptedAt:s.z.string().nullable().optional(),declinedAt:s.z.string().nullable().optional(),declinedReason:s.z.string().nullable().optional()}),t.PluginOrderSchema=s.z.object({id:s.z.string(),tableId:s.z.number().nullable().optional(),table:s.z.lazy((()=>i.PluginTableSchema)).nullable().optional(),orderKey:s.z.string(),state:s.z.enum(["OPENED","PAID","CANCELLED","COMPLETED","REFUNDED"]),lineItems:s.z.array(s.z.lazy((()=>a.PluginOrderItemSchema))),discounts:s.z.array(s.z.lazy((()=>r.PluginDiscountSchema))).nullable().optional(),payments:s.z.array(s.z.lazy((()=>o.PluginPaymentSchema))),chargePrice:s.z.lazy((()=>t.PluginOrderChargePriceSchema)),paymentPrice:s.z.lazy((()=>t.PluginOrderPaymentPriceSchema)),requestedInfo:s.z.lazy((()=>t.PluginOrderRequestInfoSchema)).nullable().optional(),source:s.z.string(),memo:s.z.string().nullable().optional(),openedAt:s.z.string().nullable().optional(),createdAt:s.z.string(),updatedAt:s.z.string().nullable().optional(),cancelledAt:s.z.string().nullable().optional(),completedAt:s.z.string().nullable().optional()})},5287:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderDtoSchema=void 0;const r=n(8211),a=n(7615),i=n(5513);t.PluginOrderDtoSchema=r.z.object({memo:r.z.string().optional(),discounts:r.z.array(i.PluginDiscountSchema),tableId:r.z.number().optional(),lineItems:r.z.array(a.PluginOrderItemSchema.omit({id:!0,orderId:!0}))})},7615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginOrderItemSchema=t.OrderItemTypeSchema=t.PluginOrderDiningOptionSchema=void 0;const r=n(8211),a=n(5513),i=n(9414),o=n(5236);t.PluginOrderDiningOptionSchema=r.z.enum(["HERE","TOGO","DELIVERY","PICKUP"]),t.OrderItemTypeSchema=r.z.enum(["ITEM","DELIVERY_FEE","PREPAID_CARD","MULTI_USE_TICKET"]),t.PluginOrderItemSchema=r.z.object({id:r.z.string(),orderId:r.z.string(),diningOption:r.z.lazy((()=>t.PluginOrderDiningOptionSchema)),item:r.z.object({id:r.z.number(),title:r.z.string(),category:r.z.lazy((()=>o.PluginCatalogCategorySchema)),type:r.z.lazy((()=>t.OrderItemTypeSchema))}),quantity:r.z.object({value:r.z.number()}),chargePrice:r.z.object({value:r.z.number()}),optionChoices:r.z.array(r.z.lazy((()=>i.PluginCatalogItemOptionChoiceSchema))),discounts:r.z.array(r.z.lazy((()=>a.PluginDiscountSchema))).optional(),memo:r.z.string().optional()})},2475:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6191:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6281:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDeliveryDiscountSchema=void 0;const r=n(8211),a=n(5513);t.PluginDeliveryDiscountSchema=a.PluginDiscountSchema.extend({discountBy:r.z.enum(["OWNER","PLATFORM"])})},5513:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginDiscountSchema=void 0;const r=n(8211),a=n(3041);t.PluginDiscountSchema=r.z.object({amountMoney:r.z.object({value:r.z.number()}),title:r.z.string(),titleI18n:r.z.lazy((()=>a.PluginLanguagePackSchema)).optional()})},8375:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9339:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7850:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4530:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2874:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCardDetailsSchema=t.PluginCardPaymentSchema=t.PluginPaymentCardTypeSchema=t.VanTypeSchema=void 0;const r=n(8211),a=n(677);t.VanTypeSchema=r.z.enum(["NICE","KIS","SMARTRO","KOVAN"]),t.PluginPaymentCardTypeSchema=r.z.enum(["CREDIT","DEBIT","PREPAID","FOREIGN"]),t.PluginCardPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("CARD"),cardDetails:r.z.lazy((()=>t.PluginCardDetailsSchema))}),t.PluginCardDetailsSchema=r.z.object({installmentMonth:r.z.string().max(2),cardType:t.PluginPaymentCardTypeSchema,cardBrand:r.z.string(),cardBrandId:r.z.string().nullable().optional(),cardNo:r.z.string().nullable().optional(),source:r.z.string().nullable().optional(),sourceId:r.z.string().nullable().optional(),balance:r.z.number().nullable().optional(),van:t.VanTypeSchema.nullable().optional()})},6113:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCashPaymentSchema=void 0;const r=n(8211),a=n(677);t.PluginCashPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("CASH")})},3307:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginCashReceiptSchema=t.PluginCashReceiptIssuanceTypeSchema=t.PluginCashReceiptIssuerTypeSchema=void 0;const r=n(8211);t.PluginCashReceiptIssuerTypeSchema=r.z.enum(["CONSUMER","BUSINESSES"]),t.PluginCashReceiptIssuanceTypeSchema=r.z.enum(["PHONE","BUSINESS_NUMBER","CARD"]),t.PluginCashReceiptSchema=r.z.object({identityNumber:r.z.string(),issuerType:t.PluginCashReceiptIssuerTypeSchema,issuanceType:t.PluginCashReceiptIssuanceTypeSchema,selfIssuance:r.z.boolean()})},4665:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginExternalPaymentSchema=void 0;const r=n(8211),a=n(677);t.PluginExternalPaymentSchema=a.PluginPaymentBaseSchema.extend({sourceType:r.z.literal("EXTERNAL"),externalDetails:r.z.object({source:r.z.string().nullable().optional(),sourceId:r.z.string().nullable().optional()})})},80:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentSchema=void 0;const r=n(8211),a=n(2874),i=n(6113),o=n(4665);t.PluginPaymentSchema=r.z.object({paymentKey:r.z.string()}).and(r.z.discriminatedUnion("sourceType",[a.PluginCardPaymentSchema,i.PluginCashPaymentSchema,o.PluginExternalPaymentSchema]))},677:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentBaseSchema=t.PluginPaymentStateSchema=void 0;const r=n(8211);t.PluginPaymentStateSchema=r.z.enum(["APPROVED","COMPLETED","CANCELLED"]),t.PluginPaymentBaseSchema=r.z.object({id:r.z.string(),orderId:r.z.string(),state:t.PluginPaymentStateSchema,sourceType:r.z.custom(),amountMoney:r.z.number(),taxMoney:r.z.number(),supplyMoney:r.z.number(),tipMoney:r.z.number(),taxExemptMoney:r.z.number().nullable().optional(),approvedNo:r.z.string(),approvedAt:r.z.string(),cancelledAt:r.z.string().nullable().optional(),cashReceipt:r.z.custom().nullable().optional()})},5147:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginPaymentDtoSchema=void 0;const r=n(8211),a=n(3307),i=n(2874),o=r.z.object({orderId:r.z.string(),sourceType:r.z.custom(),amountMoney:r.z.number(),taxMoney:r.z.number(),approvedNo:r.z.string(),approvedAt:r.z.string(),paymentKey:r.z.string(),supplyMoney:r.z.number(),tipMoney:r.z.number(),taxExemptMoney:r.z.number().nullable().optional()}),s=o.extend({sourceType:r.z.literal("CARD"),cardDetails:r.z.lazy((()=>i.PluginCardDetailsSchema))}),d=o.extend({sourceType:r.z.literal("CASH"),cashReceipt:a.PluginCashReceiptSchema.nullable().optional()}),u=o.extend({sourceType:r.z.literal("EXTERNAL")});t.PluginPaymentDtoSchema=r.z.discriminatedUnion("sourceType",[s,d,u])},8865:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6397:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5720:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginHallSchema=void 0;const r=n(8211);t.PluginHallSchema=r.z.object({id:r.z.number(),title:r.z.string(),order:r.z.number()})},692:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginTableSchema=t.PluginTableGroupSchema=void 0;const r=n(8211);t.PluginTableGroupSchema=r.z.object({id:r.z.number(),color:r.z.string(),merchantId:r.z.number(),tableIds:r.z.array(r.z.number())}),t.PluginTableSchema=r.z.object({id:r.z.number(),hallId:r.z.number(),title:r.z.string(),group:t.PluginTableGroupSchema.nullable().optional()})},7494:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8759:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AllPopupElementsSchema=t.BarcodeResponseSchema=t.BarcodeElementsSchema=void 0;const r=n(8211);t.BarcodeElementsSchema=r.z.object({type:r.z.literal("barcode"),productName:r.z.string()}),t.BarcodeResponseSchema=r.z.discriminatedUnion("complete",[r.z.object({type:r.z.literal("barcode"),complete:r.z.literal(!0),data:r.z.discriminatedUnion("result",[r.z.object({barcode:r.z.string(),result:r.z.literal("SUCCESS")}),r.z.object({result:r.z.literal("CANCELLED")})])}),r.z.object({type:r.z.literal("barcode"),complete:r.z.literal(!1),errorMessage:r.z.string()})]),t.AllPopupElementsSchema=r.z.discriminatedUnion("type",[t.BarcodeElementsSchema])},5478:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasCallbackId=void 0,t.hasCallbackId=function(e){return"callbackId"in e}},8924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createCallbackId=void 0,t.createCallbackId=function(e=10){let t="";for(let n=0;n<e;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}},7147:function(e,t,n){var r,a=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.cashReceipt=t.CashReceiptImpl=void 0;const s=n(8924),d=n(9594),u=n(6788),c=n(4899),l=n(4688);class p{add(e){return o(this,void 0,void 0,(function*(){d.CashReceiptSchema.parse(e);const t=yield c.webview.send({name:"cash-receipt.issue.request",callbackId:(0,s.createCallbackId)(),data:e});if(!t.data.complete)throw new u.PosPluginSdkError(t.data.errorMessage)}))}}a([(0,l.PosRateLimiter)(),i("design:type",Function),i("design:paramtypes",["function"==typeof(r=void 0!==d.CashReceipt&&d.CashReceipt)?r:Object]),i("design:returntype",Promise)],p.prototype,"add",null),t.CashReceiptImpl=p,t.cashReceipt=new p},6485:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.catalog=void 0;const a=n(4899),i=n(5179),o=n(8987),s=new Map;s.set("before-add",(()=>r(void 0,void 0,void 0,(function*(){return{}})))),t.catalog=new o.CatalogImpl(a.webview,i.ui,s)},8987:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CatalogImpl=void 0;const o=n(8924),s=n(6788),d=n(4688);class u{constructor(e,t,n=new Map){this.webview=e,this.ui=t,this.responseEventHandler=n,this.eventHandler=new Map,this.webview.addHandler("catalog.change.event",(({data:e})=>{const t=this.eventHandler.get(e.event);t&&t(e.catalog)})),this.webview.addHandler("catalog.event.request",(e=>i(this,void 0,void 0,(function*(){const t=this.responseEventHandler.get(e.data.event);if(!t)return;const n=yield t({payload:e.data.payload,ui:this.ui});this.webview.send({name:"catalog.event.response",callbackId:e.callbackId,data:{complete:!0,event:"before-add",payload:{initialValue:n.initialValue}}})}))))}getCatalogs(){return i(this,void 0,void 0,(function*(){const e=yield this.webview.send({name:"catalog.list.request",callbackId:(0,o.createCallbackId)(),data:{}});if(!e.data.complete)throw new s.PosPluginSdkError(e.data.errorMessage);return e.data.catalogs}))}on(e,t){return i(this,void 0,void 0,(function*(){"sold-out"!==e&&"on-sale"!==e&&"update"!==e&&"add"!==e&&"delete"!==e||this.eventHandler.set(e,t),"before-add"===e&&this.responseEventHandler.set(e,t)}))}}r([(0,d.PosRateLimiter)(),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],u.prototype,"getCatalogs",null),t.CatalogImpl=u},7687:function(e,t,n){var r,a=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.category=t.CategoryImpl=void 0;const s=n(8924),d=n(4899),u=n(6788),c=n(4688);class l{constructor(){this.handler=new Map}getCategories(){return o(this,void 0,void 0,(function*(){const e=yield d.webview.send({name:"category.list.request",callbackId:(0,s.createCallbackId)(),data:{}});if(!e.data.complete)throw new u.PosPluginSdkError(e.data.errorMessage);return e.data.categories}))}on(e,t){return o(this,void 0,void 0,(function*(){this.handler.set(e,t),d.webview.addHandler("category.change.event",(({data:e})=>{const t=this.handler.get(e.event);t&&t(e.category)}))}))}}a([(0,c.PosRateLimiter)(),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],l.prototype,"getCategories",null),t.CategoryImpl=l,t.category=new l},403:function(e,t,n){var r,a=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.device=t.DeviceImpl=void 0;const s=n(4899),d=n(8924),u=n(6788),c=n(4688);class l{getDeviceInfo(){return o(this,void 0,void 0,(function*(){const e=yield s.webview.send({name:"device.info.request",callbackId:(0,d.createCallbackId)(),data:{}});if(!0!==e.data.complete)throw new u.PosPluginSdkError(e.data.errorMessage);return e.data.device}))}}a([(0,c.PosRateLimiter)(),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],l.prototype,"getDeviceInfo",null),t.DeviceImpl=l,t.device=new l},2901:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.draftOrder=t.DraftOrderImpl=void 0;const a=n(9594),i=n(4899),o=n(8924),s=n(6788);class d{deleteDiscount(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"draft-order.delete-discount.request",callbackId:(0,o.createCallbackId)(),data:{indexOfDiscount:e}});if(!0!==t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);return t.data.draftOrder}))}updateItemOptionChoice(e,t){return r(this,void 0,void 0,(function*(){const n=yield i.webview.send({name:"draft-order.update-item-option-choices.request",callbackId:(0,o.createCallbackId)(),data:{key:e,optionChoices:t}});if(!0!==n.data.complete)throw new s.PosPluginSdkError(n.data.errorMessage);return n.data.draftOrder}))}updateItemMemo(e,t){return r(this,void 0,void 0,(function*(){const n=yield i.webview.send({name:"draft-order.update-item-memo.request",callbackId:(0,o.createCallbackId)(),data:{key:e,memo:t}});if(!0!==n.data.complete)throw new s.PosPluginSdkError(n.data.errorMessage);return n.data.draftOrder}))}updateIgnorePrint(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"draft-order.update-is-ignore-print.request",callbackId:(0,o.createCallbackId)(),data:{ignorePrint:e}});if(!0!==t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);return t.data.draftOrder}))}deleteItemDiscount(e,t){return r(this,void 0,void 0,(function*(){const n=yield i.webview.send({name:"draft-order.delete-item-discount.request",callbackId:(0,o.createCallbackId)(),data:{key:e,indexOfDiscount:t}});if(!0!==n.data.complete)throw new s.PosPluginSdkError(n.data.errorMessage);return n.data.draftOrder}))}clear(){return r(this,void 0,void 0,(function*(){const e=yield i.webview.send({name:"draft-order.clear.request",callbackId:(0,o.createCallbackId)(),data:{}});if(!0!==e.data.complete)throw new s.PosPluginSdkError(e.data.errorMessage)}))}get(){return r(this,void 0,void 0,(function*(){const e=yield i.webview.send({name:"draft-order.get.request",callbackId:(0,o.createCallbackId)(),data:{}});if(!0!==e.data.complete)throw new s.PosPluginSdkError(e.data.errorMessage);return e.data.draftOrder}))}addLineItem(e){return r(this,void 0,void 0,(function*(){a.PluginDraftOrderItemDtoSchema.parse(e);const t=yield i.webview.send({name:"draft-order.add-line-item.request",callbackId:(0,o.createCallbackId)(),data:{lineItem:e}});if(!0!==t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);return t.data.draftOrder}))}deleteLineItem(e){return r(this,void 0,void 0,(function*(){const t=yield i.webview.send({name:"draft-order.delete-line-item.request",callbackId:(0,o.createCallbackId)(),data:{key:e}});if(!0!==t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);return t.data.draftOrder}))}startPayment(){return r(this,void 0,void 0,(function*(){yield i.webview.send({name:"draft-order.start-payment",callbackId:(0,o.createCallbackId)(),data:{}})}))}updateItemQuantity(e,t){return r(this,void 0,void 0,(function*(){const n=yield i.webview.send({name:"draft-order.update-item-quantity.request",callbackId:(0,o.createCallbackId)(),data:{key:e,quantity:t}});if(!0!==n.data.complete)throw new s.PosPluginSdkError(n.data.errorMessage);return n.data.draftOrder}))}}t.DraftOrderImpl=d,t.draftOrder=new d},6788:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PosPluginSdkRateLimitError=t.PosPluginSdkError=void 0;class n extends Error{constructor(e){super(e)}static isPosPluginSdkError(e){return e instanceof n}}t.PosPluginSdkError=n;class r extends n{constructor(e){super(e)}static isPosPluginSdkRateLimitError(e){return e instanceof r}}t.PosPluginSdkRateLimitError=r},5349:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ffi=void 0;const a=n(4899),i=n(8924),o=n(6788),s=new Map;t.ffi={download:function(e){return r(this,void 0,void 0,(function*(){const t=yield a.webview.send({name:"ffi.download.request",callbackId:(0,i.createCallbackId)(),data:e});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage);return{platform:t.data.platform}}))},load:function(e,t){return r(this,void 0,void 0,(function*(){const n=yield a.webview.send({name:"ffi.load.request",callbackId:(0,i.createCallbackId)(),data:{filePath:e,apis:t}});if(!n.data.complete)throw new o.PosPluginSdkError(n.data.errorMessage)}))},unload:function(e){return r(this,void 0,void 0,(function*(){const t=yield a.webview.send({name:"ffi.unload.request",callbackId:(0,i.createCallbackId)(),data:{filePath:e}});if(!t.data.complete)throw new o.PosPluginSdkError(t.data.errorMessage);s.clear()}))},invoke:function(e,t,n){return r(this,void 0,void 0,(function*(){const r=yield a.webview.send({name:"ffi.invoke.request",callbackId:(0,i.createCallbackId)(),data:{filePath:e,apiName:t,params:n}});if(!r.data.complete)throw new o.PosPluginSdkError(r.data.errorMessage);return r.data.result}))},registerCallback:function(e,t,n){return r(this,void 0,void 0,(function*(){if(s.size>100)throw new o.PosPluginSdkError("Too many callbacks registered. The maximum allowed is 100.");const d=yield a.webview.send({name:"ffi.register-callback.request",callbackId:(0,i.createCallbackId)(),data:{filePath:e,signature:t}});if(!d.data.complete)throw new o.PosPluginSdkError(`registerCallback failed - ${d.callbackId}`);if(!d.data.callbackId||"string"!=typeof d.data.callbackId||""===d.data.callbackId.trim())throw new o.PosPluginSdkError(`registerCallback failed - ${d.callbackId}`);return s.set(`${d.data.callbackId}`,n),function(){r(this,void 0,void 0,(function*(){a.webview.addHandler("ffi.callback-executed.event",(({data:e})=>{(e=>{const{ffiCallbackId:t,args:n}=e,r=s.get(t);if(r)r(...n);else{const e=s.get("handleCallbackError");e&&e(new o.PosPluginSdkError("registerCallback failed - ffi callback not found"))}})(e)}))}))}(),{ffiCallbackId:d.data.callbackId}}))},unregisterCallback:function(e,t){return r(this,void 0,void 0,(function*(){const n=yield a.webview.send({name:"ffi.unregister-callback.request",callbackId:(0,i.createCallbackId)(),data:{filePath:e,callbackId:t}});if(!n.data.complete)throw new o.PosPluginSdkError(`unregister failed - ${n.data.errorMessage}`)}))},addCallbackErrorHandler:function(e,t){s.set(`${e}-handleCallbackError`,t)}}},4347:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.http=void 0;const a=n(4899),i=n(9594),o=n(8924),s=n(6788);function d(e){return r(this,void 0,void 0,(function*(){return(yield a.webview.send({name:"http.client.request",callbackId:(0,o.createCallbackId)(),data:{url:e.url,method:e.method,payload:e.payload,headers:e.headers}})).data}))}function u(e){return r(this,void 0,void 0,(function*(){const t=yield a.webview.send({name:"http.request",callbackId:(0,o.createCallbackId)(),data:{url:e.url,method:e.method,payload:e.payload,headers:e.headers}});if(!t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);return{body:t.data.body,headers:t.data.headers,code:t.data.code}}))}let c=null;function l(e){return t=>r(this,void 0,void 0,(function*(){i.PluginHttpRequestSchema.parse(Object.assign(Object.assign({},t),{method:e}));const n=Object.assign(Object.assign({},t),{method:e});if(null!==c)return c?yield u(n):yield d(n);try{const e=yield Promise.race([u(n),new Promise(((e,t)=>{setTimeout((()=>{t(new s.PosPluginSdkError("Timeout"))}),5e3)}))]);return c=!0,e}catch(n){if(!(n instanceof s.PosPluginSdkError)||"Timeout"!==n.message)throw n;return c=!1,yield d(Object.assign(Object.assign({},t),{method:e}))}}))}t.http={get:(e,t)=>l("GET")({url:e,payload:void 0,headers:t||[]}),post:(e,t,n)=>l("POST")({url:e,payload:t,headers:n||[]}),delete:(e,t)=>l("DELETE")({url:e,payload:void 0,headers:t||[]}),head:(e,t)=>l("HEAD")({url:e,payload:void 0,headers:t||[]}),options:(e,t)=>l("OPTIONS")({url:e,payload:void 0,headers:t||[]}),put:(e,t,n)=>l("PUT")({url:e,payload:t,headers:n||[]}),patch:(e,t,n)=>l("PATCH")({url:e,payload:t,headers:n||[]})}},4688:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PosRateLimiter=void 0;const r=n(7660);t.PosRateLimiter=()=>(0,r.createRateLimiter)({key:"default-rate-limit"},{ms:1e3,limit:10})},7660:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createRateLimiter=void 0;const a=n(9421),i=n(6788);t.createRateLimiter=function({key:e},{ms:t,limit:n}){const o=new a.MemoryStore,s=n+1,d=new a.SlideLimiter(o,{windowMs:t,maxLimit:s});return function(a,o,s){const u=s.value;return s.value=function(...a){return r(this,void 0,void 0,(function*(){if((yield d.hit("DEFAULT-BUCKET",e))<=0)throw new i.PosPluginSdkRateLimitError(`해당 기능은 ${t/1e3}초당 ${n}회만 호출할 수 있습니다`);return u.apply(this,a)}))},s}}},4591:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.merchant=void 0;const r=n(8613);t.merchant=new r.MerchantImpl},8613:function(e,t,n){var r,a=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MerchantImpl=void 0;const s=n(4899),d=n(8924),u=n(6788),c=n(4688);class l{getMerchant(){var e;return o(this,void 0,void 0,(function*(){const{data:t}=yield s.webview.send({name:"merchant.info.request",callbackId:(0,d.createCallbackId)(),data:{}});if(!t.complete)throw new u.PosPluginSdkError(null!==(e=t.errorMessage)&&void 0!==e?e:"Unknown error");return t.merchant}))}}a([(0,c.PosRateLimiter)(),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],l.prototype,"getMerchant",null),t.MerchantImpl=l},4859:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.navigation=t.NavigationImpl=void 0;const r=n(4899);class a{navigate(e,t){"business-type-setting"===e?r.webview.send({name:"navigation.navigate",data:{page:e}}):"plugin-tab"===e&&r.webview.send({name:"navigation.navigate",data:{page:e,packageName:t}})}}t.NavigationImpl=a,t.navigation=new a},2765:function(e,t,n){var r,a=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.option=t.MenuOptionImpl=void 0;const s=n(8924),d=n(4899),u=n(6788),c=n(4688);class l{constructor(){this.handler=new Map}getOptions(){return o(this,void 0,void 0,(function*(){const e=yield d.webview.send({name:"option.list.request",callbackId:(0,s.createCallbackId)(),data:{}});if(!e.data.complete)throw new u.PosPluginSdkError(e.data.errorMessage);return e.data.options}))}on(e,t){return o(this,void 0,void 0,(function*(){this.handler.set(e,t),d.webview.addHandler("option.change.event",(({data:e})=>{const t=this.handler.get(e.event);t&&t(e.option)}))}))}}a([(0,c.PosRateLimiter)(),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],l.prototype,"getOptions",null),t.MenuOptionImpl=l,t.option=new l},3555:function(e,t,n){var r,a,i,o,s,d,u,c,l=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},p=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},m=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OrderImpl=void 0;const f=n(8924),h=n(9594),g=n(4899),y=n(6788),P=n(4688),v=new Map;class b{cancel(e){return m(this,void 0,void 0,(function*(){const t=yield g.webview.send({name:"order.cancel.request",callbackId:(0,f.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new y.PosPluginSdkError(t.data.errorMessage)}))}add(e){return m(this,void 0,void 0,(function*(){h.PluginOrderDtoSchema.parse(e);const t=yield g.webview.send({name:"order.add.request",callbackId:(0,f.createCallbackId)(),data:{order:e}});if(!t.data.complete)throw new y.PosPluginSdkError(t.data.errorMessage);return t.data.order}))}on(e,t){return m(this,void 0,void 0,(function*(){v.set(e,t),g.webview.addHandler("order.change.event",(({data:e})=>{const t=v.get(e.event);t&&t(e.order)}))}))}addMenu(e,t){return m(this,void 0,void 0,(function*(){h.PluginOrderDtoSchema.parse(t);const n=yield g.webview.send({name:"order.add-menu.request",callbackId:(0,f.createCallbackId)(),data:{id:e,order:t}});if(!n.data.complete)throw new y.PosPluginSdkError(n.data.errorMessage);return n.data.order}))}complete(e){return m(this,void 0,void 0,(function*(){const t=yield g.webview.send({name:"order.complete.request",callbackId:(0,f.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new y.PosPluginSdkError(t.data.errorMessage);return t.data.order}))}getOrder(e){return m(this,void 0,void 0,(function*(){const t=yield g.webview.send({name:"order.get.request",callbackId:(0,f.createCallbackId)(),data:{id:e}});if(!t.data.complete)throw new y.PosPluginSdkError(t.data.errorMessage);return t.data.order}))}getOrders(e){return m(this,void 0,void 0,(function*(){const t=yield g.webview.send({name:"order.get-list.request",callbackId:(0,f.createCallbackId)(),data:e});if(!t.data.complete)throw new y.PosPluginSdkError(t.data.errorMessage);return t.data.orders}))}}l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",[String]),p("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],b.prototype,"cancel",null),l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",["function"==typeof(a=void 0!==h.PluginOrderDto&&h.PluginOrderDto)?a:Object]),p("design:returntype","function"==typeof(i="undefined"!=typeof Promise&&Promise)?i:Object)],b.prototype,"add",null),l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",[String,"function"==typeof(o=void 0!==h.PluginOrderDto&&h.PluginOrderDto)?o:Object]),p("design:returntype","function"==typeof(s="undefined"!=typeof Promise&&Promise)?s:Object)],b.prototype,"addMenu",null),l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",[String]),p("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],b.prototype,"complete",null),l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",[String]),p("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],b.prototype,"getOrder",null),l([(0,P.PosRateLimiter)(),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype","function"==typeof(c="undefined"!=typeof Promise&&Promise)?c:Object)],b.prototype,"getOrders",null),t.OrderImpl=b},6605:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.order=void 0;const r=n(3555);t.order=new r.OrderImpl},2799:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.paymentMethod=void 0;const a=n(4899),i=n(5179),o=new Map,s=new Map;t.paymentMethod={add:function({data:e,payCallback:t,cancelCallback:n}){o.set(e.id,t),s.set(e.id,n),a.webview.addHandler("payment.method.event.request",(t=>r(this,void 0,void 0,(function*(){const n="pay"===t.data.event?o.get(t.data.id):s.get(t.data.id);if(n)try{if("pay"===t.data.event){const e=yield n(t.data.order,t.data.price,i.ui);a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!0,paymentDto:e?{approvedAt:e.approvedAt,approvedNo:"",paymentKey:e.paymentKey}:void 0}})}else if("cancel"===t.data.event){const e=yield n(t.data.order,t.data.payment,i.ui);a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!0,cancelledPaymentDto:e}})}}catch(e){a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!1,errorMessage:e.message}})}else a.webview.send({name:"payment.method.event.response",callbackId:t.callbackId,data:{event:t.data.event,id:t.data.id,complete:!1,errorMessage:`${e.paymentName}로 ${"pay"===t.data.event?"결제":"결제취소"} 할 수 없습니다.`}})})))),a.webview.send({name:"payment.method.add",data:e})}}},8925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.payment=void 0;const r=n(4467);t.payment=new r.PaymentImpl},4467:function(e,t,n){var r,a,i,o=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentImpl=void 0;const u=n(4899),c=n(9594),l=n(8924),p=n(6788),m=n(4688);class f{constructor(){this.handler=new Map}on(e,t){return d(this,void 0,void 0,(function*(){this.handler.set(e,t),u.webview.addHandler("payment.change.event",(({data:e})=>{const t=this.handler.get(e.event);t&&t(e.payment,e.order)}))}))}cancel(e,t){return d(this,void 0,void 0,(function*(){const n=yield u.webview.send({name:"payment.cancel.request",callbackId:(0,l.createCallbackId)(),data:{order:e,payment:t}});if(!n.data.complete)throw new p.PosPluginSdkError(n.data.errorMessage)}))}add(e,t){return d(this,void 0,void 0,(function*(){c.PluginPaymentDtoSchema.parse(t);const n=yield u.webview.send({name:"payment.add.request",callbackId:(0,l.createCallbackId)(),data:{order:e,paymentDto:t}});if(!n.data.complete)throw new p.PosPluginSdkError(n.data.errorMessage);return n.data.payment}))}}o([(0,m.PosRateLimiter)(),s("design:type",Function),s("design:paramtypes",[Object,Object]),s("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],f.prototype,"cancel",null),o([(0,m.PosRateLimiter)(),s("design:type",Function),s("design:paramtypes",[Object,"function"==typeof(a=void 0!==c.PluginPaymentDto&&c.PluginPaymentDto)?a:Object]),s("design:returntype","function"==typeof(i="undefined"!=typeof Promise&&Promise)?i:Object)],f.prototype,"add",null),t.PaymentImpl=f},2896:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pluginMessenger=void 0;const r=n(4899),a=n(7074);t.pluginMessenger=new a.PluginMessengerImpl(r.webview)},7074:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PluginMessengerImpl=void 0,t.PluginMessengerImpl=class{constructor(e){this.webview=e}broadcast(e){this.webview.send({name:"plugin-messenger.broadcast",data:{message:e}})}on(e,t){"message"===e&&this.webview.addHandler("plugin-messenger.event",(e=>{t(e.data.message)}))}}},1503:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4689:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.plugin=void 0;const r=n(4899),a=n(3863);t.plugin=new a.PluginImpl(r.webview)},3863:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PluginImpl=void 0;const o=n(8924),s=n(6788),d=n(4688);class u{constructor(e){this.webview=e,this.pluginCallbacks=new Map,this.initializePlugin()}initializePlugin(){this.getPluginInfo().then((e=>{this.webview.setPluginMetadata(e)})),this.webview.addHandler("plugin.health-check.request",(e=>{this.webview.send({name:"plugin.health-check.response",callbackId:e.callbackId,data:{}})})),this.webview.addHandler("plugin.ready-to-update.request",(e=>{const t=this.pluginCallbacks.get("close");t?t().then((()=>{this.webview.send({name:"plugin.ready-to-update.response",callbackId:e.callbackId,data:{complete:!0,readyToUpdate:!0}})})).catch((t=>{this.webview.send({name:"plugin.ready-to-update.response",callbackId:e.callbackId,data:{errorMessage:t.message,complete:!1}})})):this.webview.send({name:"plugin.ready-to-update.response",callbackId:e.callbackId,data:{complete:!0,readyToUpdate:!1}})}))}on(e,t){this.pluginCallbacks.set(e,t)}getPluginInfo(){return i(this,void 0,void 0,(function*(){const e=yield this.webview.send({name:"plugin.info.request",callbackId:(0,o.createCallbackId)(),data:{}});if(!e.data.complete)throw new s.PosPluginSdkError(e.data.errorMessage);return{name:e.data.name,version:e.data.version}}))}}r([(0,d.PosRateLimiter)(),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],u.prototype,"getPluginInfo",null),t.PluginImpl=u},6192:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.posPluginSdk=void 0;const r=n(7147),a=n(853),i=n(4513),o=n(7687),s=n(2765),d=n(4347),u=n(3061),c=n(4591),l=n(2799),p=n(9397),m=n(5349),f=n(7730),h=n(403),g=n(2901),y=n(4859),P=n(6485),v=n(4689),b=n(2896),_=n(8925),I=n(6605);t.posPluginSdk={storage:a.storage,table:i.table,category:o.category,catalog:P.catalog,option:s.option,cashReceipt:r.cashReceipt,order:I.order,payment:_.payment,http:d.http,toast:u.toast,device:h.device,merchant:c.merchant,paymentMethod:l.paymentMethod,websocket:p.websocket,ffi:m.ffi,plugin:v.plugin,pluginMessenger:b.pluginMessenger,draftOrder:g.draftOrder,setting:f.setting,navigation:y.navigation}},7730:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.setting=void 0;const a=n(9594),i=n(4899),o=n(8924),s=n(6788);t.setting={setInputs:function(e){const t={};e.forEach((e=>{a.PluginInputsUnionSchema.parse(e),t[e.id]=e})),i.webview.send({name:"setting.set-inputs",data:t})},getValues:function(){return r(this,void 0,void 0,(function*(){const e=yield i.webview.send({name:"setting.values.request",callbackId:(0,o.createCallbackId)(),data:{}});if(!e.data.complete)throw new s.PosPluginSdkError(e.data.errorMessage);return e.data.settings}))}}},853:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;const a=n(8924),i=n(4899),o=n(6788);t.storage={get:function(e){var t;return r(this,void 0,void 0,(function*(){const{data:n}=yield i.webview.send({name:"storage.get.request",callbackId:(0,a.createCallbackId)(),data:{key:e}});if(!n.complete)throw new o.PosPluginSdkError(null!==(t=n.errorMessage)&&void 0!==t?t:"Unknown error");return n.value}))},set:function(e,t){var n;return r(this,void 0,void 0,(function*(){const{data:r}=yield i.webview.send({name:"storage.set.request",callbackId:(0,a.createCallbackId)(),data:{key:e,value:t}});if(!r.complete)throw new o.PosPluginSdkError(null!==(n=r.errorMessage)&&void 0!==n?n:"Unknown error")}))},del:function(e){var t;return r(this,void 0,void 0,(function*(){const{data:n}=yield i.webview.send({name:"storage.delete.request",callbackId:(0,a.createCallbackId)(),data:{key:e}});if(!n.complete)throw new o.PosPluginSdkError(null!==(t=n.errorMessage)&&void 0!==t?t:"Unknown error")}))}}},4513:function(e,t,n){var r,a,i=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.table=void 0;const d=n(8924),u=n(4899),c=n(9594),l=n(6788),p=n(4688);class m{constructor(){this.handler=new Map}getTables(){return s(this,void 0,void 0,(function*(){const e=yield u.webview.send({name:"table.list.request",callbackId:(0,d.createCallbackId)(),data:{}});if(!e.data.complete)throw new l.PosPluginSdkError(e.data.errorMessage);return e.data.tables}))}clearTable({table:e,order:t}){return s(this,void 0,void 0,(function*(){c.PluginTableSchema.parse(e),c.PluginOrderSchema.parse(t);const n=yield u.webview.send({name:"table.clear.request",callbackId:(0,d.createCallbackId)(),data:{table:e,order:t}});if(!n.data.complete)throw new l.PosPluginSdkError(n.data.errorMessage)}))}on(e,t){this.handler.set(e,t),u.webview.addHandler("table.change.event",(({data:e})=>{const t=this.handler.get(e.event);t&&("order-update"===e.event||"order-add"===e.event?t(e.order):"clear"===e.event||"add"===e.event||"delete"===e.event||"update"===e.event?t(e.table):"swap"!==e.event&&"move"!==e.event&&"merge"!==e.event||t(e.from,e.to))}))}}i([(0,p.PosRateLimiter)(),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],m.prototype,"getTables",null),i([(0,p.PosRateLimiter)(),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype","function"==typeof(a="undefined"!=typeof Promise&&Promise)?a:Object)],m.prototype,"clearTable",null),t.table=new m},3061:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toast=void 0;const r=n(4899),a=n(8924);t.toast={open:function(e){r.webview.send({name:"toast.open",callbackId:(0,a.createCallbackId)(),data:{message:e}})}}},9722:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UiImpl=void 0;const a=n(9594),i=n(4899),o=n(8924),s=n(6788);t.UiImpl=class{openBarcode(e){return r(this,void 0,void 0,(function*(){a.AllPopupElementsSchema.parse(e);const t=yield i.webview.send({name:"popup.request",callbackId:(0,o.createCallbackId)(),data:Object.assign({type:"barcode"},e)});if(!1===t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);if("barcode"!==t.data.type)throw new s.PosPluginSdkError("바코드 리딩에 실패했어요");return t.data.data}))}openInputModal(e){return r(this,void 0,void 0,(function*(){a.AllPopupElementsSchema.parse(e);const t=yield i.webview.send({name:"popup.request",callbackId:(0,o.createCallbackId)(),data:Object.assign({type:"input"},e)});if(!1===t.data.complete)throw new s.PosPluginSdkError(t.data.errorMessage);if("input"!==t.data.type)throw new s.PosPluginSdkError("입력에 실패했어요");return t.data.data}))}}},5179:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ui=void 0;const r=n(9722);t.ui=new r.UiImpl},9397:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}d((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.websocket=t.Websocket=void 0;const a=n(4899),i=n(8924),o=new Map;class s{constructor(e,t,n){this.url=e,this.headers=t,this.options=n,this.onMessageCallback=void 0,this.onErrorCallback=void 0,this.onCloseCallback=void 0,this.onOpenCallback=void 0}connect(){return r(this,void 0,void 0,(function*(){const e=yield a.webview.send({name:"websocket.connect.request",callbackId:(0,i.createCallbackId)(),data:Object.assign({url:this.url,headers:this.headers},this.options)});if(!e.data.complete)throw new Error(e.data.errorMessage)}))}disconnect(){return r(this,void 0,void 0,(function*(){yield a.webview.send({name:"websocket.disconnect.request",callbackId:(0,i.createCallbackId)(),data:{url:this.url}})}))}send(e){a.webview.send({name:"websocket.send",data:{url:this.url,data:e.data,option:e.option}})}onMessage(e){this.onMessageCallback=e}onError(e){this.onErrorCallback=e}onClose(e){this.onCloseCallback=e}onOpen(e){this.onOpenCallback=e}}t.Websocket=s,t.websocket={create:function(e,t,n){return r(this,void 0,void 0,(function*(){0===o.size&&a.webview.addHandler("websocket.event",(e=>{const t=o.get(e.data.url);t&&("open"===e.data.event&&t.onOpenCallback&&t.onOpenCallback(),"close"===e.data.event&&t.onCloseCallback&&t.onCloseCallback(e.data.code),"message"===e.data.event&&t.onMessageCallback&&t.onMessageCallback(e.data.data),"error"===e.data.event&&t.onErrorCallback&&t.onErrorCallback(e.data.errorName,e.data.errorMessage))}));const r=new s(e,t,n);return yield r.connect(),o.set(e,r),r}))}}},7498:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const r=n(1721);t.ZodIssueCode=r.util.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"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];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))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=a,a.create=e=>new a(e)},8652:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const a=r(n(548));t.defaultErrorMap=a.default;let i=a.default;t.setErrorMap=function(e){i=e},t.getErrorMap=function(){return i}},5772:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(8652),t),a(n(9082),t),a(n(5209),t),a(n(1721),t),a(n(1554),t),a(n(7498),t)},4439:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(n||(t.errorUtil=n={}))},9082:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const a=n(8652),i=r(n(548));t.makeIssue=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(void 0!==a.message)return{...a,path:i,message:a.message};let s="";const d=r.filter((e=>!!e)).slice().reverse();for(const e of d)s=e(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,n){const r=(0,a.getErrorMap)(),o=(0,t.makeIssue)({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===i.default?void 0:i.default].filter((e=>!!e))});e.common.issues.push(o)};class o{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if("aborted"===a.status)return t.INVALID;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return o.mergeObjectSync(e,n)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:n,value:i}=a;if("aborted"===n.status)return t.INVALID;if("aborted"===i.status)return t.INVALID;"dirty"===n.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===n.value||void 0===i.value&&!a.alwaysSet||(r[n.value]=i.value)}return{status:e.value,value:r}}}t.ParseStatus=o,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},5209:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1721:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(t.util=n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(t.objectUtil=r={})),t.ZodParsedType=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},8211:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const s=i(n(5772));t.z=s,o(n(5772),t),t.default=s},548:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(1721),a=n(7498);t.default=(e,t)=>{let n;switch(e.code){case a.ZodIssueCode.invalid_type:n=e.received===r.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.util.jsonStringifyReplacer)}`;break;case a.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.util.joinValues(e.keys,", ")}`;break;case a.ZodIssueCode.invalid_union:n="Invalid input";break;case a.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.util.joinValues(e.options)}`;break;case a.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${r.util.joinValues(e.options)}, received '${e.received}'`;break;case a.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case a.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case a.ZodIssueCode.invalid_date:n="Invalid date";break;case a.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.ZodIssueCode.custom:n="Invalid input";break;case a.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case a.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case a.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.util.assertNever(e)}return{message:n}}},1554:function(e,t,n){var r,a,i=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},o=this&&this.__classPrivateFieldSet||function(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const s=n(8652),d=n(4439),u=n(9082),c=n(1721),l=n(7498);class p{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,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 m=(e,t)=>{if((0,u.isValid)(t))return{success:!0,data:t.value};if(!e.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 l.ZodError(e.common.issues);return this._error=t,this._error}}};function f(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var i,o;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:a.defaultError}:void 0===a.data?{message:null!==(i=null!=s?s:r)&&void 0!==i?i:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(o=null!=s?s:n)&&void 0!==o?o:a.defaultError}},description:a}}class h{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,u.isAsync)(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parseSync({data:e,path:r.path,parent:r});return m(r,a)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:r});return(0,u.isValid)(t)?{value:t.value}:{issues:r.common.issues}}catch(e){(null===(n=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then((e=>(0,u.isValid)(e)?{value:e.value}:{issues:r.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await((0,u.isAsync)(r)?r:Promise.resolve(r));return m(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),i=()=>r.addIssue({code:l.ZodIssueCode.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(i(),!1))):!!a||(i(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new he({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ge.create(this,this._def)}nullable(){return ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return G.create(this)}promise(){return fe.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return re.create(this,e,this._def)}transform(e){return new he({...f(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Pe({...f(this._def),innerType:this,defaultValue:t,typeName:ke.ZodDefault})}brand(){return new _e({typeName:ke.ZodBranded,type:this,...f(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ve({...f(this._def),innerType:this,catchValue:t,typeName:ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ie.create(this,e)}readonly(){return Oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=h,t.Schema=h,t.ZodSchema=h;const g=/^c[^\s-]{8,}$/i,y=/^[0-9a-z]+$/,P=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v=/^[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,b=/^[a-z0-9_-]{21}$/i,_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I=/^[-+]?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)?)??$/,O=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let w;const C=/^(?:(?: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])$/,k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,T=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,z="((\\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])))",Z=new RegExp(`^${z}$`);function M(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function E(e){let t=`${z}T${M(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function D(e,t){if(!_.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!("object"!=typeof a||null===a||!a.typ||!a.alg||t&&a.alg!==t)}catch(e){return!1}}function R(e,t){return!("v4"!==t&&t||!k.test(e))||!("v6"!==t&&t||!S.test(e))}t.datetimeRegex=E;class A extends h{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:t.parsedType}),u.INVALID}const t=new u.ParseStatus;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)O.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"email",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)w||(w=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),w.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"emoji",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)v.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"uuid",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)b.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"nanoid",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)g.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cuid",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)y.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cuid2",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)P.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"ulid",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"url",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"regex",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?E(i).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?Z.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${M(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?I.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"duration",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(r=e.data,("v4"!==(a=i.version)&&a||!C.test(r))&&("v6"!==a&&a||!j.test(r))&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"ip",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?D(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"jwt",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?R(e.data,i.version)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"cidr",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?T.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"base64",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?x.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{validation:"base64url",code:l.ZodIssueCode.invalid_string,message:i.message}),t.dirty()):c.util.assertNever(i);var r,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:l.ZodIssueCode.invalid_string,...d.errorUtil.errToObj(n)})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...d.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...d.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...d.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...d.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...d.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...d.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...d.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...d.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...d.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...d.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...d.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...d.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...d.errorUtil.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...d.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...d.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...d.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...d.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...d.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...d.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...d.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...d.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...d.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...d.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,d.errorUtil.errToObj(e))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function N(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}t.ZodString=A,A.create=e=>{var t;return new A({checks:[],typeName:ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class L extends h{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)!==c.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:t.parsedType}),u.INVALID}let t;const n=new u.ParseStatus;for(const r of this._def.checks)"int"===r.kind?c.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==N(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_finite,message:r.message}),n.dirty()):c.util.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,n,r){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:d.errorUtil.toString(r)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:d.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:d.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=L,L.create=e=>new L({checks:[],typeName:ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class F extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let t;const n=new u.ParseStatus;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):c.util.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),u.INVALID}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,n,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:d.errorUtil.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:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}t.ZodBigInt=F,F.create=e=>{var t;return new F({checks:[],typeName:ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class U extends h{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==c.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodBoolean=U,U.create=e=>new U({typeName:ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class V extends h{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:t.parsedType}),u.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_date}),u.INVALID}const t=new u.ParseStatus;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):c.util.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:d.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:d.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}t.ZodDate=V,V.create=e=>new V({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ke.ZodDate,...f(e)});class q extends h{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodSymbol=q,q.create=e=>new q({typeName:ke.ZodSymbol,...f(e)});class H extends h{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodUndefined=H,H.create=e=>new H({typeName:ke.ZodUndefined,...f(e)});class $ extends h{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodNull=$,$.create=e=>new $({typeName:ke.ZodNull,...f(e)});class B extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodAny=B,B.create=e=>new B({typeName:ke.ZodAny,...f(e)});class K extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodUnknown=K,K.create=e=>new K({typeName:ke.ZodUnknown,...f(e)});class W extends h{_parse(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),u.INVALID}}t.ZodNever=W,W.create=e=>new W({typeName:ke.ZodNever,...f(e)});class Y extends h{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodVoid=Y,Y.create=e=>new Y({typeName:ke.ZodVoid,...f(e)});class G extends h{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),u.INVALID;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&((0,u.addIssueToContext)(t,{code:e?l.ZodIssueCode.too_big:l.ZodIssueCode.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new p(t,e,t.path,n))))).then((e=>u.ParseStatus.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new p(t,e,t.path,n))));return u.ParseStatus.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new G({...this._def,minLength:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new G({...this._def,maxLength:{value:e,message:d.errorUtil.toString(t)}})}length(e,t){return new G({...this._def,exactLength:{value:e,message:d.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function Q(e){if(e instanceof J){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ge.create(Q(r))}return new J({...e._def,shape:()=>t})}return e instanceof G?new G({...e._def,type:Q(e.element)}):e instanceof ge?ge.create(Q(e.unwrap())):e instanceof ye?ye.create(Q(e.unwrap())):e instanceof ae?ae.create(e.items.map((e=>Q(e)))):e}t.ZodArray=G,G.create=(e,t)=>new G({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...f(t)});class J extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof W&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||i.push(e);const o=[];for(const e of a){const t=r[e],a=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new p(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof W){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new p(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>u.ParseStatus.mergeObjectSync(t,e))):u.ParseStatus.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return d.errorUtil.errToObj,new J({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,i,o;const s=null!==(i=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=d.errorUtil.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(e){return new J({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new J({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new J({...this._def,catchall:e})}pick(e){const t={};return c.util.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new J({...this._def,shape:()=>t})}omit(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new J({...this._def,shape:()=>t})}deepPartial(){return Q(this)}partial(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new J({...this._def,shape:()=>t})}required(e){const t={};return c.util.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ge;)e=e._def.innerType;t[n]=e}})),new J({...this._def,shape:()=>t})}keyof(){return le(c.util.objectKeys(this.shape))}}t.ZodObject=J,J.create=(e,t)=>new J({shape:()=>e,unknownKeys:"strip",catchall:W.create(),typeName:ke.ZodObject,...f(t)}),J.strictCreate=(e,t)=>new J({shape:()=>e,unknownKeys:"strict",catchall:W.create(),typeName:ke.ZodObject,...f(t)}),J.lazycreate=(e,t)=>new J({shape:e,unknownKeys:"strip",catchall:W.create(),typeName:ke.ZodObject,...f(t)});class X extends h{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new l.ZodError(e.ctx.common.issues)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:n}),u.INVALID}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new l.ZodError(e)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:a}),u.INVALID}}get options(){return this._def.options}}t.ZodUnion=X,X.create=(e,t)=>new X({options:e,typeName:ke.ZodUnion,...f(t)});const ee=e=>e instanceof ue?ee(e.schema):e instanceof he?ee(e.innerType()):e instanceof ce?[e.value]:e instanceof pe?e.options:e instanceof me?c.util.objectValues(e.enum):e instanceof Pe?ee(e._def.innerType):e instanceof H?[void 0]:e instanceof $?[null]:e instanceof ge?[void 0,...ee(e.unwrap())]:e instanceof ye?[null,...ee(e.unwrap())]:e instanceof _e||e instanceof Oe?ee(e.unwrap()):e instanceof ve?ee(e._def.innerType):[];class te extends h{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),u.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=ee(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new te({typeName:ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...f(n)})}}function ne(e,t){const n=(0,c.getParsedType)(e),r=(0,c.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===c.ZodParsedType.object&&r===c.ZodParsedType.object){const n=c.util.objectKeys(t),r=c.util.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=ne(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===c.ZodParsedType.array&&r===c.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=ne(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===c.ZodParsedType.date&&r===c.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}t.ZodDiscriminatedUnion=te;class re extends h{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if((0,u.isAborted)(e)||(0,u.isAborted)(r))return u.INVALID;const a=ne(e.value,r.value);return a.valid?(((0,u.isDirty)(e)||(0,u.isDirty)(r))&&t.dirty(),{status:t.value,value:a.data}):((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_intersection_types}),u.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}t.ZodIntersection=re,re.create=(e,t,n)=>new re({left:e,right:t,typeName:ke.ZodIntersection,...f(n)});class ae extends h{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:n.parsedType}),u.INVALID;if(n.data.length<this._def.items.length)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new p(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>u.ParseStatus.mergeArray(t,e))):u.ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ae({...this._def,rest:e})}}t.ZodTuple=ae,ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:ke.ZodTuple,rest:null,...f(t)})};class ie extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:n.parsedType}),u.INVALID;const r=[],a=this._def.keyType,i=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new p(n,e,n.path,e)),value:i._parse(new p(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?u.ParseStatus.mergeObjectAsync(t,r):u.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new ie(t instanceof h?{keyType:e,valueType:t,typeName:ke.ZodRecord,...f(n)}:{keyType:A.create(),valueType:e,typeName:ke.ZodRecord,...f(t)})}}t.ZodRecord=ie;class oe extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.map)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:n.parsedType}),u.INVALID;const r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map((([e,t],i)=>({key:r._parse(new p(n,e,n.path,[i,"key"])),value:a._parse(new p(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return u.INVALID;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return u.INVALID;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}t.ZodMap=oe,oe.create=(e,t,n)=>new oe({valueType:t,keyType:e,typeName:ke.ZodMap,...f(n)});class se extends h{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==c.ZodParsedType.set)return(0,u.addIssueToContext)(n,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:n.parsedType}),u.INVALID;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&((0,u.addIssueToContext)(n,{code:l.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return u.INVALID;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map(((e,t)=>a._parse(new p(n,e,n.path,t))));return n.common.async?Promise.all(o).then((e=>i(e))):i(o)}min(e,t){return new se({...this._def,minSize:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:d.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=se,se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:ke.ZodSet,...f(t)});class de extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),u.INVALID;function n(e,n){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_arguments,argumentsError:n}})}function r(e,n){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fe){const e=this;return(0,u.OK)((async function(...t){const o=new l.ZodError([]),s=await e._def.args.parseAsync(t,a).catch((e=>{throw o.addIssue(n(t,e)),o})),d=await Reflect.apply(i,this,s);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw o.addIssue(r(d,e)),o}))}))}{const e=this;return(0,u.OK)((function(...t){const o=e._def.args.safeParse(t,a);if(!o.success)throw new l.ZodError([n(t,o.error)]);const s=Reflect.apply(i,this,o.data),d=e._def.returns.safeParse(s,a);if(!d.success)throw new l.ZodError([r(s,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new de({...this._def,args:ae.create(e).rest(K.create())})}returns(e){return new de({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new de({args:e||ae.create([]).rest(K.create()),returns:t||K.create(),typeName:ke.ZodFunction,...f(n)})}}t.ZodFunction=de;class ue extends h{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})}}t.ZodLazy=ue,ue.create=(e,t)=>new ue({getter:e,typeName:ke.ZodLazy,...f(t)});class ce extends h{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_literal,expected:this._def.value}),u.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function le(e,t){return new pe({values:e,typeName:ke.ZodEnum,...f(t)})}t.ZodLiteral=ce,ce.create=(e,t)=>new ce({value:e,typeName:ke.ZodLiteral,...f(t)});class pe extends h{constructor(){super(...arguments),r.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,u.addIssueToContext)(t,{expected:c.util.joinValues(n),received:t.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(i(this,r,"f")||o(this,r,new Set(this._def.values),"f"),!i(this,r,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_enum_value,options:n}),u.INVALID}return(0,u.OK)(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 pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=pe,r=new WeakMap,pe.create=le;class me extends h{constructor(){super(...arguments),a.set(this,void 0)}_parse(e){const t=c.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==c.ZodParsedType.string&&n.parsedType!==c.ZodParsedType.number){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(n,{expected:c.util.joinValues(e),received:n.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(i(this,a,"f")||o(this,a,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!i(this,a,"f").has(e.data)){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(n,{received:n.data,code:l.ZodIssueCode.invalid_enum_value,options:e}),u.INVALID}return(0,u.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=me,a=new WeakMap,me.create=(e,t)=>new me({values:e,typeName:ke.ZodNativeEnum,...f(t)});class fe extends h{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&!1===t.common.async)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),u.INVALID;const n=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=fe,fe.create=(e,t)=>new fe({type:e,typeName:ke.ZodPromise,...f(t)});class he extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{(0,u.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return u.INVALID;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:"dirty"===r.status||"dirty"===t.value?(0,u.DIRTY)(r.value):r}));{if("aborted"===t.value)return u.INVALID;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:"dirty"===r.status||"dirty"===t.value?(0,u.DIRTY)(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?u.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?u.INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,u.isValid)(e))return e;const i=r.transform(e.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>(0,u.isValid)(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}c.util.assertNever(r)}}t.ZodEffects=he,t.ZodTransformer=he,he.create=(e,t,n)=>new he({schema:e,typeName:ke.ZodEffects,effect:t,...f(n)}),he.createWithPreprocess=(e,t,n)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:ke.ZodEffects,...f(n)});class ge extends h{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ge,ge.create=(e,t)=>new ge({innerType:e,typeName:ke.ZodOptional,...f(t)});class ye extends h{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:ke.ZodNullable,...f(t)});class Pe extends h{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===c.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=Pe,Pe.create=(e,t)=>new Pe({innerType:e,typeName:ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...f(t)});class ve extends h{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,u.isAsync)(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l.ZodError(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new l.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=ve,ve.create=(e,t)=>new ve({innerType:e,typeName:ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...f(t)});class be extends h{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:t.parsedType}),u.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=be,be.create=e=>new be({typeName:ke.ZodNaN,...f(e)}),t.BRAND=Symbol("zod_brand");class _e extends h{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=_e;class Ie extends h{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),(0,u.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Ie({in:e,out:t,typeName:ke.ZodPipeline})}}t.ZodPipeline=Ie;class Oe extends h{_parse(e){const t=this._def.innerType._parse(e),n=e=>((0,u.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.isAsync)(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function we(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Ce(e,t={},n){return e?B.create().superRefine(((r,a)=>{var i,o;const s=e(r);if(s instanceof Promise)return s.then((e=>{var i,o;if(!e){const e=we(t,r),s=null===(o=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===o||o;a.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=we(t,r),s=null===(o=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===o||o;a.addIssue({code:"custom",...e,fatal:s})}})):B.create()}var ke;t.ZodReadonly=Oe,Oe.create=(e,t)=>new Oe({innerType:e,typeName:ke.ZodReadonly,...f(t)}),t.custom=Ce,t.late={object:J.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ke||(t.ZodFirstPartyTypeKind=ke={})),t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Ce((t=>t instanceof e),t);const je=A.create;t.string=je;const Se=L.create;t.number=Se;const Te=be.create;t.nan=Te;const xe=F.create;t.bigint=xe;const ze=U.create;t.boolean=ze;const Ze=V.create;t.date=Ze;const Me=q.create;t.symbol=Me;const Ee=H.create;t.undefined=Ee;const De=$.create;t.null=De;const Re=B.create;t.any=Re;const Ae=K.create;t.unknown=Ae;const Ne=W.create;t.never=Ne;const Le=Y.create;t.void=Le;const Fe=G.create;t.array=Fe;const Ue=J.create;t.object=Ue;const Ve=J.strictCreate;t.strictObject=Ve;const qe=X.create;t.union=qe;const He=te.create;t.discriminatedUnion=He;const $e=re.create;t.intersection=$e;const Be=ae.create;t.tuple=Be;const Ke=ie.create;t.record=Ke;const We=oe.create;t.map=We;const Ye=se.create;t.set=Ye;const Ge=de.create;t.function=Ge;const Qe=ue.create;t.lazy=Qe;const Je=ce.create;t.literal=Je;const Xe=pe.create;t.enum=Xe;const et=me.create;t.nativeEnum=et;const tt=fe.create;t.promise=tt;const nt=he.create;t.effect=nt,t.transformer=nt;const rt=ge.create;t.optional=rt;const at=ye.create;t.nullable=at;const it=he.createWithPreprocess;t.preprocess=it;const ot=Ie.create;t.pipeline=ot,t.ostring=()=>je().optional(),t.onumber=()=>Se().optional(),t.oboolean=()=>ze().optional(),t.coerce={string:e=>A.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>U.create({...e,coerce:!0}),bigint:e=>F.create({...e,coerce:!0}),date:e=>V.create({...e,coerce:!0})},t.NEVER=u.INVALID},4899:(e,t,n)=>{n.r(t),n.d(t,{WebView:()=>d,webview:()=>u});var r=n(9594);const a=new class{constructor(e=[]){this.messages=e,this.map=new Map}set(e,t){this.map.set(e,t),this.flush(e,t)}flush(e,t){this.messages.forEach((n=>{n.name===e&&t(n)})),this.messages=this.messages.filter((t=>t.name!==e))}execute(e){const t=this.map.get(e.name);t?t(e):this.messages.push(e)}},i=new class{constructor(){this.map=new Map}has(e){return(0,r.hasCallbackId)(e)&&this.map.has(e.callbackId)}set(e,t){(0,r.hasCallbackId)(e)&&this.map.set(e.callbackId,t)}get(e){if((0,r.hasCallbackId)(e))return this.map.get(e.callbackId)}del(e){(0,r.hasCallbackId)(e)&&this.map.delete(e.callbackId)}};function o(){if("undefined"==typeof window)return!1;try{return window.self!==window.top}catch(e){return!0}}function s(e){o()?window.parent.postMessage(e,"*"):self.postMessage(e)}class d{constructor(){this.profile="undefined"!=typeof PROFILE?PROFILE:"unknown",this.version=void 0,this.name=void 0,this.messageQueue=[],this.sessionId=(new Date).getTime(),this.applyOnMessage(),this.applyOnError()}send(e){if("dev"!==this.profile&&"local"!==this.profile||(console.log("======= worker >> webview ======="),console.log(e)),this.logEventMessage(e,this.name,this.version),(0,r.hasCallbackId)(e))return new Promise((t=>{i.set(e,(e=>{t(e),i.del(e)})),s(e)}));s(e)}addHandler(e,t){a.set(e,t)}applyOnMessage(){const e=({data:e})=>{if(null!=e&&null!==e.name&&void 0!==e.name)if("dev"!==this.profile&&"local"!==this.profile||(console.log("======= webview >> worker ======="),console.log(e)),this.logEventMessage(e,this.name,this.version),i.has(e)){const t=i.get(e);if(!t)throw new Error(`${e.name}의 callback id를 찾지 못 했어요. 이미 실행되었을 가능성이 있습니다`);t(e)}else a.execute(e)};o()?window.addEventListener("message",(t=>{e(t)})):self.onmessage=t=>{e(t)}}applyOnError(){const e=(e,t,n,r,a)=>{this.logEventMessage({error:a,event:e,source:t,lineno:n,colno:r})};o()?window.addEventListener("error",e):self.onerror=e}setPluginMetadata({name:e,version:t}){this.name=e,this.version=t,this.messageQueue.forEach((n=>{this.logEventMessage(n,e,t)})),this.messageQueue=[]}logEventMessage(e,t,n){n||t?s({name:"log",data:{type:"debug",log:{title:"eventMessage",timestamp:Date.now(),contents:e,level:"LOG",phase:this.profile,sessionId:this.sessionId,extension_version:n,extension_name:t,plugin_version:n,plugin_name:t}}}):this.messageQueue.push(e)}}const u=new d}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e=r;Object.defineProperty(e,"BJ",{value:!0}),e.l3=e._P=e.C$=e.bN=e.pP=e.vx=e.V1=e.CO=e.Lp=e.Y7=e.Bb=e.BY=e.AY=e.hh=e.sx=e.tj=e.uS=e.R$=e.QT=e.fG=e.Iw=e.jb=e.U3=e.Wc=e.Jf=e.hU=e.Cf=e.Wj=e.hR=e.ym=e.Vj=e.On=e.QE=e.jt=e.R=e.p2=e.eq=e.pH=e.BB=e.vV=e.Vx=e.jr=e.YY=e.fN=e.A5=e.G6=e.pF=e.eP=e.WC=e.RH=void 0,e.xQ=e.Ui=e.lm=e.XI=e.dx=e.AH=e.Gt=e.si=e.k_=e.IQ=e.OT=e.w2=e.LS=e.IV=e.xI=e.A=e.XG=e.bT=e.V0=e.TH=e.nm=e.vh=e.K5=e.BE=e.kj=e.L=e.TL=void 0;var t=n(7147);Object.defineProperty(e,"RH",{enumerable:!0,get:function(){return t.CashReceiptTypes}});var a=n(8987);Object.defineProperty(e,"WC",{enumerable:!0,get:function(){return a.Catalog}});var i=n(7687);Object.defineProperty(e,"eP",{enumerable:!0,get:function(){return i.CategoryTypes}});var o=n(403);Object.defineProperty(e,"pF",{enumerable:!0,get:function(){return o.Device}});var s=n(2901);Object.defineProperty(e,"G6",{enumerable:!0,get:function(){return s.DraftOrder}});var d=n(6788);Object.defineProperty(e,"A5",{enumerable:!0,get:function(){return d.PosPluginSdkError}});var u=n(5349);Object.defineProperty(e,"fN",{enumerable:!0,get:function(){return u.FFITypes}});var c=n(4347);Object.defineProperty(e,"YY",{enumerable:!0,get:function(){return c.HttpTypes}});var l=n(8613);Object.defineProperty(e,"jr",{enumerable:!0,get:function(){return l.Merchant}});var p=n(4859);Object.defineProperty(e,"Vx",{enumerable:!0,get:function(){return p.Navigation}}),Object.defineProperty(e,"vV",{enumerable:!0,get:function(){return p.NavigationImpl}});var m=n(2765);Object.defineProperty(e,"BB",{enumerable:!0,get:function(){return m.MenuOption}});var f=n(3555);Object.defineProperty(e,"pH",{enumerable:!0,get:function(){return f.Order}});var h=n(2799);Object.defineProperty(e,"eq",{enumerable:!0,get:function(){return h.PaymentMethodType}});var g=n(4467);Object.defineProperty(e,"p2",{enumerable:!0,get:function(){return g.Payment}});var y=n(2896);Object.defineProperty(e,"R",{enumerable:!0,get:function(){return y.pluginMessenger}});var P=n(7074);Object.defineProperty(e,"jt",{enumerable:!0,get:function(){return P.PluginMessenger}});var v=n(1503);Object.defineProperty(e,"QE",{enumerable:!0,get:function(){return v.CashReceipt}}),Object.defineProperty(e,"On",{enumerable:!0,get:function(){return v.CatalogItemOptionChoiceState}}),Object.defineProperty(e,"Vj",{enumerable:!0,get:function(){return v.DeviceInfo}}),Object.defineProperty(e,"ym",{enumerable:!0,get:function(){return v.HttpMethod}}),Object.defineProperty(e,"hR",{enumerable:!0,get:function(){return v.PaymentMethodResponse}}),Object.defineProperty(e,"Wj",{enumerable:!0,get:function(){return v.PluginCancelledPaymentDto}}),Object.defineProperty(e,"Cf",{enumerable:!0,get:function(){return v.PluginCardPayment}}),Object.defineProperty(e,"hU",{enumerable:!0,get:function(){return v.PluginCashPayment}}),Object.defineProperty(e,"Jf",{enumerable:!0,get:function(){return v.PluginCashReceipt}}),Object.defineProperty(e,"Wc",{enumerable:!0,get:function(){return v.PluginCashReceiptIssuanceType}}),Object.defineProperty(e,"U3",{enumerable:!0,get:function(){return v.PluginCashReceiptIssuerType}}),Object.defineProperty(e,"jb",{enumerable:!0,get:function(){return v.PluginCatalogCategory}}),Object.defineProperty(e,"Iw",{enumerable:!0,get:function(){return v.PluginCatalogItem}}),Object.defineProperty(e,"fG",{enumerable:!0,get:function(){return v.PluginCatalogItemDto}}),Object.defineProperty(e,"QT",{enumerable:!0,get:function(){return v.PluginCatalogItemLabel}}),Object.defineProperty(e,"R$",{enumerable:!0,get:function(){return v.PluginCatalogItemOption}}),Object.defineProperty(e,"uS",{enumerable:!0,get:function(){return v.PluginCatalogItemOptionChoice}}),Object.defineProperty(e,"tj",{enumerable:!0,get:function(){return v.PluginCatalogItemPrice}}),Object.defineProperty(e,"sx",{enumerable:!0,get:function(){return v.PluginCatalogItemPriceDto}}),Object.defineProperty(e,"hh",{enumerable:!0,get:function(){return v.PluginCatalogItemPriceType}}),Object.defineProperty(e,"AY",{enumerable:!0,get:function(){return v.PluginDelivery}}),Object.defineProperty(e,"BY",{enumerable:!0,get:function(){return v.PluginDiscount}}),Object.defineProperty(e,"Bb",{enumerable:!0,get:function(){return v.PluginDraftOrder}}),Object.defineProperty(e,"Y7",{enumerable:!0,get:function(){return v.PluginDraftOrderItem}}),Object.defineProperty(e,"Lp",{enumerable:!0,get:function(){return v.PluginExternalPayment}}),Object.defineProperty(e,"CO",{enumerable:!0,get:function(){return v.PluginHall}}),Object.defineProperty(e,"V1",{enumerable:!0,get:function(){return v.PluginHttpRequest}}),Object.defineProperty(e,"vx",{enumerable:!0,get:function(){return v.PluginHttpResponse}}),Object.defineProperty(e,"pP",{enumerable:!0,get:function(){return v.PluginInputs}}),Object.defineProperty(e,"bN",{enumerable:!0,get:function(){return v.PluginLanguagePack}}),Object.defineProperty(e,"C$",{enumerable:!0,get:function(){return v.PluginOrder}}),Object.defineProperty(e,"_P",{enumerable:!0,get:function(){return v.PluginOrderDiningOption}}),Object.defineProperty(e,"l3",{enumerable:!0,get:function(){return v.PluginOrderDto}}),Object.defineProperty(e,"TL",{enumerable:!0,get:function(){return v.PluginOrderItem}}),Object.defineProperty(e,"L",{enumerable:!0,get:function(){return v.PluginOrderState}}),Object.defineProperty(e,"kj",{enumerable:!0,get:function(){return v.PluginPayment}}),Object.defineProperty(e,"BE",{enumerable:!0,get:function(){return v.PluginPaymentBase}}),Object.defineProperty(e,"K5",{enumerable:!0,get:function(){return v.PluginPaymentCardType}}),Object.defineProperty(e,"vh",{enumerable:!0,get:function(){return v.PluginPaymentDto}}),Object.defineProperty(e,"nm",{enumerable:!0,get:function(){return v.PluginPaymentInstallment}}),Object.defineProperty(e,"TH",{enumerable:!0,get:function(){return v.PluginPaymentOf}}),Object.defineProperty(e,"V0",{enumerable:!0,get:function(){return v.PluginPaymentSourceType}}),Object.defineProperty(e,"bT",{enumerable:!0,get:function(){return v.PluginPaymentState}}),Object.defineProperty(e,"XG",{enumerable:!0,get:function(){return v.PluginPrice}}),Object.defineProperty(e,"A",{enumerable:!0,get:function(){return v.PluginTable}}),Object.defineProperty(e,"xI",{enumerable:!0,get:function(){return v.PluginTableGroup}}),Object.defineProperty(e,"IV",{enumerable:!0,get:function(){return v.PopupActionResponse}}),Object.defineProperty(e,"LS",{enumerable:!0,get:function(){return v.PopupElement}}),Object.defineProperty(e,"w2",{enumerable:!0,get:function(){return v.TossMerchant}}),Object.defineProperty(e,"OT",{enumerable:!0,get:function(){return v.VanType}});var b=n(4689);Object.defineProperty(e,"IQ",{enumerable:!0,get:function(){return b.plugin}});var _=n(3863);Object.defineProperty(e,"k_",{enumerable:!0,get:function(){return _.Plugin}});var I=n(6192);Object.defineProperty(e,"si",{enumerable:!0,get:function(){return I.PosPluginSdk}}),Object.defineProperty(e,"Gt",{enumerable:!0,get:function(){return I.posPluginSdk}});var O=n(7730);Object.defineProperty(e,"AH",{enumerable:!0,get:function(){return O.SettingTypes}});var w=n(853);Object.defineProperty(e,"dx",{enumerable:!0,get:function(){return w.StorageTypes}});var C=n(4513);Object.defineProperty(e,"XI",{enumerable:!0,get:function(){return C.Table}});var k=n(3061);Object.defineProperty(e,"lm",{enumerable:!0,get:function(){return k.ToastTypes}});var j=n(9722);Object.defineProperty(e,"Ui",{enumerable:!0,get:function(){return j.Ui}});var S=n(9397);Object.defineProperty(e,"xQ",{enumerable:!0,get:function(){return S.WebsocketTypes}})})();var a=r.QE,i=r.RH,o=r.WC,s=r.On,d=r.eP,u=r.pF,c=r.Vj,l=r.G6,p=r.fN,m=r.ym,f=r.YY,h=r.BB,g=r.jr,y=r.Vx,P=r.vV,v=r.pH,b=r.p2,_=r.hR,I=r.eq,O=r.k_,w=r.Wj,C=r.Cf,k=r.hU,j=r.Jf,S=r.Wc,T=r.U3,x=r.jb,z=r.Iw,Z=r.fG,M=r.QT,E=r.R$,D=r.uS,R=r.tj,A=r.sx,N=r.hh,L=r.AY,F=r.BY,U=r.Bb,V=r.Y7,q=r.Lp,H=r.CO,$=r.V1,B=r.vx,K=r.pP,W=r.bN,Y=r.jt,G=r.C$,Q=r._P,J=r.l3,X=r.TL,ee=r.L,te=r.kj,ne=r.BE,re=r.K5,ae=r.vh,ie=r.nm,oe=r.TH,se=r.V0,de=r.bT,ue=r.XG,ce=r.A,le=r.xI,pe=r.IV,me=r.LS,fe=r.si,he=r.A5,ge=r.AH,ye=r.dx,Pe=r.XI,ve=r.lm,be=r.w2,_e=r.Ui,Ie=r.OT,Oe=r.xQ,we=r.BJ,Ce=r.IQ,ke=r.R,je=r.Gt;export{a as CashReceipt,i as CashReceiptTypes,o as Catalog,s as CatalogItemOptionChoiceState,d as CategoryTypes,u as Device,c as DeviceInfo,l as DraftOrder,p as FFITypes,m as HttpMethod,f as HttpTypes,h as MenuOption,g as Merchant,y as Navigation,P as NavigationImpl,v as Order,b as Payment,_ as PaymentMethodResponse,I as PaymentMethodType,O as Plugin,w as PluginCancelledPaymentDto,C as PluginCardPayment,k as PluginCashPayment,j as PluginCashReceipt,S as PluginCashReceiptIssuanceType,T as PluginCashReceiptIssuerType,x as PluginCatalogCategory,z as PluginCatalogItem,Z as PluginCatalogItemDto,M as PluginCatalogItemLabel,E as PluginCatalogItemOption,D as PluginCatalogItemOptionChoice,R as PluginCatalogItemPrice,A as PluginCatalogItemPriceDto,N as PluginCatalogItemPriceType,L as PluginDelivery,F as PluginDiscount,U as PluginDraftOrder,V as PluginDraftOrderItem,q as PluginExternalPayment,H as PluginHall,$ as PluginHttpRequest,B as PluginHttpResponse,K as PluginInputs,W as PluginLanguagePack,Y as PluginMessenger,G as PluginOrder,Q as PluginOrderDiningOption,J as PluginOrderDto,X as PluginOrderItem,ee as PluginOrderState,te as PluginPayment,ne as PluginPaymentBase,re as PluginPaymentCardType,ae as PluginPaymentDto,ie as PluginPaymentInstallment,oe as PluginPaymentOf,se as PluginPaymentSourceType,de as PluginPaymentState,ue as PluginPrice,ce as PluginTable,le as PluginTableGroup,pe as PopupActionResponse,me as PopupElement,fe as PosPluginSdk,he as PosPluginSdkError,ge as SettingTypes,ye as StorageTypes,Pe as Table,ve as ToastTypes,be as TossMerchant,_e as Ui,Ie as VanType,Oe as WebsocketTypes,we as __esModule,Ce as plugin,ke as pluginMessenger,je as posPluginSdk};