@learncard/claimable-boosts-plugin 1.0.36 → 1.0.38

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.
@@ -3440,4 +3440,4 @@ var _generateBoostClaimLink = /* @__PURE__ */ __name(async (_learnCard, boostURI
3440
3440
  throw new Error("Failed to generate boost claim link: " + error.message);
3441
3441
  }
3442
3442
  }, "_generateBoostClaimLink");
3443
- //# sourceMappingURL=claimable-boosts-plugin.cjs.development.js.map
3443
+ //# sourceMappingURL=claimable-boosts-plugin.cjs.development.cjs.map
@@ -1,2 +1,2 @@
1
1
  "use strict";var le=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Le=Object.prototype.hasOwnProperty;var c=(s,e)=>le(s,"name",{value:e,configurable:!0});var Pe=(s,e)=>{for(var t in e)le(s,t,{get:e[t],enumerable:!0})},Ve=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Me(e))!Le.call(s,n)&&n!==t&&le(s,n,{get:()=>e[n],enumerable:!(r=Re(e,n))||r.enumerable});return s};var $e=s=>Ve(le({},"__esModule",{value:!0}),s);var Mt={};Pe(Mt,{SigningAuthorityValidator:()=>jt,getClaimableBoostsPlugin:()=>It});module.exports=$e(Mt);var x;(function(s){s.assertEqual=n=>n;function e(n){}c(e,"assertIs"),s.assertIs=e;function t(n){throw new Error}c(t,"assertNever"),s.assertNever=t,s.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},s.getValidEnumValues=n=>{let a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(let i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}c(r,"joinValues"),s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var l=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),B=c(s=>{switch(typeof s){case"undefined":return l.undefined;case"string":return l.string;case"number":return isNaN(s)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(s)?l.array:s===null?l.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?l.promise:typeof Map<"u"&&s instanceof Map?l.map:typeof Set<"u"&&s instanceof Set?l.set:typeof Date<"u"&&s instanceof Date?l.date:l.object;default:return l.unknown}},"getParsedType"),u=x.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"]),De=c(s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),O=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(a){return a.message},r={_errors:[]},n=c(a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,d=0;for(;d<i.path.length;){let p=i.path[d];d===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(i))):o[p]=o[p]||{_errors:[]},o=o[p],d++}}},"processError");return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};c(O,"ZodError");O.create=s=>new O(s);var de=c((s,e)=>{let t;switch(s.code){case u.invalid_type:s.received===l.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case u.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,x.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(s.keys,", ")}`;break;case u.invalid_union:t="Invalid input";break;case u.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(s.options)}`;break;case u.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(s.options)}, received '${s.received}'`;break;case u.invalid_arguments:t="Invalid function arguments";break;case u.invalid_return_type:t="Invalid function return type";break;case u.invalid_date:t="Invalid date";break;case u.invalid_string:typeof s.validation=="object"?"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:x.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case u.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(s.minimum)}`:t="Invalid input";break;case u.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(s.maximum)}`:t="Invalid input";break;case u.custom:t="Invalid input";break;case u.invalid_intersection_types:t="Intersection results could not be merged";break;case u.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case u.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(s)}return{message:t}},"errorMap"),Ce=de;function Be(s){Ce=s}c(Be,"setErrorMap");function he(){return Ce}c(he,"getErrorMap");var fe=c(s=>{let{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a},o="",d=r.filter(p=>!!p).slice().reverse();for(let p of d)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:n.message||o}},"makeIssue"),Ze=[];function h(s,e){let t=fe({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,he(),de].filter(r=>!!r)});s.common.issues.push(t)}c(h,"addIssueToContext");var w=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t)r.push({key:await n.key,value:await n.value});return w.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}};c(w,"ParseStatus");var m=Object.freeze({status:"aborted"}),Ee=c(s=>({status:"dirty",value:s}),"DIRTY"),k=c(s=>({status:"valid",value:s}),"OK"),_e=c(s=>s.status==="aborted","isAborted"),xe=c(s=>s.status==="dirty","isDirty"),me=c(s=>s.status==="valid","isValid"),ye=c(s=>typeof Promise!==void 0&&s instanceof Promise,"isAsync"),_;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(_||(_={}));var C=class{constructor(e,t,r,n){this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._path.concat(this._key)}};c(C,"ParseInputLazyPath");var ke=c((s,e)=>{if(me(e))return{success:!0,data:e.value};{if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new O(s.common.issues);return{success:!1,error:t}}},"handleResult");function v(s){if(!s)return{};let{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:c((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:r??o.defaultError}:{message:t??o.defaultError},"customMap"),description:n}}c(v,"processCreateParams");var y=class{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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return B(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ye(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},a=this._parseSync({data:e,path:n.path,parent:n});return ke(n,a)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(ye(n)?n:Promise.resolve(n));return ke(r,a)}refine(e,t){let r=c(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,a)=>{let i=e(n),o=c(()=>a.addIssue({code:u.custom,...r(n)}),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new S({schema:this,typeName:f.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return N.create(this)}nullable(){return P.create(this)}nullish(){return this.optional().nullable()}array(){return T.create(this)}promise(){return D.create(this)}or(e){return q.create([this,e])}and(e){return J.create(this,e)}transform(e){return new S({schema:this,typeName:f.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new X({innerType:this,defaultValue:t,typeName:f.ZodDefault})}brand(){return new ue({typeName:f.ZodBranded,type:this,...v(void 0)})}catch(e){let t=typeof e=="function"?e:()=>e;return new ne({innerType:this,defaultValue:t,typeName:f.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return F.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};c(y,"ZodType");var ze=/^c[^\s-]{8,}$/i,Ue=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,We=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,qe=c(s=>s.precision?s.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${s.precision}}(([+-]\\d{2}:\\d{2})|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${s.precision}}Z$`):s.precision===0?s.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):s.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),A=class extends y{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(n=>e.test(n),{validation:t,code:u.invalid_string,..._.errToObj(r)}),this.nonempty=e=>this.min(1,_.errToObj(e)),this.trim=()=>new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){let a=this._getOrReturnCtx(e);return h(a,{code:u.invalid_type,expected:l.string,received:a.parsedType}),m}let r=new w,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?h(n,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&h(n,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")We.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"email",code:u.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Ue.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"uuid",code:u.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")ze.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid",code:u.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),h(n,{validation:"url",code:u.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"regex",code:u.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?qe(a).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:u.invalid_string,validation:"datetime",message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,..._.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};c(A,"ZodString");A.create=s=>{var e;return new A({checks:[],typeName:f.ZodString,coerce:(e=s?.coerce)!==null&&e!==void 0?e:!1,...v(s)})};function Je(s,e){let t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=parseInt(s.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}c(Je,"floatSafeRemainder");var I=class extends y{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)!==l.number){let a=this._getOrReturnCtx(e);return h(a,{code:u.invalid_type,expected:l.number,received:a.parsedType}),m}let r,n=new w;for(let a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Je(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),h(r,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:u.not_finite,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,r,n){return new I({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:_.toString(n)}]})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};c(I,"ZodNumber");I.create=s=>new I({checks:[],typeName:f.ZodNumber,coerce:s?.coerce||!1,...v(s)});var Z=class extends y{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==l.bigint){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.bigint,received:r.parsedType}),m}return k(e.data)}};c(Z,"ZodBigInt");Z.create=s=>{var e;return new Z({typeName:f.ZodBigInt,coerce:(e=s?.coerce)!==null&&e!==void 0?e:!1,...v(s)})};var z=class extends y{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==l.boolean){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.boolean,received:r.parsedType}),m}return k(e.data)}};c(z,"ZodBoolean");z.create=s=>new z({typeName:f.ZodBoolean,coerce:s?.coerce||!1,...v(s)});var R=class extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){let a=this._getOrReturnCtx(e);return h(a,{code:u.invalid_type,expected:l.date,received:a.parsedType}),m}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return h(a,{code:u.invalid_date}),m}let r=new w,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):x.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};c(R,"ZodDate");R.create=s=>new R({checks:[],coerce:s?.coerce||!1,typeName:f.ZodDate,...v(s)});var ee=class extends y{_parse(e){if(this._getType(e)!==l.symbol){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.symbol,received:r.parsedType}),m}return k(e.data)}};c(ee,"ZodSymbol");ee.create=s=>new ee({typeName:f.ZodSymbol,...v(s)});var U=class extends y{_parse(e){if(this._getType(e)!==l.undefined){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.undefined,received:r.parsedType}),m}return k(e.data)}};c(U,"ZodUndefined");U.create=s=>new U({typeName:f.ZodUndefined,...v(s)});var W=class extends y{_parse(e){if(this._getType(e)!==l.null){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.null,received:r.parsedType}),m}return k(e.data)}};c(W,"ZodNull");W.create=s=>new W({typeName:f.ZodNull,...v(s)});var V=class extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}};c(V,"ZodAny");V.create=s=>new V({typeName:f.ZodAny,...v(s)});var M=class extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}};c(M,"ZodUnknown");M.create=s=>new M({typeName:f.ZodUnknown,...v(s)});var j=class extends y{_parse(e){let t=this._getOrReturnCtx(e);return h(t,{code:u.invalid_type,expected:l.never,received:t.parsedType}),m}};c(j,"ZodNever");j.create=s=>new j({typeName:f.ZodNever,...v(s)});var te=class extends y{_parse(e){if(this._getType(e)!==l.undefined){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.void,received:r.parsedType}),m}return k(e.data)}};c(te,"ZodVoid");te.create=s=>new te({typeName:f.ZodVoid,...v(s)});var T=class extends y{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==l.array)return h(t,{code:u.invalid_type,expected:l.array,received:t.parsedType}),m;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(h(t,{code:i?u.too_big:u.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(h(t,{code:u.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(h(t,{code:u.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all(t.data.map((i,o)=>n.type._parseAsync(new C(t,i,t.path,o)))).then(i=>w.mergeArray(r,i));let a=t.data.map((i,o)=>n.type._parseSync(new C(t,i,t.path,o)));return w.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new T({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new T({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new T({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}};c(T,"ZodArray");T.create=(s,e)=>new T({type:s,minLength:null,maxLength:null,exactLength:null,typeName:f.ZodArray,...v(e)});var ge;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(ge||(ge={}));var Te=c(s=>e=>new b({...s,shape:()=>({...s.shape(),...e})}),"AugmentFactory");function ce(s){if(s instanceof b){let e={};for(let t in s.shape){let r=s.shape[t];e[t]=N.create(ce(r))}return new b({...s._def,shape:()=>e})}else return s instanceof T?T.create(ce(s.element)):s instanceof N?N.create(ce(s.unwrap())):s instanceof P?P.create(ce(s.unwrap())):s instanceof E?E.create(s.items.map(e=>ce(e))):s}c(ce,"deepPartialify");var b=class extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=Te(this._def),this.extend=Te(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==l.object){let p=this._getOrReturnCtx(e);return h(p,{code:u.invalid_type,expected:l.object,received:p.parsedType}),m}let{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof j&&this._def.unknownKeys==="strip"))for(let p in n.data)i.includes(p)||o.push(p);let d=[];for(let p of i){let g=a[p],oe=n.data[p];d.push({key:{status:"valid",value:p},value:g._parse(new C(n,oe,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof j){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of o)d.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(p==="strict")o.length>0&&(h(n,{code:u.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let g of o){let oe=n.data[g];d.push({key:{status:"valid",value:g},value:p._parse(new C(n,oe,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of d){let oe=await g.key;p.push({key:oe,value:await g.value,alwaysSet:g.alwaysSet})}return p}).then(p=>w.mergeObjectSync(r,p)):w.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,a,i,o;let d=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,r).message)!==null&&i!==void 0?i:r.defaultError;return t.code==="unrecognized_keys"?{message:(o=_.errToObj(e).message)!==null&&o!==void 0?o:d}:{message:d}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}setKey(e,t){return this.augment({[e]:t})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>ge.mergeShapes(this._def.shape(),e._def.shape()),typeName:f.ZodObject})}catchall(e){return new b({...this._def,catchall:e})}pick(e){let t={};return x.objectKeys(e).map(r=>{this.shape[r]&&(t[r]=this.shape[r])}),new b({...this._def,shape:()=>t})}omit(e){let t={};return x.objectKeys(this.shape).map(r=>{x.objectKeys(e).indexOf(r)===-1&&(t[r]=this.shape[r])}),new b({...this._def,shape:()=>t})}deepPartial(){return ce(this)}partial(e){let t={};if(e)return x.objectKeys(this.shape).map(r=>{x.objectKeys(e).indexOf(r)===-1?t[r]=this.shape[r]:t[r]=this.shape[r].optional()}),new b({...this._def,shape:()=>t});for(let r in this.shape){let n=this.shape[r];t[r]=n.optional()}return new b({...this._def,shape:()=>t})}required(e){let t={};if(e)x.objectKeys(this.shape).map(r=>{if(x.objectKeys(e).indexOf(r)===-1)t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof N;)a=a._def.innerType;t[r]=a}});else for(let r in this.shape){let a=this.shape[r];for(;a instanceof N;)a=a._def.innerType;t[r]=a}return new b({...this._def,shape:()=>t})}keyof(){return Ne(x.objectKeys(this.shape))}};c(b,"ZodObject");b.create=(s,e)=>new b({shape:()=>s,unknownKeys:"strip",catchall:j.create(),typeName:f.ZodObject,...v(e)});b.strictCreate=(s,e)=>new b({shape:()=>s,unknownKeys:"strict",catchall:j.create(),typeName:f.ZodObject,...v(e)});b.lazycreate=(s,e)=>new b({shape:s,unknownKeys:"strip",catchall:j.create(),typeName:f.ZodObject,...v(e)});var q=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new O(o.ctx.common.issues));return h(t,{code:u.invalid_union,unionErrors:i}),m}if(c(n,"handleResults"),t.common.async)return Promise.all(r.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let d of r){let p={...t,common:{...t.common,issues:[]},parent:null},g=d._parseSync({data:t.data,path:t.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(d=>new O(d));return h(t,{code:u.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}};c(q,"ZodUnion");q.create=(s,e)=>new q({options:s,typeName:f.ZodUnion,...v(e)});var pe=c(s=>s instanceof H?pe(s.schema):s instanceof S?pe(s.innerType()):s instanceof G?[s.value]:s instanceof K?s.options:s instanceof Q?Object.keys(s.enum):s instanceof X?pe(s._def.innerType):s instanceof U?[void 0]:s instanceof W?[null]:null,"getDiscriminator"),se=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.object)return h(t,{code:u.invalid_type,expected:l.object,received:t.parsedType}),m;let r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);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}):(h(t,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let a of t){let i=pe(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new se({typeName:f.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...v(r)})}};c(se,"ZodDiscriminatedUnion");function be(s,e){let t=B(s),r=B(e);if(s===e)return{valid:!0,data:s};if(t===l.object&&r===l.object){let n=x.objectKeys(e),a=x.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(let o of a){let d=be(s[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(t===l.array&&r===l.array){if(s.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<s.length;a++){let i=s[a],o=e[a],d=be(i,o);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return t===l.date&&r===l.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}c(be,"mergeValues");var J=class extends y{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=c((a,i)=>{if(_e(a)||_e(i))return m;let o=be(a.value,i.value);return o.valid?((xe(a)||xe(i))&&t.dirty(),{status:t.value,value:o.data}):(h(r,{code:u.invalid_intersection_types}),m)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};c(J,"ZodIntersection");J.create=(s,e,t)=>new J({left:s,right:e,typeName:f.ZodIntersection,...v(t)});var E=class extends y{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.array)return h(r,{code:u.invalid_type,expected:l.array,received:r.parsedType}),m;if(r.data.length<this._def.items.length)return h(r,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&r.data.length>this._def.items.length&&(h(r,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=r.data.map((i,o)=>{let d=this._def.items[o]||this._def.rest;return d?d._parse(new C(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>w.mergeArray(t,i)):w.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new E({...this._def,rest:e})}};c(E,"ZodTuple");E.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:s,typeName:f.ZodTuple,rest:null,...v(e)})};var Y=class extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.object)return h(r,{code:u.invalid_type,expected:l.object,received:r.parsedType}),m;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in r.data)n.push({key:a._parse(new C(r,o,r.path,o)),value:i._parse(new C(r,r.data[o],r.path,o))});return r.common.async?w.mergeObjectAsync(t,n):w.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new Y({keyType:e,valueType:t,typeName:f.ZodRecord,...v(r)}):new Y({keyType:A.create(),valueType:e,typeName:f.ZodRecord,...v(t)})}};c(Y,"ZodRecord");var re=class extends y{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.map)return h(r,{code:u.invalid_type,expected:l.map,received:r.parsedType}),m;let n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,d],p)=>({key:n._parse(new C(r,o,r.path,[p,"key"])),value:a._parse(new C(r,d,r.path,[p,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let d of i){let p=await d.key,g=await d.value;if(p.status==="aborted"||g.status==="aborted")return m;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let d of i){let p=d.key,g=d.value;if(p.status==="aborted"||g.status==="aborted")return m;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}}}};c(re,"ZodMap");re.create=(s,e,t)=>new re({valueType:e,keyType:s,typeName:f.ZodMap,...v(t)});var L=class extends y{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.set)return h(r,{code:u.invalid_type,expected:l.set,received:r.parsedType}),m;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(h(r,{code:u.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(h(r,{code:u.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function i(d){let p=new Set;for(let g of d){if(g.status==="aborted")return m;g.status==="dirty"&&t.dirty(),p.add(g.value)}return{status:t.value,value:p}}c(i,"finalizeSet");let o=[...r.data.values()].map((d,p)=>a._parse(new C(r,d,r.path,p)));return r.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,t){return new L({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new L({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};c(L,"ZodSet");L.create=(s,e)=>new L({valueType:s,minSize:null,maxSize:null,typeName:f.ZodSet,...v(e)});var $=class extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.function)return h(t,{code:u.invalid_type,expected:l.function,received:t.parsedType}),m;function r(o,d){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),de].filter(p=>!!p),issueData:{code:u.invalid_arguments,argumentsError:d}})}c(r,"makeArgsIssue");function n(o,d){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),de].filter(p=>!!p),issueData:{code:u.invalid_return_type,returnTypeError:d}})}c(n,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},i=t.data;return this._def.returns instanceof D?k(async(...o)=>{let d=new O([]),p=await this._def.args.parseAsync(o,a).catch(ve=>{throw d.addIssue(r(o,ve)),d}),g=await i(...p);return await this._def.returns._def.type.parseAsync(g,a).catch(ve=>{throw d.addIssue(n(g,ve)),d})}):k((...o)=>{let d=this._def.args.safeParse(o,a);if(!d.success)throw new O([r(o,d.error)]);let p=i(...d.data),g=this._def.returns.safeParse(p,a);if(!g.success)throw new O([n(p,g.error)]);return g.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $({...this._def,args:E.create(e).rest(M.create())})}returns(e){return new $({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new $({args:e||E.create([]).rest(M.create()),returns:t||M.create(),typeName:f.ZodFunction,...v(r)})}};c($,"ZodFunction");var H=class extends y{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};c(H,"ZodLazy");H.create=(s,e)=>new H({getter:s,typeName:f.ZodLazy,...v(e)});var G=class extends y{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return h(t,{code:u.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}};c(G,"ZodLiteral");G.create=(s,e)=>new G({value:s,typeName:f.ZodLiteral,...v(e)});function Ne(s,e){return new K({values:s,typeName:f.ZodEnum,...v(e)})}c(Ne,"createZodEnum");var K=class extends y{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{expected:x.joinValues(r),received:t.parsedType,code:u.invalid_type}),m}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{received:t.data,code:u.invalid_enum_value,options:r}),m}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}};c(K,"ZodEnum");K.create=Ne;var Q=class extends y{_parse(e){let t=x.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==l.string&&r.parsedType!==l.number){let n=x.objectValues(t);return h(r,{expected:x.joinValues(n),received:r.parsedType,code:u.invalid_type}),m}if(t.indexOf(e.data)===-1){let n=x.objectValues(t);return h(r,{received:r.data,code:u.invalid_enum_value,options:n}),m}return k(e.data)}get enum(){return this._def.values}};c(Q,"ZodNativeEnum");Q.create=(s,e)=>new Q({values:s,typeName:f.ZodNativeEnum,...v(e)});var D=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.promise&&t.common.async===!1)return h(t,{code:u.invalid_type,expected:l.promise,received:t.parsedType}),m;let r=t.parsedType===l.promise?t.data:Promise.resolve(t.data);return k(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};c(D,"ZodPromise");D.create=(s,e)=>new D({type:s,typeName:f.ZodPromise,...v(e)});var S=class extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===f.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null;if(n.type==="preprocess"){let i=n.transform(r.data);return r.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:r.path,parent:r})):this._def.schema._parseSync({data:i,path:r.path,parent:r})}let a={addIssue:i=>{h(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="refinement"){let i=c(o=>{let d=n.refinement(o,a);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!me(i))return i;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>me(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(n)}};c(S,"ZodEffects");S.create=(s,e,t)=>new S({schema:s,typeName:f.ZodEffects,effect:e,...v(t)});S.createWithPreprocess=(s,e,t)=>new S({schema:e,effect:{type:"preprocess",transform:s},typeName:f.ZodEffects,...v(t)});var N=class extends y{_parse(e){return this._getType(e)===l.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(N,"ZodOptional");N.create=(s,e)=>new N({innerType:s,typeName:f.ZodOptional,...v(e)});var P=class extends y{_parse(e){return this._getType(e)===l.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(P,"ZodNullable");P.create=(s,e)=>new P({innerType:s,typeName:f.ZodNullable,...v(e)});var X=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===l.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};c(X,"ZodDefault");X.create=(s,e)=>new X({innerType:s,typeName:f.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});var ne=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.innerType._parse({data:t.data,path:t.path,parent:t});return ye(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()})):{status:"valid",value:r.status==="valid"?r.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};c(ne,"ZodCatch");ne.create=(s,e)=>new ne({innerType:s,typeName:f.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});var ae=class extends y{_parse(e){if(this._getType(e)!==l.nan){let r=this._getOrReturnCtx(e);return h(r,{code:u.invalid_type,expected:l.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}};c(ae,"ZodNaN");ae.create=s=>new ae({typeName:f.ZodNaN,...v(s)});var Ye=Symbol("zod_brand"),ue=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};c(ue,"ZodBranded");var F=class extends y{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return c(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),Ee(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})},"handleAsync")();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new F({in:e,out:t,typeName:f.ZodPipeline})}};c(F,"ZodPipeline");var Oe=c((s,e={},t)=>s?V.create().superRefine((r,n)=>{if(!s(r)){let a=typeof e=="function"?e(r):e,i=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...i,fatal:t})}}):V.create(),"custom"),He={object:b.lazycreate},f;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline"})(f||(f={}));var Ge=c((s,e={message:`Input not instance of ${s.name}`})=>Oe(t=>t instanceof s,e,!0),"instanceOfType"),Ae=A.create,je=I.create,Ke=ae.create,Qe=Z.create,Ie=z.create,Xe=R.create,Fe=ee.create,et=U.create,tt=W.create,st=V.create,rt=M.create,nt=j.create,at=te.create,it=T.create,ot=b.create,ct=b.strictCreate,ut=q.create,dt=se.create,lt=J.create,pt=E.create,ht=Y.create,ft=re.create,mt=L.create,yt=$.create,gt=H.create,vt=G.create,_t=K.create,xt=Q.create,bt=D.create,Se=S.create,wt=N.create,kt=P.create,Tt=S.createWithPreprocess,St=F.create,Ct=c(()=>Ae().optional(),"ostring"),Et=c(()=>je().optional(),"onumber"),Nt=c(()=>Ie().optional(),"oboolean"),Ot={string:s=>A.create({...s,coerce:!0}),number:s=>I.create({...s,coerce:!0}),boolean:s=>z.create({...s,coerce:!0}),bigint:s=>Z.create({...s,coerce:!0}),date:s=>R.create({...s,coerce:!0})},At=m,ie=Object.freeze({__proto__:null,defaultErrorMap:de,setErrorMap:Be,getErrorMap:he,makeIssue:fe,EMPTY_PATH:Ze,addIssueToContext:h,ParseStatus:w,INVALID:m,DIRTY:Ee,OK:k,isAborted:_e,isDirty:xe,isValid:me,isAsync:ye,get util(){return x},ZodParsedType:l,getParsedType:B,ZodType:y,ZodString:A,ZodNumber:I,ZodBigInt:Z,ZodBoolean:z,ZodDate:R,ZodSymbol:ee,ZodUndefined:U,ZodNull:W,ZodAny:V,ZodUnknown:M,ZodNever:j,ZodVoid:te,ZodArray:T,get objectUtil(){return ge},ZodObject:b,ZodUnion:q,ZodDiscriminatedUnion:se,ZodIntersection:J,ZodTuple:E,ZodRecord:Y,ZodMap:re,ZodSet:L,ZodFunction:$,ZodLazy:H,ZodLiteral:G,ZodEnum:K,ZodNativeEnum:Q,ZodPromise:D,ZodEffects:S,ZodTransformer:S,ZodOptional:N,ZodNullable:P,ZodDefault:X,ZodCatch:ne,ZodNaN:ae,BRAND:Ye,ZodBranded:ue,ZodPipeline:F,custom:Oe,Schema:y,ZodSchema:y,late:He,get ZodFirstPartyTypeKind(){return f},coerce:Ot,any:st,array:it,bigint:Qe,boolean:Ie,date:Xe,discriminatedUnion:dt,effect:Se,enum:_t,function:yt,instanceof:Ge,intersection:lt,lazy:gt,literal:vt,map:ft,nan:Ke,nativeEnum:xt,never:nt,null:tt,nullable:kt,number:je,object:ot,oboolean:Nt,onumber:Et,optional:wt,ostring:Ct,pipeline:St,preprocess:Tt,promise:bt,record:ht,set:mt,strictObject:ct,string:Ae,symbol:Fe,transformer:Se,tuple:pt,undefined:et,union:ut,unknown:rt,void:at,NEVER:At,ZodIssueCode:u,quotelessJson:De,ZodError:O});var jt=ie.object({_id:ie.string().optional(),ownerDid:ie.string(),name:ie.string(),did:ie.string().optional(),endpoint:ie.string().optional()});var we="lca-sa",It=c(s=>({name:"ClaimableBoosts",displayName:"Claimable Boosts",description:"Simple claimable boost creation plugin that handles signing authority management.",methods:{generateBoostClaimLink:async(e,t,r)=>(e.debug?.("Generating boost claim link...",t,r),Rt(e,t,r))}}),"getClaimableBoostsPlugin"),Rt=c(async(s,e,t)=>{try{let r=await s.invoke.getRegisteredSigningAuthorities();if(s.debug?.("Registered Signing Authorities",r),r?.length>0){let d=r[0];s.debug?.("Using Existing Signing Authority",d);let p=await s.invoke.generateClaimLink(e,{name:d?.relationship?.name||"",endpoint:d?.signingAuthority?.endpoint||""},t);if(!p)throw new Error("Failed to generate claim link");return`https://learncard.app/claim/boost?claim=true&boostUri=${p.boostUri}&challenge=${p.challenge}`}let n=await s.invoke.getSigningAuthorities();s.debug?.("Existing Signing Authorities",n);let a;if(n&&Array.isArray(n)&&(a=n.find(d=>d.name===we)),!a){let d=await s.invoke.createSigningAuthority(we);if(s.debug?.("Creating New Signing Authority",d),!d)throw new Error("Failed to create signing authority");a={ownerDid:d.ownerDid,name:we,endpoint:d.endpoint,did:d.did}}let i=await s.invoke.registerSigningAuthority(a?.endpoint||"",a?.name||"",a?.did||"");if(s.debug?.("Registering Signing Authority with Network",a),!i)throw new Error("Failed to register signing authority");let o=await s.invoke.generateClaimLink(e,{name:a?.name||"",endpoint:a?.endpoint||""},t);if(s.debug?.("Generating Claim Link",o),!o)throw new Error("Failed to generate claim link");return`https://learncard.app/claim/boost?claim=true&boostUri=${o.boostUri}&challenge=${o.challenge}`}catch(r){throw s.debug?.("Error generateBoostClaimLink:",r),new Error("Failed to generate boost claim link: "+r.message)}},"_generateBoostClaimLink");
2
- //# sourceMappingURL=claimable-boosts-plugin.cjs.production.min.js.map
2
+ //# sourceMappingURL=claimable-boosts-plugin.cjs.production.min.cjs.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./claimable-boosts-plugin.cjs.production.min.js');
4
+ module.exports = require('./claimable-boosts-plugin.cjs.production.min.cjs');
5
5
  } else {
6
- module.exports = require('./claimable-boosts-plugin.cjs.development.js');
6
+ module.exports = require('./claimable-boosts-plugin.cjs.development.cjs');
7
7
  }
package/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "@learncard/claimable-boosts-plugin",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "",
5
- "main": "./dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
6
7
  "module": "./dist/claimable-boosts-plugin.esm.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/claimable-boosts-plugin.esm.js",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
7
14
  "files": [
8
15
  "dist"
9
16
  ],
@@ -30,11 +37,11 @@
30
37
  },
31
38
  "types": "./dist/index.d.ts",
32
39
  "dependencies": {
33
- "@learncard/core": "9.3.26",
34
- "@learncard/types": "5.6.13"
40
+ "@learncard/core": "9.3.28",
41
+ "@learncard/types": "5.6.14"
35
42
  },
36
43
  "scripts": {
37
- "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
44
+ "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.cjs && tsc --p tsconfig.json",
38
45
  "test": "jest --passWithNoTests",
39
46
  "test:watch": "jest --watch",
40
47
  "test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""