"use strict";(()=>{var zs=Object.create;var Qr=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var qs=Object.getOwnPropertyNames;var Gs=Object.getPrototypeOf,Ks=Object.prototype.hasOwnProperty;var Q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Js=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qs(e))!Ks.call(t,s)&&s!==r&&Qr(t,s,{get:()=>e[s],enumerable:!(n=Zs(e,s))||n.enumerable});return t};var ee=(t,e,r)=>(r=t!=null?zs(Gs(t)):{},Js(e||!t||!t.__esModule?Qr(r,"default",{value:t,enumerable:!0}):r,t));var Xr=Q(tr=>{"use strict";tr.parse=ei;tr.serialize=ti;var Qs=decodeURIComponent,Xs=encodeURIComponent,Mt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function ei(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var r={},n=e||{},s=t.split(";"),i=n.decode||Qs,o=0;o{"use strict";var nt={decodeValues:!0,map:!1,silent:!1};function rr(t){return typeof t=="string"&&!!t.trim()}function nr(t,e){var r=t.split(";").filter(rr),n=r.shift(),s=ni(n),i=s.name,o=s.value;e=e?Object.assign({},nt,e):nt;try{o=e.decodeValues?decodeURIComponent(o):o}catch(u){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+o+"'. Set options.decodeValues to false to disable this feature.",u)}var a={name:i,value:o};return r.forEach(function(u){var c=u.split("="),d=c.shift().trimLeft().toLowerCase(),h=c.join("=");d==="expires"?a.expires=new Date(h):d==="max-age"?a.maxAge=parseInt(h,10):d==="secure"?a.secure=!0:d==="httponly"?a.httpOnly=!0:d==="samesite"?a.sameSite=h:d==="partitioned"?a.partitioned=!0:a[d]=h}),a}function ni(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function en(t,e){if(e=e?Object.assign({},nt,e):nt,!t)return e.map?{}:[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(s){return s.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e=e?Object.assign({},nt,e):nt,e.map){var n={};return t.filter(rr).reduce(function(s,i){var o=nr(i,e);return s[o.name]=o,s},n)}else return t.filter(rr).map(function(s){return nr(s,e)})}function si(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,s,i,o,a;function u(){for(;r=t.length)&&e.push(t.substring(n,t.length))}return e}St.exports=en;St.exports.parse=en;St.exports.parseString=nr;St.exports.splitCookiesString=si});var nn=Q(ce=>{"use strict";var Ee=ce&&ce.__assign||function(){return Ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";var Et=me&&me.__assign||function(){return Et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{var st=1e3,it=st*60,at=it*60,je=at*24,ci=je*7,di=je*365.25;un.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return li(t);if(r==="number"&&isFinite(t))return e.long?pi(t):fi(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function li(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*di;case"weeks":case"week":case"w":return r*ci;case"days":case"day":case"d":return r*je;case"hours":case"hour":case"hrs":case"hr":case"h":return r*at;case"minutes":case"minute":case"mins":case"min":case"m":return r*it;case"seconds":case"second":case"secs":case"sec":case"s":return r*st;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fi(t){var e=Math.abs(t);return e>=je?Math.round(t/je)+"d":e>=at?Math.round(t/at)+"h":e>=it?Math.round(t/it)+"m":e>=st?Math.round(t/st)+"s":t+"ms"}function pi(t){var e=Math.abs(t);return e>=je?Ut(t,e,je,"day"):e>=at?Ut(t,e,at,"hour"):e>=it?Ut(t,e,it,"minute"):e>=st?Ut(t,e,st,"second"):t+" ms"}function Ut(t,e,r,n){var s=e>=r*1.5;return Math.round(t/r)+" "+n+(s?"s":"")}});var fn=Q($t=>{"use strict";$t.byteLength=mi;$t.toByteArray=yi;$t.fromByteArray=Si;var ve=[],le=[],hi=typeof Uint8Array<"u"?Uint8Array:Array,ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Be=0,dn=ir.length;Be0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function mi(t){var e=ln(t),r=e[0],n=e[1];return(r+n)*3/4-n}function gi(t,e,r){return(e+r)*3/4-r}function yi(t){var e,r=ln(t),n=r[0],s=r[1],i=new hi(gi(t,n,s)),o=0,a=s>0?n-4:n,u;for(u=0;u>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=le[t.charCodeAt(u)]<<2|le[t.charCodeAt(u+1)]>>4,i[o++]=e&255),s===1&&(e=le[t.charCodeAt(u)]<<10|le[t.charCodeAt(u+1)]<<4|le[t.charCodeAt(u+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function vi(t){return ve[t>>18&63]+ve[t>>12&63]+ve[t>>6&63]+ve[t&63]}function _i(t,e,r){for(var n,s=[],i=e;ia?a:o+i));return n===1?(e=t[r-1],s.push(ve[e>>2]+ve[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],s.push(ve[e>>10]+ve[e>>4&63]+ve[e<<2&63]+"=")),s.join("")}});var Rn=Q((gr,yr)=>{(function(t,e){typeof gr=="object"&&typeof yr<"u"?yr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(gr,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",s="second",i="minute",o="hour",a="day",u="week",c="month",d="quarter",h="year",b="date",l="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var y=["th","st","nd","rd"],S=O%100;return"["+O+(y[(S-20)%10]||y[S]||y[0])+"]"}},D=function(O,y,S){var M=String(O);return!M||M.length>=y?O:""+Array(y+1-M.length).join(S)+O},V={s:D,z:function(O){var y=-O.utcOffset(),S=Math.abs(y),M=Math.floor(S/60),E=S%60;return(y<=0?"+":"-")+D(M,2,"0")+":"+D(E,2,"0")},m:function O(y,S){if(y.date()1)return O(R[0])}else{var Y=y.name;T[Y]=y,E=Y}return!M&&E&&(x=E),E||!M&&x},_=function(O,y){if(p(O))return O.clone();var S=typeof y=="object"?y:{};return S.date=O,S.args=arguments,new U(S)},m=V;m.l=C,m.i=p,m.w=function(O,y){return _(O,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var U=function(){function O(S){this.$L=C(S.locale,null,!0),this.parse(S)}var y=O.prototype;return y.parse=function(S){this.$d=function(M){var E=M.date,N=M.utc;if(E===null)return new Date(NaN);if(m.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var R=E.match(v);if(R){var Y=R[2]-1||0,Z=(R[7]||"0").substring(0,3);return N?new Date(Date.UTC(R[1],Y,R[3]||1,R[4]||0,R[5]||0,R[6]||0,Z)):new Date(R[1],Y,R[3]||1,R[4]||0,R[5]||0,R[6]||0,Z)}}return new Date(E)}(S),this.$x=S.x||{},this.init()},y.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},y.$utils=function(){return m},y.isValid=function(){return this.$d.toString()!==l},y.isSame=function(S,M){var E=_(S);return this.startOf(M)<=E&&E<=this.endOf(M)},y.isAfter=function(S,M){return _(S){(function(t,e){typeof vr=="object"&&typeof _r<"u"?_r.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_duration=e()})(vr,function(){"use strict";var t,e,r=1e3,n=6e4,s=36e5,i=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,a=31536e6,u=2592e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d={years:a,months:u,days:i,hours:s,minutes:n,seconds:r,milliseconds:1,weeks:6048e5},h=function(x){return x instanceof V},b=function(x,T,p){return new V(x,p,T.$l)},l=function(x){return e.p(x)+"s"},v=function(x){return x<0},A=function(x){return v(x)?Math.ceil(x):Math.floor(x)},I=function(x){return Math.abs(x)},D=function(x,T){return x?v(x)?{negative:!0,format:""+I(x)+T}:{negative:!1,format:""+x+T}:{negative:!1,format:""}},V=function(){function x(p,C,_){var m=this;if(this.$d={},this.$l=_,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),C)return b(p*d[l(C)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach(function(O){m.$d[l(O)]=p[O]}),this.calMilliseconds(),this;if(typeof p=="string"){var U=p.match(c);if(U){var H=U.slice(2).map(function(O){return O!=null?Number(O):0});return this.$d.years=H[0],this.$d.months=H[1],this.$d.weeks=H[2],this.$d.days=H[3],this.$d.hours=H[4],this.$d.minutes=H[5],this.$d.seconds=H[6],this.calMilliseconds(),this}}return this}var T=x.prototype;return T.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(C,_){return C+(p.$d[_]||0)*d[_]},0)},T.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=A(p/a),p%=a,this.$d.months=A(p/u),p%=u,this.$d.days=A(p/i),p%=i,this.$d.hours=A(p/s),p%=s,this.$d.minutes=A(p/n),p%=n,this.$d.seconds=A(p/r),p%=r,this.$d.milliseconds=p},T.toISOString=function(){var p=D(this.$d.years,"Y"),C=D(this.$d.months,"M"),_=+this.$d.days||0;this.$d.weeks&&(_+=7*this.$d.weeks);var m=D(_,"D"),U=D(this.$d.hours,"H"),H=D(this.$d.minutes,"M"),O=this.$d.seconds||0;this.$d.milliseconds&&(O+=this.$d.milliseconds/1e3);var y=D(O,"S"),S=p.negative||C.negative||m.negative||U.negative||H.negative||y.negative,M=U.format||H.format||y.format?"T":"",E=(S?"-":"")+"P"+p.format+C.format+m.format+M+U.format+H.format+y.format;return E==="P"||E==="-P"?"P0D":E},T.toJSON=function(){return this.toISOString()},T.format=function(p){var C=p||"YYYY-MM-DDTHH:mm:ss",_={Y:this.$d.years,YY:e.s(this.$d.years,2,"0"),YYYY:e.s(this.$d.years,4,"0"),M:this.$d.months,MM:e.s(this.$d.months,2,"0"),D:this.$d.days,DD:e.s(this.$d.days,2,"0"),H:this.$d.hours,HH:e.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:e.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:e.s(this.$d.seconds,2,"0"),SSS:e.s(this.$d.milliseconds,3,"0")};return C.replace(o,function(m,U){return U||String(_[m])})},T.as=function(p){return this.$ms/d[l(p)]},T.get=function(p){var C=this.$ms,_=l(p);return _==="milliseconds"?C%=1e3:C=_==="weeks"?A(C/d[_]):this.$d[_],C===0?0:C},T.add=function(p,C,_){var m;return m=C?p*d[l(C)]:h(p)?p.$ms:b(p,this).$ms,b(this.$ms+m*(_?-1:1),this)},T.subtract=function(p,C){return this.add(p,C,!0)},T.locale=function(p){var C=this.clone();return C.$l=p,C},T.clone=function(){return b(this.$ms,this)},T.humanize=function(p){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},T.valueOf=function(){return this.asMilliseconds()},T.milliseconds=function(){return this.get("milliseconds")},T.asMilliseconds=function(){return this.as("milliseconds")},T.seconds=function(){return this.get("seconds")},T.asSeconds=function(){return this.as("seconds")},T.minutes=function(){return this.get("minutes")},T.asMinutes=function(){return this.as("minutes")},T.hours=function(){return this.get("hours")},T.asHours=function(){return this.as("hours")},T.days=function(){return this.get("days")},T.asDays=function(){return this.as("days")},T.weeks=function(){return this.get("weeks")},T.asWeeks=function(){return this.as("weeks")},T.months=function(){return this.get("months")},T.asMonths=function(){return this.as("months")},T.years=function(){return this.get("years")},T.asYears=function(){return this.as("years")},x}();return function(x,T,p){t=p,e=p().$utils(),p.duration=function(m,U){var H=p.locale();return b(m,{$l:H},U)},p.isDuration=h;var C=T.prototype.add,_=T.prototype.subtract;T.prototype.add=function(m,U){return h(m)&&(m=m.asMilliseconds()),C.bind(this)(m,U)},T.prototype.subtract=function(m,U){return h(m)&&(m=m.asMilliseconds()),_.bind(this)(m,U)}}})});var Mn=Q((Sr,Tr)=>{(function(t,e){typeof Sr=="object"&&typeof Tr<"u"?Tr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isoWeek=e()})(Sr,function(){"use strict";var t="day";return function(e,r,n){var s=function(a){return a.add(4-a.isoWeekday(),t)},i=r.prototype;i.isoWeekYear=function(){return s(this).year()},i.isoWeek=function(a){if(!this.$utils().u(a))return this.add(7*(a-this.isoWeek()),t);var u,c,d,h,b=s(this),l=(u=this.isoWeekYear(),c=this.$u,d=(c?n.utc:n)().year(u).startOf("year"),h=4-d.isoWeekday(),d.isoWeekday()>4&&(h+=7),d.add(h,t));return b.diff(l,"week")+1},i.isoWeekday=function(a){return this.$utils().u(a)?this.day()||7:this.day(this.day()%7?a:a-7)};var o=i.startOf;i.startOf=function(a,u){var c=this.$utils(),d=!!c.u(u)||u;return c.p(a)==="isoweek"?d?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(a,u)}}})});var Nn=Q((Er,br)=>{(function(t,e){typeof Er=="object"&&typeof br<"u"?br.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_objectSupport=e()})(Er,function(){"use strict";return function(t,e,r){var n=e.prototype,s=function(d){var h,b=d.date,l=d.utc,v={};if(!((h=b)instanceof Date||h instanceof Array||n.$utils().u(h)||h.constructor.name!=="Object")){if(!Object.keys(b).length)return new Date;var A=l?r.utc():r();Object.keys(b).forEach(function(_){var m,U;v[m=_,U=n.$utils().p(m),U==="date"?"day":U]=b[_]});var I=v.day||(v.year||v.month>=0?1:A.date()),D=v.year||A.year(),V=v.month>=0?v.month:v.year||v.day?0:A.month(),x=v.hour||0,T=v.minute||0,p=v.second||0,C=v.millisecond||0;return l?new Date(Date.UTC(D,V,I,x,T,p,C)):new Date(D,V,I,x,T,p,C)}return b},i=n.parse;n.parse=function(d){d.date=s.bind(this)(d),i.bind(this)(d)};var o=n.set,a=n.add,u=n.subtract,c=function(d,h,b,l){l===void 0&&(l=1);var v=Object.keys(h),A=this;return v.forEach(function(I){A=d.bind(A)(h[I]*l,I)}),A};n.set=function(d,h){return h=h===void 0?d:h,d.constructor.name==="Object"?c.bind(this)(function(b,l){return o.bind(this)(l,b)},h,d):o.bind(this)(d,h)},n.add=function(d,h){return d.constructor.name==="Object"?c.bind(this)(a,d,h):a.bind(this)(d,h)},n.subtract=function(d,h){return d.constructor.name==="Object"?c.bind(this)(a,d,h,-1):u.bind(this)(d,h)}}})});var Un=Q((wr,kr)=>{(function(t,e){typeof wr=="object"&&typeof kr<"u"?kr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_relativeTime=e()})(wr,function(){"use strict";return function(t,e,r){t=t||{};var n=e.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(a,u,c,d){return n.fromToBase(a,u,c,d)}r.en.relativeTime=s,n.fromToBase=function(a,u,c,d,h){for(var b,l,v,A=c.$locale().relativeTime||s,I=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],D=I.length,V=0;V0,T<=x.r||!x.r){T<=1&&V>0&&(x=I[V-1]);var p=A[x.l];h&&(T=h(""+T)),l=typeof p=="string"?p.replace("%d",T):p(T,u,x.l,v);break}}if(u)return l;var C=v?A.future:A.past;return typeof C=="function"?C(l):C.replace("%s",l)},n.to=function(a,u){return i(a,u,this,!0)},n.from=function(a,u){return i(a,u,this)};var o=function(a){return a.$u?r.utc():r()};n.toNow=function(a){return this.to(o(this),a)},n.fromNow=function(a){return this.from(o(this),a)}}})});var $n=Q((Ar,xr)=>{(function(t,e){typeof Ar=="object"&&typeof xr<"u"?xr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_timezone=e()})(Ar,function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(r,n,s){var i,o=function(d,h,b){b===void 0&&(b={});var l=new Date(d),v=function(A,I){I===void 0&&(I={});var D=I.timeZoneName||"short",V=A+"|"+D,x=e[V];return x||(x=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:A,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:D}),e[V]=x),x}(h,b);return v.formatToParts(l)},a=function(d,h){for(var b=o(d,h),l=[],v=0;v=0&&(l[V]=parseInt(D,10))}var x=l[3],T=x===24?0:x,p=l[0]+"-"+l[1]+"-"+l[2]+" "+T+":"+l[4]+":"+l[5]+":000",C=+d;return(s.utc(p).valueOf()-(C-=C%1e3))/6e4},u=n.prototype;u.tz=function(d,h){d===void 0&&(d=i);var b=this.utcOffset(),l=this.toDate(),v=l.toLocaleString("en-US",{timeZone:d}),A=Math.round((l-new Date(v))/1e3/60),I=s(v).$set("millisecond",this.$ms).utcOffset(15*-Math.round(l.getTimezoneOffset()/15)-A,!0);if(h){var D=I.utcOffset();I=I.add(b-D,"minute")}return I.$x.$timezone=d,I},u.offsetName=function(d){var h=this.$x.$timezone||s.tz.guess(),b=o(this.valueOf(),h,{timeZoneName:d}).find(function(l){return l.type.toLowerCase()==="timezonename"});return b&&b.value};var c=u.startOf;u.startOf=function(d,h){if(!this.$x||!this.$x.$timezone)return c.call(this,d,h);var b=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(b,d,h).tz(this.$x.$timezone,!0)},s.tz=function(d,h,b){var l=b&&h,v=b||h||i,A=a(+s(),v);if(typeof d!="string")return s(d).tz(v);var I=function(T,p,C){var _=T-60*p*1e3,m=a(_,C);if(p===m)return[_,p];var U=a(_-=60*(m-p)*1e3,C);return m===U?[_,m]:[T-60*Math.min(m,U)*1e3,Math.max(m,U)]}(s.utc(d,l).valueOf(),A,v),D=I[0],V=I[1],x=s(D).utcOffset(V);return x.$x.$timezone=v,x},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(d){i=d}}})});var Ln=Q((Or,Ir)=>{(function(t,e){typeof Or=="object"&&typeof Ir<"u"?Ir.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_utc=e()})(Or,function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,s,i){var o=s.prototype;i.utc=function(l){var v={date:l,utc:!0,args:arguments};return new s(v)},o.utc=function(l){var v=i(this.toDate(),{locale:this.$L,utc:!0});return l?v.add(this.utcOffset(),t):v},o.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),a.call(this,l)};var u=o.init;o.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else u.call(this)};var c=o.utcOffset;o.utcOffset=function(l,v){var A=this.$utils().u;if(A(l))return this.$u?0:A(this.$offset)?c.call(this):this.$offset;if(typeof l=="string"&&(l=function(x){x===void 0&&(x="");var T=x.match(e);if(!T)return null;var p=(""+T[0]).match(r)||["-",0,0],C=p[0],_=60*+p[1]+ +p[2];return _===0?0:C==="+"?_:-_}(l),l===null))return this;var I=Math.abs(l)<=16?60*l:l,D=this;if(v)return D.$offset=I,D.$u=l===0,D;if(l!==0){var V=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(D=this.local().add(I+V,t)).$offset=I,D.$x.$localOffset=V}else D=this.utc();return D};var d=o.format;o.format=function(l){var v=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,v)},o.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(l){return l==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var b=o.diff;o.diff=function(l,v,A){if(l&&this.$u===l.$u)return b.call(this,l,v,A);var I=this.local(),D=i(l).local();return b.call(I,D,v,A)}}})});var Fn=Q((Cr,Pr)=>{(function(t,e){typeof Cr=="object"&&typeof Pr<"u"?Pr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isToday=e()})(Cr,function(){"use strict";return function(t,e,r){e.prototype.isToday=function(){var n="YYYY-MM-DD",s=r();return this.format(n)===s.format(n)}}})});var jn=Q((Rr,Dr)=>{(function(t,e){typeof Rr=="object"&&typeof Dr<"u"?Dr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Rr,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,n=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,i={},o=function(l){return(l=+l)+(l>68?1900:2e3)},a=function(l){return function(v){this[l]=+v}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(l){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var A=v.match(/([+-]|\d\d)/g),I=60*A[1]+(+A[2]||0);return I===0?0:A[0]==="+"?-I:I}(l)}],c=function(l){var v=i[l];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(l,v){var A,I=i.meridiem;if(I){for(var D=1;D<=24;D+=1)if(l.indexOf(I(D,0,v))>-1){A=D>12;break}}else A=l===(v?"pm":"PM");return A},h={A:[s,function(l){this.afternoon=d(l,!1)}],a:[s,function(l){this.afternoon=d(l,!0)}],S:[/\d/,function(l){this.milliseconds=100*+l}],SS:[r,function(l){this.milliseconds=10*+l}],SSS:[/\d{3}/,function(l){this.milliseconds=+l}],s:[n,a("seconds")],ss:[n,a("seconds")],m:[n,a("minutes")],mm:[n,a("minutes")],H:[n,a("hours")],h:[n,a("hours")],HH:[n,a("hours")],hh:[n,a("hours")],D:[n,a("day")],DD:[r,a("day")],Do:[s,function(l){var v=i.ordinal,A=l.match(/\d+/);if(this.day=A[0],v)for(var I=1;I<=31;I+=1)v(I).replace(/\[|\]/g,"")===l&&(this.day=I)}],M:[n,a("month")],MM:[r,a("month")],MMM:[s,function(l){var v=c("months"),A=(c("monthsShort")||v.map(function(I){return I.slice(0,3)})).indexOf(l)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[s,function(l){var v=c("months").indexOf(l)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,a("year")],YY:[r,function(l){this.year=o(l)}],YYYY:[/\d{4}/,a("year")],Z:u,ZZ:u};function b(l){var v,A;v=l,A=i&&i.formats;for(var I=(l=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(_,m,U){var H=U&&U.toUpperCase();return m||A[U]||t[U]||A[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,y,S){return y||S.slice(1)})})).match(e),D=I.length,V=0;V-1)return new Date((E==="X"?1e3:1)*M);var R=b(E)(M),Y=R.year,Z=R.month,B=R.day,z=R.hours,G=R.minutes,K=R.seconds,X=R.milliseconds,J=R.zone,re=new Date,q=B||(Y||Z?1:re.getDate()),ue=Y||re.getFullYear(),Oe=0;Y&&!Z||(Oe=Z>0?Z-1:re.getMonth());var Ie=z||0,Qt=G||0,Xt=K||0,er=X||0;return J?new Date(Date.UTC(ue,Oe,q,Ie,Qt,Xt,er+60*J.offset*1e3)):N?new Date(Date.UTC(ue,Oe,q,Ie,Qt,Xt,er)):new Date(ue,Oe,q,Ie,Qt,Xt,er)}catch{return new Date("")}}(x,C,T),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),U&&x!=this.format(C)&&(this.$d=new Date("")),i={}}else if(C instanceof Array)for(var O=C.length,y=1;y<=O;y+=1){p[1]=C[y-1];var S=A.apply(this,p);if(S.isValid()){this.$d=S.$d,this.$L=S.$L,this.init();break}y===O&&(this.$d=new Date(""))}else D.call(this,V)}}})});var Bn=Q((Mr,Nr)=>{(function(t,e){typeof Mr=="object"&&typeof Nr<"u"?Nr.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_advancedFormat=e()})(Mr,function(){"use strict";return function(t,e){var r=e.prototype,n=r.format;r.format=function(s){var i=this,o=this.$locale();if(!this.isValid())return n.bind(this)(s);var a=this.$utils(),u=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(c){switch(c){case"Q":return Math.ceil((i.$M+1)/3);case"Do":return o.ordinal(i.$D);case"gggg":return i.weekYear();case"GGGG":return i.isoWeekYear();case"wo":return o.ordinal(i.week(),"W");case"w":case"ww":return a.s(i.week(),c==="w"?1:2,"0");case"W":case"WW":return a.s(i.isoWeek(),c==="W"?1:2,"0");case"k":case"kk":return a.s(String(i.$H===0?24:i.$H),c==="k"?1:2,"0");case"X":return Math.floor(i.$d.getTime()/1e3);case"x":return i.$d.getTime();case"z":return"["+i.offsetName()+"]";case"zzz":return"["+i.offsetName("long")+"]";default:return c}});return n.bind(this)(u)}}})});var Vn=Q((Ur,$r)=>{(function(t,e){typeof Ur=="object"&&typeof $r<"u"?$r.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isBetween=e()})(Ur,function(){"use strict";return function(t,e,r){e.prototype.isBetween=function(n,s,i,o){var a=r(n),u=r(s),c=(o=o||"()")[0]==="(",d=o[1]===")";return(c?this.isAfter(a,i):!this.isBefore(a,i))&&(d?this.isBefore(u,i):!this.isAfter(u,i))||(c?this.isBefore(a,i):!this.isAfter(a,i))&&(d?this.isAfter(u,i):!this.isBefore(u,i))}}})});var Fr=Q((Oo,ts)=>{function Lr(t,e,r){var n,s,i,o,a;e==null&&(e=100);function u(){var d=Date.now()-o;d=0?n=setTimeout(u,e-d):(n=null,r||(a=t.apply(i,s),i=s=null))}var c=function(){i=this,s=arguments,o=Date.now();var d=r&&!n;return n||(n=setTimeout(u,e)),d&&(a=t.apply(i,s),i=s=null),a};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(a=t.apply(i,s),i=s=null,clearTimeout(n),n=null)},c}Lr.debounce=Lr;ts.exports=Lr});var In=ee(on());var de=ee(cn());var ba=ee(fn());var W;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(W||(W={}));var or;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(or||(or={}));var k=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ce=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},g=W.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"]),Ti=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ie=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;ur.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ie.create=t=>new ie(t);var ct=(t,e)=>{let r;switch(t.code){case g.invalid_type:t.received===k.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:r=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case g.invalid_union:r="Invalid input";break;case g.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case g.invalid_enum_value:r=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:r="Invalid function arguments";break;case g.invalid_return_type:r="Invalid function return type";break;case g.invalid_date:r="Invalid date";break;case g.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case g.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case g.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case g.custom:r="Invalid input";break;case g.invalid_intersection_types:r="Intersection results could not be merged";break;case g.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:r="Number must be finite";break;default:r=e.defaultError,W.assertNever(t)}return{message:r}},mn=ct;function Ei(t){mn=t}function Lt(){return mn}var Ft=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}},bi=[];function w(t,e){let r=Lt(),n=Ft({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ct?void 0:ct].filter(s=>!!s)});t.common.issues.push(n)}var te=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return L;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return L;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}},L=Object.freeze({status:"aborted"}),ut=t=>({status:"dirty",value:t}),ne=t=>({status:"valid",value:t}),ur=t=>t.status==="aborted",cr=t=>t.status==="dirty",kt=t=>t.status==="valid",At=t=>typeof Promise<"u"&&t instanceof Promise;function jt(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function gn(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}var P;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(P||(P={}));var bt,wt,pe=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}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}},pn=(t,e)=>{if(kt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ie(t.common.issues);return this._error=r,this._error}}};function F(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{var u,c;let{message:d}=t;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(u=d??n)!==null&&u!==void 0?u:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}var j=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.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ce(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new te,ctx:{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(At(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)},i=this._parseSync({data:e,path:s.path,parent:s});return pn(s,i)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(At(s)?s:Promise.resolve(s));return pn(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:g.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new ae({schema:this,typeName:$.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return fe.create(this,this._def)}nullable(){return Se.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ke.create(this,this._def)}promise(){return De.create(this,this._def)}or(e){return qe.create([this,e],this._def)}and(e){return Ge.create(this,e,this._def)}transform(e){return new ae({...F(this._def),schema:this,typeName:$.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new et({...F(this._def),innerType:this,defaultValue:r,typeName:$.ZodDefault})}brand(){return new xt({typeName:$.ZodBranded,type:this,...F(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new tt({...F(this._def),innerType:this,catchValue:r,typeName:$.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ot.create(this,e)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wi=/^c[^\s-]{8,}$/i,ki=/^[0-9a-z]+$/,Ai=/^[0-9A-HJKMNP-TV-Z]{26}$/,xi=/^[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,Oi=/^[a-z0-9_-]{21}$/i,Ii=/^[-+]?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)?)??$/,Ci=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ar,Ri=/^(?:(?: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])$/,Di=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Mi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yn="((\\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])))",Ni=new RegExp(`^${yn}$`);function vn(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ui(t){return new RegExp(`^${vn(t)}$`)}function _n(t){let e=`${yn}T${vn(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function $i(t,e){return!!((e==="v4"||!e)&&Ri.test(t)||(e==="v6"||!e)&&Di.test(t))}var Pe=class t extends j{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let i=this._getOrReturnCtx(e);return w(i,{code:g.invalid_type,expected:k.string,received:i.parsedType}),L}let n=new te,s;for(let i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:g.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.lengthe.test(s),{validation:r,code:g.invalid_string,...P.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...P.errToObj(e)})}url(e){return this._addCheck({kind:"url",...P.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...P.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...P.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...P.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...P.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...P.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...P.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...P.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...P.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...P.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...P.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...P.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...P.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...P.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...P.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...P.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...P.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...P.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...P.errToObj(r)})}nonempty(e){return this.min(1,P.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new Pe({checks:[],typeName:$.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...F(t)})};function Li(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}var Ve=class t extends j{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)!==k.number){let i=this._getOrReturnCtx(e);return w(i,{code:g.invalid_type,expected:k.number,received:i.parsedType}),L}let n,s=new te;for(let i of this._def.checks)i.kind==="int"?W.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:g.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),w(n,{code:g.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Li(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),w(n,{code:g.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:g.not_finite,message:i.message}),s.dirty()):W.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,P.toString(r))}gt(e,r){return this.setLimit("min",e,!1,P.toString(r))}lte(e,r){return this.setLimit("max",e,!0,P.toString(r))}lt(e,r){return this.setLimit("max",e,!1,P.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:P.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:P.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:P.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew Ve({checks:[],typeName:$.ZodNumber,coerce:t?.coerce||!1,...F(t)});var He=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==k.bigint){let i=this._getOrReturnCtx(e);return w(i,{code:g.invalid_type,expected:k.bigint,received:i.parsedType}),L}let n,s=new te;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),w(n,{code:g.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),w(n,{code:g.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):W.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,P.toString(r))}gt(e,r){return this.setLimit("min",e,!1,P.toString(r))}lte(e,r){return this.setLimit("max",e,!0,P.toString(r))}lt(e,r){return this.setLimit("max",e,!1,P.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:P.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new He({checks:[],typeName:$.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...F(t)})};var Ye=class extends j{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.boolean,received:n.parsedType}),L}return ne(e.data)}};Ye.create=t=>new Ye({typeName:$.ZodBoolean,coerce:t?.coerce||!1,...F(t)});var We=class t extends j{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let i=this._getOrReturnCtx(e);return w(i,{code:g.invalid_type,expected:k.date,received:i.parsedType}),L}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return w(i,{code:g.invalid_date}),L}let n=new te,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:g.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):W.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:P.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:P.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew We({checks:[],coerce:t?.coerce||!1,typeName:$.ZodDate,...F(t)});var dt=class extends j{_parse(e){if(this._getType(e)!==k.symbol){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.symbol,received:n.parsedType}),L}return ne(e.data)}};dt.create=t=>new dt({typeName:$.ZodSymbol,...F(t)});var ze=class extends j{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.undefined,received:n.parsedType}),L}return ne(e.data)}};ze.create=t=>new ze({typeName:$.ZodUndefined,...F(t)});var Ze=class extends j{_parse(e){if(this._getType(e)!==k.null){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.null,received:n.parsedType}),L}return ne(e.data)}};Ze.create=t=>new Ze({typeName:$.ZodNull,...F(t)});var Re=class extends j{constructor(){super(...arguments),this._any=!0}_parse(e){return ne(e.data)}};Re.create=t=>new Re({typeName:$.ZodAny,...F(t)});var we=class extends j{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ne(e.data)}};we.create=t=>new we({typeName:$.ZodUnknown,...F(t)});var ge=class extends j{_parse(e){let r=this._getOrReturnCtx(e);return w(r,{code:g.invalid_type,expected:k.never,received:r.parsedType}),L}};ge.create=t=>new ge({typeName:$.ZodNever,...F(t)});var lt=class extends j{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.void,received:n.parsedType}),L}return ne(e.data)}};lt.create=t=>new lt({typeName:$.ZodVoid,...F(t)});var ke=class t extends j{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==k.array)return w(r,{code:g.invalid_type,expected:k.array,received:r.parsedType}),L;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(w(r,{code:g.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new pe(r,o,r.path,a)))).then(o=>te.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new pe(r,o,r.path,a)));return te.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:P.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:P.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:P.toString(r)}})}nonempty(e){return this.min(1,e)}};ke.create=(t,e)=>new ke({type:t,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...F(e)});function ot(t){if(t instanceof se){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fe.create(ot(n))}return new se({...t._def,shape:()=>e})}else return t instanceof ke?new ke({...t._def,type:ot(t.element)}):t instanceof fe?fe.create(ot(t.unwrap())):t instanceof Se?Se.create(ot(t.unwrap())):t instanceof _e?_e.create(t.items.map(e=>ot(e))):t}var se=class t extends j{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=W.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==k.object){let c=this._getOrReturnCtx(e);return w(c,{code:g.invalid_type,expected:k.object,received:c.parsedType}),L}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ge&&this._def.unknownKeys==="strip"))for(let c in s.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let d=i[c],h=s.data[c];u.push({key:{status:"valid",value:c},value:d._parse(new pe(s,h,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ge){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of a)u.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(c==="strict")a.length>0&&(w(s,{code:g.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of a){let h=s.data[d];u.push({key:{status:"valid",value:d},value:c._parse(new pe(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of u){let h=await d.key,b=await d.value;c.push({key:h,value:b,alwaysSet:d.alwaysSet})}return c}).then(c=>te.mergeObjectSync(n,c)):te.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return P.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,i,o,a;let u=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=P.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return W.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return W.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return ot(this)}partial(e){let r={};return W.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return W.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof fe;)i=i._def.innerType;r[n]=i}}),new t({...this._def,shape:()=>r})}keyof(){return Sn(W.objectKeys(this.shape))}};se.create=(t,e)=>new se({shape:()=>t,unknownKeys:"strip",catchall:ge.create(),typeName:$.ZodObject,...F(e)});se.strictCreate=(t,e)=>new se({shape:()=>t,unknownKeys:"strict",catchall:ge.create(),typeName:$.ZodObject,...F(e)});se.lazycreate=(t,e)=>new se({shape:t,unknownKeys:"strip",catchall:ge.create(),typeName:$.ZodObject,...F(e)});var qe=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new ie(a.ctx.common.issues));return w(r,{code:g.invalid_union,unionErrors:o}),L}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(u=>new ie(u));return w(r,{code:g.invalid_union,unionErrors:a}),L}}get options(){return this._def.options}};qe.create=(t,e)=>new qe({options:t,typeName:$.ZodUnion,...F(e)});var be=t=>t instanceof Ke?be(t.schema):t instanceof ae?be(t.innerType()):t instanceof Je?[t.value]:t instanceof Qe?t.options:t instanceof Xe?W.objectValues(t.enum):t instanceof et?be(t._def.innerType):t instanceof ze?[void 0]:t instanceof Ze?[null]:t instanceof fe?[void 0,...be(t.unwrap())]:t instanceof Se?[null,...be(t.unwrap())]:t instanceof xt||t instanceof rt?be(t.unwrap()):t instanceof tt?be(t._def.innerType):[],Bt=class t extends j{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return w(r,{code:g.invalid_type,expected:k.object,received:r.parsedType}),L;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(w(r,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=be(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:$.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...F(n)})}};function dr(t,e){let r=Ce(t),n=Ce(e);if(t===e)return{valid:!0,data:t};if(r===k.object&&n===k.object){let s=W.objectKeys(e),i=W.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let u=dr(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===k.array&&n===k.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i{if(ur(i)||ur(o))return L;let a=dr(i.value,o.value);return a.valid?((cr(i)||cr(o))&&r.dirty(),{status:r.value,value:a.data}):(w(n,{code:g.invalid_intersection_types}),L)};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(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ge.create=(t,e,r)=>new Ge({left:t,right:e,typeName:$.ZodIntersection,...F(r)});var _e=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return w(n,{code:g.invalid_type,expected:k.array,received:n.parsedType}),L;if(n.data.lengththis._def.items.length&&(w(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new pe(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>te.mergeArray(r,o)):te.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};_e.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _e({items:t,typeName:$.ZodTuple,rest:null,...F(e)})};var Vt=class t extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.object)return w(n,{code:g.invalid_type,expected:k.object,received:n.parsedType}),L;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new pe(n,a,n.path,a)),value:o._parse(new pe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?te.mergeObjectAsync(r,s):te.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof j?new t({keyType:e,valueType:r,typeName:$.ZodRecord,...F(n)}):new t({keyType:Pe.create(),valueType:e,typeName:$.ZodRecord,...F(r)})}},ft=class extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.map)return w(n,{code:g.invalid_type,expected:k.map,received:n.parsedType}),L;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:s._parse(new pe(n,a,n.path,[c,"key"])),value:i._parse(new pe(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return L;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,d=u.value;if(c.status==="aborted"||d.status==="aborted")return L;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}};ft.create=(t,e,r)=>new ft({valueType:e,keyType:t,typeName:$.ZodMap,...F(r)});var pt=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return w(n,{code:g.invalid_type,expected:k.set,received:n.parsedType}),L;let s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(w(n,{code:g.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let c=new Set;for(let d of u){if(d.status==="aborted")return L;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>i._parse(new pe(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:P.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:P.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};pt.create=(t,e)=>new pt({valueType:t,minSize:null,maxSize:null,typeName:$.ZodSet,...F(e)});var Ht=class t extends j{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.function)return w(r,{code:g.invalid_type,expected:k.function,received:r.parsedType}),L;function n(a,u){return Ft({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),ct].filter(c=>!!c),issueData:{code:g.invalid_arguments,argumentsError:u}})}function s(a,u){return Ft({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),ct].filter(c=>!!c),issueData:{code:g.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof De){let a=this;return ne(async function(...u){let c=new ie([]),d=await a._def.args.parseAsync(u,i).catch(l=>{throw c.addIssue(n(u,l)),c}),h=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(h,i).catch(l=>{throw c.addIssue(s(h,l)),c})})}else{let a=this;return ne(function(...u){let c=a._def.args.safeParse(u,i);if(!c.success)throw new ie([n(u,c.error)]);let d=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(d,i);if(!h.success)throw new ie([s(d,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:_e.create(e).rest(we.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||_e.create([]).rest(we.create()),returns:r||we.create(),typeName:$.ZodFunction,...F(n)})}},Ke=class extends j{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ke.create=(t,e)=>new Ke({getter:t,typeName:$.ZodLazy,...F(e)});var Je=class extends j{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return w(r,{received:r.data,code:g.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:e.data}}get value(){return this._def.value}};Je.create=(t,e)=>new Je({value:t,typeName:$.ZodLiteral,...F(e)});function Sn(t,e){return new Qe({values:t,typeName:$.ZodEnum,...F(e)})}var Qe=class t extends j{constructor(){super(...arguments),bt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return w(r,{expected:W.joinValues(n),received:r.parsedType,code:g.invalid_type}),L}if(jt(this,bt,"f")||gn(this,bt,new Set(this._def.values),"f"),!jt(this,bt,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return w(r,{received:r.data,code:g.invalid_enum_value,options:n}),L}return ne(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};bt=new WeakMap;Qe.create=Sn;var Xe=class extends j{constructor(){super(...arguments),wt.set(this,void 0)}_parse(e){let r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){let s=W.objectValues(r);return w(n,{expected:W.joinValues(s),received:n.parsedType,code:g.invalid_type}),L}if(jt(this,wt,"f")||gn(this,wt,new Set(W.getValidEnumValues(this._def.values)),"f"),!jt(this,wt,"f").has(e.data)){let s=W.objectValues(r);return w(n,{received:n.data,code:g.invalid_enum_value,options:s}),L}return ne(e.data)}get enum(){return this._def.values}};wt=new WeakMap;Xe.create=(t,e)=>new Xe({values:t,typeName:$.ZodNativeEnum,...F(e)});var De=class extends j{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.promise&&r.common.async===!1)return w(r,{code:g.invalid_type,expected:k.promise,received:r.parsedType}),L;let n=r.parsedType===k.promise?r.data:Promise.resolve(r.data);return ne(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};De.create=(t,e)=>new De({type:t,typeName:$.ZodPromise,...F(e)});var ae=class extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{w(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return L;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?L:u.status==="dirty"||r.value==="dirty"?ut(u.value):u});{if(r.value==="aborted")return L;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?L:a.status==="dirty"||r.value==="dirty"?ut(a.value):a}}if(s.type==="refinement"){let o=a=>{let u=s.refinement(a,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?L:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?L:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!kt(o))return o;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>kt(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);W.assertNever(s)}};ae.create=(t,e,r)=>new ae({schema:t,typeName:$.ZodEffects,effect:e,...F(r)});ae.createWithPreprocess=(t,e,r)=>new ae({schema:e,effect:{type:"preprocess",transform:t},typeName:$.ZodEffects,...F(r)});var fe=class extends j{_parse(e){return this._getType(e)===k.undefined?ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fe.create=(t,e)=>new fe({innerType:t,typeName:$.ZodOptional,...F(e)});var Se=class extends j{_parse(e){return this._getType(e)===k.null?ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Se.create=(t,e)=>new Se({innerType:t,typeName:$.ZodNullable,...F(e)});var et=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};et.create=(t,e)=>new et({innerType:t,typeName:$.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...F(e)});var tt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return At(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ie(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ie(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};tt.create=(t,e)=>new tt({innerType:t,typeName:$.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...F(e)});var ht=class extends j{_parse(e){if(this._getType(e)!==k.nan){let n=this._getOrReturnCtx(e);return w(n,{code:g.invalid_type,expected:k.nan,received:n.parsedType}),L}return{status:"valid",value:e.data}}};ht.create=t=>new ht({typeName:$.ZodNaN,...F(t)});var Fi=Symbol("zod_brand"),xt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ot=class t extends j{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?L:i.status==="dirty"?(r.dirty(),ut(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?L:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:$.ZodPipeline})}},rt=class extends j{_parse(e){let r=this._def.innerType._parse(e),n=s=>(kt(s)&&(s.value=Object.freeze(s.value)),s);return At(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};rt.create=(t,e)=>new rt({innerType:t,typeName:$.ZodReadonly,...F(e)});function Tn(t,e={},r){return t?Re.create().superRefine((n,s)=>{var i,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:u})}}):Re.create()}var ji={object:se.lazycreate},$;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})($||($={}));var Bi=(t,e={message:`Input not instance of ${t.name}`})=>Tn(r=>r instanceof t,e),En=Pe.create,bn=Ve.create,Vi=ht.create,Hi=He.create,wn=Ye.create,Yi=We.create,Wi=dt.create,zi=ze.create,Zi=Ze.create,qi=Re.create,Gi=we.create,Ki=ge.create,Ji=lt.create,Qi=ke.create,Xi=se.create,ea=se.strictCreate,ta=qe.create,ra=Bt.create,na=Ge.create,sa=_e.create,ia=Vt.create,aa=ft.create,oa=pt.create,ua=Ht.create,ca=Ke.create,da=Je.create,la=Qe.create,fa=Xe.create,pa=De.create,hn=ae.create,ha=fe.create,ma=Se.create,ga=ae.createWithPreprocess,ya=Ot.create,va=()=>En().optional(),_a=()=>bn().optional(),Sa=()=>wn().optional(),Ta={string:t=>Pe.create({...t,coerce:!0}),number:t=>Ve.create({...t,coerce:!0}),boolean:t=>Ye.create({...t,coerce:!0}),bigint:t=>He.create({...t,coerce:!0}),date:t=>We.create({...t,coerce:!0})},Ea=L,f=Object.freeze({__proto__:null,defaultErrorMap:ct,setErrorMap:Ei,getErrorMap:Lt,makeIssue:Ft,EMPTY_PATH:bi,addIssueToContext:w,ParseStatus:te,INVALID:L,DIRTY:ut,OK:ne,isAborted:ur,isDirty:cr,isValid:kt,isAsync:At,get util(){return W},get objectUtil(){return or},ZodParsedType:k,getParsedType:Ce,ZodType:j,datetimeRegex:_n,ZodString:Pe,ZodNumber:Ve,ZodBigInt:He,ZodBoolean:Ye,ZodDate:We,ZodSymbol:dt,ZodUndefined:ze,ZodNull:Ze,ZodAny:Re,ZodUnknown:we,ZodNever:ge,ZodVoid:lt,ZodArray:ke,ZodObject:se,ZodUnion:qe,ZodDiscriminatedUnion:Bt,ZodIntersection:Ge,ZodTuple:_e,ZodRecord:Vt,ZodMap:ft,ZodSet:pt,ZodFunction:Ht,ZodLazy:Ke,ZodLiteral:Je,ZodEnum:Qe,ZodNativeEnum:Xe,ZodPromise:De,ZodEffects:ae,ZodTransformer:ae,ZodOptional:fe,ZodNullable:Se,ZodDefault:et,ZodCatch:tt,ZodNaN:ht,BRAND:Fi,ZodBranded:xt,ZodPipeline:Ot,ZodReadonly:rt,custom:Tn,Schema:j,ZodSchema:j,late:ji,get ZodFirstPartyTypeKind(){return $},coerce:Ta,any:qi,array:Qi,bigint:Hi,boolean:wn,date:Yi,discriminatedUnion:ra,effect:hn,enum:la,function:ua,instanceof:Bi,intersection:na,lazy:ca,literal:da,map:aa,nan:Vi,nativeEnum:fa,never:Ki,null:Zi,nullable:ma,number:bn,object:Xi,oboolean:Sa,onumber:_a,optional:ha,ostring:va,pipeline:ya,preprocess:ga,promise:pa,record:ia,set:oa,strictObject:ea,string:En,symbol:Wi,transformer:hn,tuple:sa,undefined:zi,union:ta,unknown:Gi,void:Ji,NEVER:Ea,ZodIssueCode:g,quotelessJson:Ti,ZodError:ie});var ye=f.string().trim().min(1),kn=f.object({RECAPTCHA2_SITE_KEY:ye,RECAPTCHA3_SITE_KEY:ye,STRIPE_PUBLIC_KEY:ye,FERMION_FIREBASE_API_KEY:ye,FERMION_FIREBASE_AUTH_DOMAIN:ye,FERMION_FIREBASE_PROJECT_ID:ye,FERMION_FIREBASE_STORAGE_BUCKET:ye,FERMION_FIREBASE_MESSAGING_SENDER_ID:ye,FERMION_FIREBASE_APP_ID:ye,FERMION_FIREBASE_MEASUREMENT_ID:ye,FERMION_FIREBASE_MESSAGING_VAPID_KEY:ye}).and(f.object({DEPLOYMENT_AREA:f.literal("development"),__INTERNAL_FRONTEND_BACKEND_SHARED_SECRET_FOR_DEVELOPMENT_MODE:f.string()}).or(f.object({DEPLOYMENT_AREA:f.literal("preview")})).or(f.object({DEPLOYMENT_AREA:f.literal("production")})));var lr={RECAPTCHA2_SITE_KEY:"6LcYZ8gjAAAAANg_k25uJR3XvYhvuym5W20K5e9G",RECAPTCHA3_SITE_KEY:"6LcmOMIjAAAAANzPKjz-ebpXzoiQ_smI8RuFxuFl",STRIPE_PUBLIC_KEY:"pk_live_43WsfZ5div9cTesytLff1Oul00VsDJBjlL",FERMION_FIREBASE_API_KEY:"AIzaSyAu3Wj4sytYTjefidYXhF8zU_3q6tZnAHU",FERMION_FIREBASE_AUTH_DOMAIN:"codedamn-production.firebaseapp.com",FERMION_FIREBASE_PROJECT_ID:"codedamn-production",FERMION_FIREBASE_STORAGE_BUCKET:"codedamn-production.appspot.com",FERMION_FIREBASE_MESSAGING_SENDER_ID:"1053607870191",FERMION_FIREBASE_APP_ID:"1:1053607870191:web:00ba637d6e71470cffe51a",FERMION_FIREBASE_MEASUREMENT_ID:"G-YSWXQ08CF9",FERMION_FIREBASE_MESSAGING_VAPID_KEY:"BHsILSAuAAUzXvGrFfg_FFJPmX7yNkgu4e6Ii8KOjb96Jq6wmAPUiPvDrP4YjnKcukmotV6t4S5OGol4n7mNIOw",DEPLOYMENT_AREA:"production"};var pr={};function It(t){let e=r=>Object.fromEntries(Object.entries(r).filter(([,n])=>!!n));pr={...e(pr),...e(t)}}var xn=typeof process>"u"?{}:process.env;It(xn);var fr={RECAPTCHA2_SITE_KEY:"6LcYZ8gjAAAAANg_k25uJR3XvYhvuym5W20K5e9G",RECAPTCHA3_SITE_KEY:"6LcmOMIjAAAAANzPKjz-ebpXzoiQ_smI8RuFxuFl"},An={STRIPE_PUBLIC_KEY:"pk_test_c4pvzghil8rxkmjein3K8Fp300hgaYvVss",FERMION_FIREBASE_API_KEY:"AIzaSyARwxUxAF0faDQ0HqYSojZGE9jRVzd6L5Q",FERMION_FIREBASE_AUTH_DOMAIN:"codedamn-staging.firebaseapp.com",FERMION_FIREBASE_PROJECT_ID:"codedamn-staging",FERMION_FIREBASE_STORAGE_BUCKET:"codedamn-staging.appspot.com",FERMION_FIREBASE_MESSAGING_SENDER_ID:"838456093858",FERMION_FIREBASE_APP_ID:"1:838456093858:web:351a17f00701bb35ab3bfb",FERMION_FIREBASE_MEASUREMENT_ID:"G-EZ6Y845BPD",FERMION_FIREBASE_MESSAGING_VAPID_KEY:"BDhLJ9_FCC5vJXyIjYrdt8IXCBuNmYERdbUo4cFUZevEWPgzWGd6y2KAf3tr0RCKDhYn_YMTNEiJSHTmKzNXSa8"},mt=lr.DEPLOYMENT_AREA||xn.DEPLOYMENT_AREA;if(mt==="development"){let t={...fr,...An,DEPLOYMENT_AREA:mt,__INTERNAL_FRONTEND_BACKEND_SHARED_SECRET_FOR_DEVELOPMENT_MODE:"1234567890"};It(t)}else if(mt==="preview"){let t={...fr,...An,DEPLOYMENT_AREA:mt};It(t)}else if(mt==="production"){let t={...fr,DEPLOYMENT_AREA:mt,STRIPE_PUBLIC_KEY:"pk_live_43WsfZ5div9cTesytLff1Oul00VsDJBjlL",FERMION_FIREBASE_API_KEY:"AIzaSyAu3Wj4sytYTjefidYXhF8zU_3q6tZnAHU",FERMION_FIREBASE_AUTH_DOMAIN:"codedamn-production.firebaseapp.com",FERMION_FIREBASE_PROJECT_ID:"codedamn-production",FERMION_FIREBASE_STORAGE_BUCKET:"codedamn-production.appspot.com",FERMION_FIREBASE_MESSAGING_SENDER_ID:"1053607870191",FERMION_FIREBASE_APP_ID:"1:1053607870191:web:00ba637d6e71470cffe51a",FERMION_FIREBASE_MEASUREMENT_ID:"G-YSWXQ08CF9",FERMION_FIREBASE_MESSAGING_VAPID_KEY:"BHsILSAuAAUzXvGrFfg_FFJPmX7yNkgu4e6Ii8KOjb96Jq6wmAPUiPvDrP4YjnKcukmotV6t4S5OGol4n7mNIOw"};It(t)}else throw new Error("Invalid DEPLOYMENT_AREA in public-env package");It(lr);var Yt=kn.parse(pr);var gt=typeof window<"u"&&typeof document<"u",Ae=!gt,hr=Yt.DEPLOYMENT_AREA==="development",mr=Yt.DEPLOYMENT_AREA==="preview",Ct=Yt.DEPLOYMENT_AREA==="production";var Cn=hr||mr?"6639e182ec75689986f972c3":"67d6ad5ef66ee0901532fd2f";var On="__auth__token";function Me(t){let e;if(Ae)t==null?e=null:"previewData"in t?t.previewData!=null&&typeof t.previewData=="object"&&"token"in t.previewData?e=String(t.previewData.token):(console.warn("Found preview mode but could not find auth token. Very unlikely. Check for bugs"),e=null):"req"in t?e=(0,In.parseCookies)(t).AUTH_TOKEN:e=null;else if(gt)try{e=JSON.parse(localStorage.getItem(On))}catch{e=localStorage.getItem(On)??null}else e=null;return e}function Ne(){let t;if(Ae)t=null;else if(gt)try{t=window.__fermion_auth_token_for_codedamn}catch{t=null}else t=null;return t}async function Pn(t){let e=(0,de.default)(t);return new Promise(function(r){setTimeout(r,e)})}var bo=f.object({shouldPerformSmartCheckoutRedirect:f.boolean(),fermionUserAuthToken:f.string().or(f.null()),discountCode:f.string().nullish(),forceCountry:f.string().nullish(),prefilledName:f.string().nullish(),prefilledEmail:f.string().nullish(),prefilledPhoneNumber:f.string().nullish(),purchaseType:f.literal("fermion-digital-product"),fermionDigitalProductPriceId:f.string().nullish(),totalInstallmentsCountForEmiPlan:f.number().nullish(),productSlug:f.string()}),wo=5*1024*1024;var he=ee(Rn()),Hn=ee(Dn()),Yn=ee(Mn()),Wn=ee(Nn()),zn=ee(Un()),Zn=ee($n()),qn=ee(Ln()),Gn=ee(Fn()),Kn=ee(jn()),Jn=ee(Bn()),Qn=ee(Vn());he.default.extend(Jn.default);he.default.extend(Kn.default);he.default.extend(qn.default);he.default.extend(Wn.default);he.default.extend(Yn.default);he.default.extend(Hn.default);he.default.extend(zn.default);he.default.extend(Zn.default);he.default.extend(Gn.default);he.default.extend(Qn.default);var Pt=he.default;var Xn="Error";function es(t,e){if(t)return;let r=e?`${Xn}: ${e}`:Xn;throw console.error(r),new Error(r)}var ns=ee(Fr()),jr=!1,rs=0;try{if(gt){let e=(0,ns.default)(()=>{window.clearTimeout(rs),jr=!0,rs=window.setTimeout(()=>{jr=!1},(0,de.default)("10m"))},(0,de.default)("2s"),!0);window.addEventListener("mousemove",e),window.addEventListener("keypress",e),window.addEventListener("touchstart",e)}}catch(t){console.error("Failed to set listeners on resetKeyboardMouseTouchActivity",t)}function ss(){return document.hasFocus()?jr:!1}var Ws=ee(Fr());var is=t=>{if(typeof t=="object"&&t!==null){if(typeof Object.getPrototypeOf=="function"){let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}return Object.prototype.toString.call(t)==="[object Object]"}return!1},oe=(...t)=>t.reduce((e,r)=>{if(Array.isArray(r))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(r).forEach(n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=oe.options.mergeArrays?oe.options.uniqueArrayItems?Array.from(new Set(e[n].concat(r[n]))):[...e[n],...r[n]]:r[n]:is(e[n])&&is(r[n])?e[n]=oe(e[n],r[n]):e[n]=r[n]===void 0?oe.options.allowUndefinedOverrides?r[n]:e[n]:r[n])}),e},{}),Br={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};oe.options=Br;oe.withOptions=(t,...e)=>{oe.options=Object.assign(Object.assign({},Br),t);let r=oe(...e);return oe.options=Br,r};function as(t,e){let r=new globalThis.AbortController;function n(a){r.abort(a),i()}let s=[];for(let a of t){if(a?.aborted===!0){n(a.reason);break}if(a?.addEventListener!=null){let u=()=>{n(a.reason)};s.push(()=>{a?.removeEventListener!=null&&a.removeEventListener("abort",u)}),a.addEventListener("abort",u)}}function i(){s.forEach(a=>{a()}),e?.()}let o=r.signal;return o.clear=i,o}var Vr;function Zt(t,e=!0,r=null){if(t===Vr||t===null)return"";let n=[],s=e?encodeURIComponent:i=>i;for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let o=t[i];if(o!==Vr){let a=r?`${r}[${s(i)}]`:s(i);if(typeof o=="object"){let u=Zt(o,e,a);u!==""&&n.push(u)}else Array.isArray(o)?o.forEach((u,c)=>{let d=`${a}[${c}]`;n.push(`${s(d)}=${s(u)}`)}):n.push(`${s(a)}=${s(o)}`)}}return n.join("&")}function Wt(t){return Array.isArray(t)?t.map(Wt):(t&&typeof t=="object"&&Object.keys(t).forEach(e=>{let r=t[e];if(r!==Vr)return Wt(r);delete t[e]}),t)}function os(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function us(t,e){return e?(t.endsWith("/")?t:t+"/")+(e[0]==="/"?e.slice(1):e):t}var Rt=class extends Error{constructor(e,r,n){super(e),this.name="XiorError",this.request=r,this.config=r,this.response=n}},zt=class extends Rt{constructor(e,r,n){super(e),this.name="XiorTimeoutError",this.request=r,this.config=r,this.response=n}};function cs(t,e,r,n,s,i,o){try{var a=t[i](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,s)}function ps(){return(ps=Object.assign||function(t){for(var e=1;ev.toLowerCase()==="content-type");l&&(b=e.headers[l],e.headers["Content-Type"]=b,l!=="Content-Type"&&delete e.headers[l])}b||(b=h?ds:ls,c["Content-Type"]=b),h&&e.params&&(d=oe({},a||{},d)),b===ls?u=JSON.stringify(Wt(a)):!h&&b===ds&&a&&typeof a=="object"&&(u=r(a))}if(Object.keys(d).length>0){let b=r(d,n);i+=i.includes("?")?`&${b}`:`?${b}`}return ps({},e,{_data:u,_url:i,data:a,url:o,method:s,headers:c,isGet:h})},(ms=function(){var e=this,r=arguments;return new Promise(function(n,s){var i=t.apply(e,r);function o(u){cs(i,n,s,o,a,"next",u)}function a(u){cs(i,n,s,o,a,"throw",u)}o(void 0)})}).apply(this,arguments)}function fs(t,e,r,n,s,i,o){try{var a=t[i](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,s)}function qt(t){return function(){var e=this,r=arguments;return new Promise(function(n,s){var i=t.apply(e,r);function o(u){fs(i,n,s,o,a,"next",u)}function a(u){fs(i,n,s,o,a,"throw",u)}o(void 0)})}}function Gt(){return(Gt=Object.assign||function(t){for(var e=1;e(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter(r=>r!==e)},clear:()=>{this.REQI=[]}},response:{use:(e,r)=>(this.RESI.push({fn:e,onRejected:r}),e),eject:e=>{this.RESI=this.RESI.filter(r=>r.fn!==e)},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this.P.push(e),e),eject:e=>{this.P=this.P.filter(r=>r!==e)},clear:()=>{this.P=[]}}}request(e){var r=this;return qt(function*(){let n=oe({},r.config||{},r.defaults||{},typeof e=="string"?{url:e}:e||{},{headers:{},params:{}});for(let i of(n.withCredentials&&!n.credentials&&(n.credentials="include"),n.paramsSerializer||(n.paramsSerializer=Zt),r.REQI))n=yield i(n);let s=r.fetch.bind(r);return r.P.forEach(i=>{s=i(s,r)}),s(n)})()}fetch(e){var r=this;return qt(function*(){let n,s=yield function(p){return ms.apply(this,arguments)}(e),{url:i,method:o,headers:a,timeout:u,signal:c,data:d,_data:h,_url:b,isGet:l}=s,v=function(p,C){if(p==null)return{};var _,m,U={},H=Object.keys(p);for(m=0;m=0||(U[_]=p[_]);return U}(s,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);e._url=b;let A=[],I=Hr;if(u&&wa){let p=new AbortController;I=setTimeout(()=>{p.abort(new zt(`timeout of ${u}ms exceeded`,e))},u),A.push(p.signal)}c&&A.push(c),n=A[0],A.length>1&&(n=as(A,()=>{clearTimeout(I)}));let D=b||i||"";e.baseURL&&!os(D)&&(D=us(e.baseURL,D));let V=0,x=fetch(D,Gt({body:l?Hr:h},v,{signal:n,method:o,headers:a})).then(qt(function*(p){let{responseType:C}=e,_={data:yield function(m,U){return gs.apply(this,arguments)}(p,C),response:p,config:e,request:e,status:p.status,statusText:p.statusText,headers:p.headers};return p.ok?_:Promise.reject(new Rt(p.status?`Request failed with status code ${p.status}`:"Network error",e,_))})).finally(()=>{var p;I&&clearTimeout(I),n==null||(p=n.clear)==null||p.call(n)}),T=[];for(r.RESI.forEach(function(p){T.push(p.fn,p.onRejected)});T.length>V;)x=x.then(T[V++],T[V++]);return x})()}cG(e){return(r,n)=>this.request(n?Gt({},n,{method:e,url:r}):{method:e,url:r})}cP(e){return(r,n,s)=>this.request(s?Gt({},s,{method:e,url:r,data:n}):{method:e,url:r,data:n})}get(e,r){return this.cG("GET")(e,r)}head(e,r){return this.cG("HEAD")(e,r)}post(e,r,n){return this.cP("POST")(e,r,n)}put(e,r,n){return this.cP("PUT")(e,r,n)}patch(e,r,n){return this.cP("PATCH")(e,r,n)}delete(e,r){return this.cG("DELETE")(e,r)}options(e,r){return this.cG("OPTIONS")(e,r)}constructor(e){this.REQI=[],this.RESI=[],this.P=[],this.config=e,this.defaults={params:{},headers:{}}}};yt.VERSION="0.5.1";var Te=Object.assign(yt.create(),{create:yt.create,VERSION:yt.VERSION});var ka=t=>crypto.getRandomValues(new Uint8Array(t)),Aa=(t,e,r)=>{let n=(2<{let o="";for(;;){let a=r(s),u=s;for(;u--;)if(o+=t[a[u]&n]||"",o.length===i)return o}}},ys=(t,e=21)=>Aa(t,e,ka);var xa=f.object({authToken:f.undefined().nullish()}).or(f.object({authToken:f.string().min(1)}).and(f.object({authType:f.literal("user"),userId:f.string().min(1),instructorId:f.string().min(1).nullish(),referrerId:f.string().min(1).nullish()}).or(f.object({authType:f.literal("admin"),adminId:f.string().min(1)})).or(f.object({authType:f.literal("service")})).or(f.object({authType:f.literal("fermion-user"),fermionUserId:f.string().min(1)})).or(f.object({authType:f.literal("fermion-instructor"),fermionInstructorId:f.string().min(1)})))),Oa=f.object({context:f.object({namespace:f.string().min(1),functionName:f.string().min(1),batchingUniqueKey:f.string().min(1).nullish(),fermionSchoolId:f.string().min(1).nullish(),headers:f.record(f.string(),f.string().nullish()).nullish()}).and(xa).nullish(),data:f.object({__placeholder:f.string().nullish()})}),Ia=f.object({status:f.literal("ok"),data:f.object({__placeholder:f.string().nullish()})}),Ca=f.object({status:f.literal("error"),errorMessage:f.string()}),vs=Ia.or(Ca),Ho=f.object({inputSchema:f.object({}),outputSchema:f.object({}),rateLimitMax:f.number(),rateLimitWindow:f.string(),allowedDeploymentAreas:f.array(f.enum(["staging","development","production","testing"])),invokeMode:f.enum(["request-response"])}),Pa=f.function().args(Oa).returns(f.promise(vs).or(vs)),Yo=f.object({handler:Pa}),Wo=f.object({fermionSchoolId:f.string().nullish(),authToken:f.string().nullish(),fermionAuthTokenForCodedamn:f.string().nullish(),data:f.array(f.object({context:f.object({namespace:f.string().min(1),functionName:f.string().min(1),batchingUniqueKey:f.string().min(1).nullish()}),data:f.object({}).passthrough()}))});function _s(t){let e=t;return e?.message&&typeof e.message=="string"?{isRegularError:!0,errorMessage:e.message}:{isRegularError:!1,errorMessage:"Something went wrong! Please try again or contact support@codedamn.com!"}}var Yr=null;function Ss(t){Yr=t}function xe(){if(!Yr)throw new Error("getStoredBackendApiUrl called before storeBackendApiUrl!");return Yr}function Ue(t){let e=t;return e?.errorMessage&&typeof e.errorMessage=="string"?{errorMessage:e.errorMessage,isNetworkError:e.isNetworkError==null?!0:e.isNetworkError}:{errorMessage:_s(t).errorMessage,isNetworkError:!0}}var Ra=t=>{let e,r,n=!1,s=new Promise((i,o)=>{e=a=>{n||(n=!0,i(a))},r=a=>{n||(n=!0,o(a))}});return{batchingUniqueKey:t,resolve:e,reject:r,isSettled:n,data:s}},Wr=class{constructor({maxBatchSize:e,window:r,requestTimeout:n}){this.flushTimeout=null;this.requestKeyToRequestMap=new Map;this.maxBatchSize=e,this.window=r,this.requestTimeout=n}clearFlushTimeout(){this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null)}async flush(){let e=new Map(this.requestKeyToRequestMap.entries());this.requestKeyToRequestMap.clear();let r=Array.from(e.values()).map(s=>({...s.data,context:{...s.data.context,batchingUniqueKey:s.batchingUniqueKey}})),n=setTimeout(()=>{for(let s of e.values())s.deferredPromise.reject({errorMessage:"Request timed out. Please try again or contact support@codedamn.com",isNetworkError:!0});clearTimeout(n)},(0,de.default)(this.requestTimeout));try{let s=xe(),i=Array.from(e.values()),o=null,a=null,u=null;for(let d of i)d.fermionSchoolId!=null&&d.fermionSchoolId!==""&&(o=d.fermionSchoolId),d.authToken!=null&&d.authToken!==""&&(a=d.authToken),d.fermionAuthTokenForCodedamn!=null&&d.fermionAuthTokenForCodedamn!==""&&(u=d.fermionAuthTokenForCodedamn);let c=await Te.request({method:"POST",baseURL:s,url:"",data:{fermionSchoolId:o,authToken:a,fermionAuthTokenForCodedamn:u,data:r}}).then(d=>d.data);for(let d of c){let h=e.get(d.batchingUniqueKey||"");h?(d.output.status==="ok"?h.deferredPromise.resolve(d.output.data):h.deferredPromise.reject({...d.output,isNetworkError:!1}),e.delete(h.batchingUniqueKey)):console.error("Unable to find request for response",d,e)}}catch(s){for(let i of e.values())i.deferredPromise.reject({errorMessage:s?.message||"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!0})}}async fetch({batchingUniqueKey:e,fermionSchoolId:r,authToken:n,fermionAuthTokenForCodedamn:s,data:i}){this.clearFlushTimeout();let o=Ra(e);return this.requestKeyToRequestMap.set(e,{batchingUniqueKey:e,fermionSchoolId:r,authToken:n,fermionAuthTokenForCodedamn:s,data:i,deferredPromise:o}),this.requestKeyToRequestMap.size>this.maxBatchSize?await this.flush():this.flushTimeout=setTimeout(()=>{this.flush().finally(()=>this.clearFlushTimeout())},(0,de.default)(this.window)),await o.data}},$e=new Wr({window:"100ms",maxBatchSize:10,requestTimeout:Ct?"30s":"60s"}),Da=0;function Le(t){return`${Da++}${ys("abcdefghijklmnopqrstuvwxyz",10)()}`}var Ma=[{featureId:"custom-payment-gateways",label:"Custom payment gateways",descriptionMarkdown:"Integrate your preferred payment gateways (Stripe, PayPal, Razorpay, etc.) to accept payments from customers worldwide. Supports multiple currencies and payment methods.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Commerce",linkWhenEnabled:"/instructor/custom-payment-gateways"},{featureId:"object-store",label:"General object storage",descriptionMarkdown:"Secure cloud storage for all your digital assets. Store and manage files, images, videos, and documents with public or private access controls. Perfect for course materials, user uploads, and media content.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Storage",linkWhenEnabled:"/instructor/object-storage"},{featureId:"marketing-fomo-widget",label:"Marketing fomo widget",descriptionMarkdown:"Boost conversions with social proof! Display real-time notifications of recent purchases and enrollments on your course pages. Creates urgency and builds trust with potential customers.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!1,category:"Marketing",linkWhenEnabled:"/instructor/marketing-tools/email-marketing"},{featureId:"xp-earning-ability",label:"XP Earning Ability",descriptionMarkdown:"Gamify learning with experience points (XP). Students earn points for completing courses, participating in discussions, and achieving milestones. Track progress and reward engagement.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!1,category:"Gamification",linkWhenEnabled:"/instructor/gamification"},{featureId:"whitelabeled-footer-branding",descriptionMarkdown:'Remove all Fermion branding and create a completely white-labeled experience. Your brand, your domain, your platform - no "Powered by Fermion" anywhere.',label:"Remove fermion branding",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Branding"},{featureId:"private-api",label:"API access",descriptionMarkdown:"Access your platform data programmatically with APIs. Integrate with third-party tools, build custom applications, or automate workflows. Full documentation included.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!1,category:"Development",linkWhenEnabled:"/instructor/settings/school-limits"},{featureId:"managed-platform",label:"New user registration",descriptionMarkdown:"Control who can join your platform. Disable public registration to create an invite-only or admin-controlled user base. Perfect for corporate training or exclusive communities.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Platform"},{featureId:"web-app-installation",label:"Progressive Web App (PWA)",descriptionMarkdown:"Transform your website into a native-like mobile app. Users can install your platform on their devices, receive push notifications, and enjoy offline functionality. Enhanced mobile experience.",isConfigurableBySchool:!1,isVisibleAsSeparateFeature:!1,category:"Platform"},{featureId:"native-mobile-app",label:"Native Mobile App",descriptionMarkdown:"Ntive app for your business. Users can install your platform on their devices from Playstore on Android and App Store on iOS.",isConfigurableBySchool:!1,isVisibleAsSeparateFeature:!1,category:"Platform"},{featureId:"community",label:"Community",descriptionMarkdown:"Build a thriving community with built-in chat, forums, and discussion boards. Create public and private channels, moderate conversations, and foster peer-to-peer learning. Like Slack/Discord for education.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Engagement",linkWhenEnabled:"/community"},{featureId:"affiliate-marketing",label:"Affiliate marketing",descriptionMarkdown:"Turn your students and followers into brand ambassadors. Create an affiliate program where users earn commissions for successful referrals. Track performance and manage payouts automatically.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Marketing",linkWhenEnabled:"/instructor/affiliate-marketing/settings"},{featureId:"one-on-one-calls",label:"1:1 calls",descriptionMarkdown:"Schedule and manage one-on-one sessions with students. Built-in calendar integration, video calling, and session management. Perfect for coaching, mentoring, and personalized instruction.",isConfigurableBySchool:!1,isVisibleAsSeparateFeature:!0,category:"Communication"},{featureId:"video-library",label:"Video library",descriptionMarkdown:"Centralized video management system. Upload, organize, and embed videos across your platform. Perfect for creating video courses, tutorials, or embedding external video content.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/video-library"},{featureId:"custom-payment-link",label:"Custom payment links",descriptionMarkdown:"Create custom payment links for any product or service. Generate secure payment URLs that can be shared via email, social media, or embedded on websites. Perfect for one-time payments, donations, or selling products without a full storefront.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Commerce",linkWhenEnabled:"/instructor/digital-product/custom-payment-link"},{featureId:"coding-labs",label:"Coding labs",descriptionMarkdown:"Interactive coding environment for hands-on learning. Students can write, run, and debug code in real-time. Supports multiple programming languages with instant feedback and progress tracking.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/coding-labs/all"},{featureId:"courses",label:"Courses",descriptionMarkdown:"Create and sell comprehensive online courses with multimedia content, quizzes, assignments, and certificates. Complete learning management system with progress tracking and analytics.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/digital-product/courses"},{featureId:"bundles",label:"Bundles",descriptionMarkdown:"Package multiple products together as attractive bundles. Combine courses, digital downloads, live sessions, and other content into discounted packages. Increase average order value and offer more value to customers.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/digital-product/bundle"},{featureId:"blogs",label:"Blogs",descriptionMarkdown:"Publish articles, tutorials, and educational content. Built-in SEO tools, rich text editor, and content management. Share knowledge and drive organic traffic to your platform.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/blog"},{featureId:"webhooks",label:"Webhooks",descriptionMarkdown:"Real-time notifications for platform events. Automate workflows by sending data to external services when users enroll, complete courses, or perform other actions.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Development",linkWhenEnabled:"/instructor/webhooks"},{featureId:"gamification",label:"Gamification",descriptionMarkdown:"Engage students with badges, achievements, leaderboards, and progress tracking. Create a competitive and rewarding learning environment that motivates continued participation.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Gamification",linkWhenEnabled:"/instructor/gamification"},{featureId:"custom-website",label:"Custom website",descriptionMarkdown:"Build your dream website with drag-and-drop WordPress builder or custom code. Full control over design, layout, and functionality. No coding skills required for basic customization.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Platform",linkWhenEnabled:"/instructor/custom-pages"},{featureId:"forms",label:"Forms",descriptionMarkdown:"Create powerful forms for surveys, applications, feedback, and data collection. Drag-and-drop builder with conditional logic, file uploads, and automated responses.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/instructor/forms"},{featureId:"digital-products",label:"Digital products",descriptionMarkdown:"Sell digital downloads like eBooks, templates, software, and other digital assets. Secure delivery, license management, and automated fulfillment. Expand your revenue streams.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Commerce",linkWhenEnabled:"/instructor/digital-product/downloadable-products"},{featureId:"live",label:"Live Sessions",descriptionMarkdown:"Host live webinars, workshops, and interactive classes. Real-time video streaming, screen sharing, chat, and recording capabilities. Engage with your audience in real-time.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Communication",linkWhenEnabled:"/instructor/digital-product/live-events"},{featureId:"leaderboard",label:"Leaderboard",descriptionMarkdown:"Foster healthy competition with school-wide leaderboards. Display top performers based on XP, course completion, or custom metrics. Motivate students to excel and stay engaged.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!1,category:"Gamification",linkWhenEnabled:"/leaderboard"},{featureId:"contests",label:"Contests",descriptionMarkdown:"Create competitive assessments with advanced proctoring features. Monitor students during exams, prevent cheating, and ensure academic integrity. Perfect for certifications and evaluations.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Assessment",linkWhenEnabled:"/instructor/digital-product/contests"},{featureId:"marketing-tools",label:"Email and WhatsApp marketing",descriptionMarkdown:"Launch targeted email and WhatsApp campaigns to engage your audience. Segment users, automate follow-ups, and track campaign performance. Drive conversions and build relationships.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Marketing",linkWhenEnabled:"/instructor/marketing-tools/email-marketing"},{featureId:"analytics-funnel-builder",label:"Analytics funnel builder",descriptionMarkdown:"Observe how your UTM campaigns are converting into sales or other user events.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Marketing",linkWhenEnabled:"/instructor/marketing-tools/analytics-funnel-builder"},{featureId:"online-compiler-dsa",label:"Online compiler page",descriptionMarkdown:"Provide a dedicated coding playground for Data Structures & Algorithms practice. Students can write, compile, and test code in C, C++, Java, JavaScript, and more. Perfect for technical interview preparation.",isConfigurableBySchool:!0,isVisibleAsSeparateFeature:!0,category:"Content",linkWhenEnabled:"/online-compiler"}],Ts=/^[a-z0-9-.]*$/gm,Es=f.object({enabledFeatures:f.array(f.unknown()).optional().transform(t=>{if(t==null)return[];{let e=[];for(let r of t){let n=Ma.find(s=>s.featureId===r);n!=null&&e.push(n.featureId)}return e}}),fermionSchoolId:f.string().min(1),hostname:f.string().regex(Ts),aliasHostnames:f.array(f.string().regex(Ts)).default([]),name:f.string().min(1),websiteHeaderLogoStyle:f.enum(["square-logo-with-text","rectangle-image-only"]).default("square-logo-with-text"),logoUrl:f.string().url(),iconUrl:f.string().url(),physicalAddress:f.string().or(f.null()).default(null),certificateLogoUrl:f.string().url(),eligibleLoginOptions:f.array(f.enum(["login-with-google","login-with-email-password","login-with-phone-number"])).default(["login-with-email-password","login-with-google"]),customScriptToInjectInAllPages:f.string().max(2e4,{message:"Please add less than 20K characters. Upload your script/stylesheet externally and embed them externally to maintain performant behavior."}).or(f.null()).default(null),cacheIdentifier:f.string().default(""),userOnboardingFormId:f.string().or(f.null()).default(null),maxConcurrentLoggedInDevicesAllowed:f.number().min(1).default(50),pages:f.array(f.object({userType:f.enum(["Instructor","User","Anonymous"]),action:f.enum(["Allow","Disallow"])}).and(f.object({type:f.literal("path"),path:f.string()}).or(f.object({type:f.literal("regex"),pattern:f.string().refine(t=>{try{return new RegExp(t),!0}catch{return!1}},{message:"Invalid regex in pattern!"})})))).default([{userType:"Instructor",action:"Allow",type:"regex",pattern:"^/(.*)"},{userType:"User",action:"Allow",type:"regex",pattern:"^/(.*)"},{userType:"User",action:"Disallow",type:"regex",pattern:"^/instructor/(.*)"},{userType:"User",action:"Disallow",type:"regex",pattern:"^/user/login"},{userType:"User",action:"Disallow",type:"regex",pattern:"^/user/register"},{userType:"Anonymous",action:"Allow",type:"regex",pattern:"^/(.*)"}]),websiteSuspensionData:f.object({suspendedAt:f.string().datetime(),reason:f.string().nullish()}).optional(),isWebsitePasswordProtected:f.boolean().default(!1)});var Na=f.object({requestUrl:f.string().url(),realUrl:f.string().url()}).and(f.object({websiteType:f.literal("codedamn-main-website")}).or(f.object({websiteType:f.literal("cdm-sh")})).or(f.object({websiteType:f.literal("fermion-school"),fermionSchoolConfig:Es}))),Kt={};var bs=t=>{let e=Na.parse(t),r=new URL(e.requestUrl).hostname,n=new URL(e.realUrl).hostname;Kt[r]=e,Kt[n]=e,typeof window<"u"&&typeof document<"u"&&(window.cdmSitewideContext=e)},zr=t=>{let e=Kt[t.hostname];if(e==null)throw console.error("Error",Kt),new Error(`Found website to be unknown inside sitewide context (${t.hostname})! Make sure the page you are rendering has proper server side injections.`);return e};function Fe({schoolHostname:t}){let e=zr({hostname:t});return(e.websiteType==="fermion-school"?e.fermionSchoolConfig.fermionSchoolId:e.websiteType==="codedamn-main-website"?Cn:null)??""}var ws="service",ks="create-user-tracking-session",mu=`${ws}-${ks}`,As=t=>({context:{namespace:ws,functionName:ks},data:t}),Ua=async({fermionAuthTokenForCodedamn:t,authToken:e,data:r,fermionSchoolId:n})=>{let s;try{s=await Te.request({method:"POST",baseURL:xe(),data:{fermionSchoolId:n,authToken:e,fermionAuthTokenForCodedamn:t,data:[As(r)]}}).then(i=>i.data).then(i=>i.at(0)?.output||null)}catch(i){throw{errorMessage:i?.message||"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!0}}if(!s)throw{errorMessage:"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!1};if(s.status==="ok")return s.data;throw{...s,isNetworkError:!1}},$a=async({schoolHostname:t,data:e,forceOverrideAuthToken:r,shouldEnableBatching:n=!0})=>{let s=r||Me()||null,i=Fe({schoolHostname:t})||null,o=Ne()||null;if(n){let a=Le(e);return await $e.fetch({batchingUniqueKey:a,fermionSchoolId:i,authToken:s,fermionAuthTokenForCodedamn:o,data:As(e)}).then(c=>c)}else return await Ua({fermionAuthTokenForCodedamn:o,fermionSchoolId:i,data:e,authToken:s})},xs=async({data:t,forceOverrideAuthToken:e,shouldEnableBatching:r=!0,forceOverrideSchoolHostname:n})=>{try{let s;if(n!=null)s=n;else if(typeof window<"u"&&typeof document<"u")s=window.location.hostname;else throw new Error("Unable to figure out schoolHostname which is required to get config. Please make sure the API functions are called properly on server side");return{status:"ok",data:await $a({data:t,shouldEnableBatching:r,forceOverrideAuthToken:e,schoolHostname:s})}}catch(s){return{status:"error",errorMessage:Ue(s).errorMessage}}};var Os="service",Is="update-user-tracking-session-page-visit-duration",Tu=`${Os}-${Is}`,Cs=t=>({context:{namespace:Os,functionName:Is},data:t}),La=async({fermionAuthTokenForCodedamn:t,authToken:e,data:r,fermionSchoolId:n})=>{let s;try{s=await Te.request({method:"POST",baseURL:xe(),data:{fermionSchoolId:n,authToken:e,fermionAuthTokenForCodedamn:t,data:[Cs(r)]}}).then(i=>i.data).then(i=>i.at(0)?.output||null)}catch(i){throw{errorMessage:i?.message||"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!0}}if(!s)throw{errorMessage:"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!1};if(s.status==="ok")return s.data;throw{...s,isNetworkError:!1}},Fa=async({schoolHostname:t,data:e,forceOverrideAuthToken:r,shouldEnableBatching:n=!0})=>{let s=r||Me()||null,i=Fe({schoolHostname:t})||null,o=Ne()||null;if(n){let a=Le(e);return await $e.fetch({batchingUniqueKey:a,fermionSchoolId:i,authToken:s,fermionAuthTokenForCodedamn:o,data:Cs(e)}).then(c=>c)}else return await La({fermionAuthTokenForCodedamn:o,fermionSchoolId:i,data:e,authToken:s})},Ps=async({data:t,forceOverrideAuthToken:e,shouldEnableBatching:r=!0,forceOverrideSchoolHostname:n})=>{try{let s;if(n!=null)s=n;else if(typeof window<"u"&&typeof document<"u")s=window.location.hostname;else throw new Error("Unable to figure out schoolHostname which is required to get config. Please make sure the API functions are called properly on server side");return{status:"ok",data:await Fa({data:t,shouldEnableBatching:r,forceOverrideAuthToken:e,schoolHostname:s})}}catch(s){return{status:"error",errorMessage:Ue(s).errorMessage}}};var Rs="service",Ds="create-user-tracking-session-new-page-visit",xu=`${Rs}-${Ds}`,Ms=t=>({context:{namespace:Rs,functionName:Ds},data:t}),ja=async({fermionAuthTokenForCodedamn:t,authToken:e,data:r,fermionSchoolId:n})=>{let s;try{s=await Te.request({method:"POST",baseURL:xe(),data:{fermionSchoolId:n,authToken:e,fermionAuthTokenForCodedamn:t,data:[Ms(r)]}}).then(i=>i.data).then(i=>i.at(0)?.output||null)}catch(i){throw{errorMessage:i?.message||"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!0}}if(!s)throw{errorMessage:"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!1};if(s.status==="ok")return s.data;throw{...s,isNetworkError:!1}},Ba=async({schoolHostname:t,data:e,forceOverrideAuthToken:r,shouldEnableBatching:n=!0})=>{let s=r||Me()||null,i=Fe({schoolHostname:t})||null,o=Ne()||null;if(n){let a=Le(e);return await $e.fetch({batchingUniqueKey:a,fermionSchoolId:i,authToken:s,fermionAuthTokenForCodedamn:o,data:Ms(e)}).then(c=>c)}else return await ja({fermionAuthTokenForCodedamn:o,fermionSchoolId:i,data:e,authToken:s})},Zr=async({data:t,forceOverrideAuthToken:e,shouldEnableBatching:r=!0,forceOverrideSchoolHostname:n})=>{try{let s;if(n!=null)s=n;else if(typeof window<"u"&&typeof document<"u")s=window.location.hostname;else throw new Error("Unable to figure out schoolHostname which is required to get config. Please make sure the API functions are called properly on server side");return{status:"ok",data:await Ba({data:t,shouldEnableBatching:r,forceOverrideAuthToken:e,schoolHostname:s})}}catch(s){return{status:"error",errorMessage:Ue(s).errorMessage}}};var Ns="service",Us="track-user-session-custom-event",Du=`${Ns}-${Us}`,$s=t=>({context:{namespace:Ns,functionName:Us},data:t}),Va=async({fermionAuthTokenForCodedamn:t,authToken:e,data:r,fermionSchoolId:n})=>{let s;try{s=await Te.request({method:"POST",baseURL:xe(),data:{fermionSchoolId:n,authToken:e,fermionAuthTokenForCodedamn:t,data:[$s(r)]}}).then(i=>i.data).then(i=>i.at(0)?.output||null)}catch(i){throw{errorMessage:i?.message||"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!0}}if(!s)throw{errorMessage:"Something went wrong while making this request. Please try again or contact support@codedamn.com",isNetworkError:!1};if(s.status==="ok")return s.data;throw{...s,isNetworkError:!1}},Ha=async({schoolHostname:t,data:e,forceOverrideAuthToken:r,shouldEnableBatching:n=!0})=>{let s=r||Me()||null,i=Fe({schoolHostname:t})||null,o=Ne()||null;if(n){let a=Le(e);return await $e.fetch({batchingUniqueKey:a,fermionSchoolId:i,authToken:s,fermionAuthTokenForCodedamn:o,data:$s(e)}).then(c=>c)}else return await Va({fermionAuthTokenForCodedamn:o,fermionSchoolId:i,data:e,authToken:s})},qr=async({data:t,forceOverrideAuthToken:e,shouldEnableBatching:r=!0,forceOverrideSchoolHostname:n})=>{try{let s;if(n!=null)s=n;else if(typeof window<"u"&&typeof document<"u")s=window.location.hostname;else throw new Error("Unable to figure out schoolHostname which is required to get config. Please make sure the API functions are called properly on server side");return{status:"ok",data:await Ha({data:t,shouldEnableBatching:r,forceOverrideAuthToken:e,schoolHostname:s})}}catch(s){return{status:"error",errorMessage:Ue(s).errorMessage}}};var Ya=t=>{let e=new Map;e.set("web",{name:"web"});let r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},n=(i,o)=>{r.platforms.set(i,o)},s=i=>{r.platforms.has(i)&&(r.currentPlatform=r.platforms.get(i))};return r.addPlatform=n,r.setPlatform=s,r},Wa=t=>t.CapacitorPlatforms=Ya(t),js=Wa(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Nu=js.addPlatform,Uu=js.setPlatform;var vt;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(vt||(vt={}));var Dt=class extends Error{constructor(e,r,n){super(e),this.message=e,this.code=r,this.data=n}},za=t=>{var e,r;return t?.androidBridge?"android":!((r=(e=t?.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},Za=t=>{var e,r,n,s,i;let o=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},u=a.Plugins=a.Plugins||{},c=t.CapacitorPlatforms,d=()=>o!==null?o.name:za(t),h=((e=c?.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||d,b=()=>h()!=="web",l=((r=c?.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||b,v=_=>{let m=T.get(_);return!!(m?.platforms.has(h())||D(_))},A=((n=c?.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||v,I=_=>{var m;return(m=a.PluginHeaders)===null||m===void 0?void 0:m.find(U=>U.name===_)},D=((s=c?.currentPlatform)===null||s===void 0?void 0:s.getPluginHeader)||I,V=_=>t.console.error(_),x=(_,m,U)=>Promise.reject(`${U} does not have an implementation of "${m}".`),T=new Map,p=(_,m={})=>{let U=T.get(_);if(U)return console.warn(`Capacitor plugin "${_}" already registered. Cannot register plugins twice.`),U.proxy;let H=h(),O=D(_),y,S=async()=>(!y&&H in m?y=typeof m[H]=="function"?y=await m[H]():y=m[H]:o!==null&&!y&&"web"in m&&(y=typeof m.web=="function"?y=await m.web():y=m.web),y),M=(B,z)=>{var G,K;if(O){let X=O?.methods.find(J=>z===J.name);if(X)return X.rtype==="promise"?J=>a.nativePromise(_,z.toString(),J):(J,re)=>a.nativeCallback(_,z.toString(),J,re);if(B)return(G=B[z])===null||G===void 0?void 0:G.bind(B)}else{if(B)return(K=B[z])===null||K===void 0?void 0:K.bind(B);throw new Dt(`"${_}" plugin is not implemented on ${H}`,vt.Unimplemented)}},E=B=>{let z,G=(...K)=>{let X=S().then(J=>{let re=M(J,B);if(re){let q=re(...K);return z=q?.remove,q}else throw new Dt(`"${_}.${B}()" is not implemented on ${H}`,vt.Unimplemented)});return B==="addListener"&&(X.remove=async()=>z()),X};return G.toString=()=>`${B.toString()}() { [capacitor code] }`,Object.defineProperty(G,"name",{value:B,writable:!1,configurable:!1}),G},N=E("addListener"),R=E("removeListener"),Y=(B,z)=>{let G=N({eventName:B},z),K=async()=>{let J=await G;R({eventName:B,callbackId:J},z)},X=new Promise(J=>G.then(()=>J({remove:K})));return X.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await K()},X},Z=new Proxy({},{get(B,z){switch(z){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return O?Y:N;case"removeListener":return R;default:return E(z)}}});return u[_]=Z,T.set(_,{name:_,proxy:Z,platforms:new Set([...Object.keys(m),...O?[H]:[]])}),Z},C=((i=c?.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||p;return a.convertFileSrc||(a.convertFileSrc=_=>_),a.getPlatform=h,a.handleError=V,a.isNativePlatform=l,a.isPluginAvailable=A,a.pluginMethodNoop=x,a.registerPlugin=C,a.Exception=Dt,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},qa=t=>t.Capacitor=Za(t),_t=qa(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Bs=_t.registerPlugin,$u=_t.Plugins;var Jt=class{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);let s=this.windowListeners[e];s&&!s.registered&&this.addWindowListener(s);let i=async()=>this.removeListener(e,r),o=Promise.resolve({remove:i});return Object.defineProperty(o,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await i()}}),o}async removeAllListeners(){this.listeners={};for(let e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){let n=this.listeners[e];n&&n.forEach(s=>s(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(e="not implemented"){return new _t.Exception(e,vt.Unimplemented)}unavailable(e="not available"){return new _t.Exception(e,vt.Unavailable)}async removeListener(e,r){let n=this.listeners[e];if(!n)return;let s=n.indexOf(r);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}};var Ls=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Fs=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent),Gr=class extends Jt{async getCookies(){let e=document.cookie,r={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[s,i]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=Fs(s).trim(),i=Fs(i).trim(),r[s]=i}),r}async setCookie(e){try{let r=Ls(e.key),n=Ls(e.value),s=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),o=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${n||""}${s}; path=${i}; ${o};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{let e=document.cookie.split(";")||[];for(let r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}},Lu=Bs("CapacitorCookies",{web:()=>new Gr}),Ga=async t=>new Promise((e,r)=>{let n=new FileReader;n.onload=()=>{let s=n.result;e(s.indexOf(",")>=0?s.split(",")[1]:s)},n.onerror=s=>r(s),n.readAsDataURL(t)}),Ka=(t={})=>{let e=Object.keys(t);return Object.keys(t).map(s=>s.toLocaleLowerCase()).reduce((s,i,o)=>(s[i]=t[e[o]],s),{})},Ja=(t,e=!0)=>t?Object.entries(t).reduce((n,s)=>{let[i,o]=s,a,u;return Array.isArray(o)?(u="",o.forEach(c=>{a=e?encodeURIComponent(c):c,u+=`${i}=${a}&`}),u.slice(0,-1)):(a=e?encodeURIComponent(o):o,u=`${i}=${a}`),`${n}&${u}`},"").substr(1):null,Qa=(t,e={})=>{let r=Object.assign({method:t.method||"GET",headers:t.headers},e),s=Ka(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(s.includes("application/x-www-form-urlencoded")){let i=new URLSearchParams;for(let[o,a]of Object.entries(t.data||{}))i.set(o,a);r.body=i.toString()}else if(s.includes("multipart/form-data")){let i=new FormData;if(t.data instanceof FormData)t.data.forEach((a,u)=>{i.append(u,a)});else for(let a of Object.keys(t.data))i.append(a,t.data[a]);r.body=i;let o=new Headers(r.headers);o.delete("content-type"),r.headers=o}else(s.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r},Kr=class extends Jt{async request(e){let r=Qa(e,e.webFetchExtra),n=Ja(e.params,e.shouldEncodeUrlParams),s=n?`${e.url}?${n}`:e.url,i=await fetch(s,r),o=i.headers.get("content-type")||"",{responseType:a="text"}=i.ok?e:{};o.includes("application/json")&&(a="json");let u,c;switch(a){case"arraybuffer":case"blob":c=await i.blob(),u=await Ga(c);break;case"json":u=await i.json();break;case"document":case"text":default:u=await i.text()}let d={};return i.headers.forEach((h,b)=>{d[b]=h}),{data:u,headers:d,status:i.status,url:i.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}},Fu=Bs("CapacitorHttp",{web:()=>new Kr});var Xa=["web","android","ios"];function Vs(){function t(){try{let r=function(){if(Ae)return!1;let u=function(){let b=new Audio;return b.volume=.5,b.volume===1},c=/iPad|iPhone|iPod/i.test(navigator.userAgent),d=navigator.userAgent.includes("Macintosh"),h=navigator.maxTouchPoints>=1;return c||d&&(h||u())},n=()=>Ae?!1:!!/android/i.test(navigator.userAgent),s=()=>Ae?!1:!!/Win32|Win64|Windows|WinCE/i.test(navigator.userAgent),i=()=>Ae?!1:!!(/Macintosh|MacIntel|MacPPC|Mac68K/i.test(navigator.userAgent)&&!r()),o=()=>Ae?!1:!!/Linux/i.test(navigator.userAgent),a;try{let u=_t.getPlatform();Xa.includes(u)&&(a=u)}catch(u){console.error(u)}return Ae?"Unknown":a==="ios"?"IosApp":a==="android"?"AndroidApp":r()?"IosWeb":n()?"AndroidWeb":s()?"WindowsWeb":i()?"MacOsWeb":o()?"LinuxWeb":"Web"}catch(r){return console.error("Unable to determine user device",r),"Unknown"}}let e=t();return{type:e,isDesktopWebPlatform:e==="LinuxWeb"||e==="MacOsWeb"||e==="WindowsWeb"||e==="Web",isMobilePlatform:e==="AndroidWeb"||e==="AndroidApp"||e==="IosWeb"||e==="IosApp",isAppPlatform:e==="AndroidApp"||e==="IosApp"}}var Hs=()=>{let t="https://backend.codedamn.com/api";return hr?t="https://backend.codedamn.com/api":mr&&(t="https://f7px5khd7ls736ymk2wohfd3w40gcacn.lambda-url.us-east-1.on.aws/"),t};var Jr=class{constructor(){this.pendingUserSessionEventQueue=[];this.trackUserSessionInterval=void 0;this.inMemoryStoredSessionId=null;this.inMemoryStoredSessionIdLastPingedAt=null;this.sessionBroadcastListener=null;this.UpdateUserSessionPageVisitDurationIntervalMs=(0,de.default)("10s");this.ANALYTICS_TAB_BROADCAST_CHANNEL_NAME="codedamn-analytics-broadcast-channel";this.SESSION_ID_SESSION_STORAGE_KEY="__codedamn_SESSION_ID";this.SESSION_ID_LAST_PINGED_AT_SESSION_STORAGE_KEY="__codedamn_SESSION_ID_LAST_PINGED_AT";this.clearPendingUserSessionEventQueue=this.clearPendingUserSessionEventQueue.bind(this),this.debouncedClearPendingUserSessionEventQueue=(0,Ws.debounce)(this.clearPendingUserSessionEventQueue,(0,de.default)("2s"));try{this.sessionBroadcastListener=new BroadcastChannel(this.ANALYTICS_TAB_BROADCAST_CHANNEL_NAME),this.sessionBroadcastListener.addEventListener("message",e=>{try{let r=e.data;if(es(typeof r.type=="string","Data type is not string in analytics broadcast channel"),r.type==="my-sessionid"){let n=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt(),s=r.payload;n===s&&(this.setSessionIdInStorage(null),this.trackUserSession().catch(i=>{console.error("Error with trackUserSession",i)}))}}catch(r){console.error(r)}})}catch(e){console.error(e)}this.debouncedClearPendingUserSessionEventQueue=this.debouncedClearPendingUserSessionEventQueue.bind(this),this.trackUserSessionCustomEvent=this.trackUserSessionCustomEvent.bind(this),this.trackUserSession=this.trackUserSession.bind(this),this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt.bind(this),this.setSessionIdInStorage=this.setSessionIdInStorage.bind(this),this.clearPendingUserSessionEventQueue=this.clearPendingUserSessionEventQueue.bind(this),this.updateUserSessionPageVisitDuration=this.updateUserSessionPageVisitDuration.bind(this)}async trackUserSessionCustomEvent(e){try{let r=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt();if(!r){console.error("Stored session id not found trying to track user session custom event. Adding event to the queue, it will be cleared out in a while."),this.pendingUserSessionEventQueue.push({type:"custom",data:e}),this.debouncedClearPendingUserSessionEventQueue();return}let n=await qr({data:{sessionId:r,eventRecords:e}});n.status==="error"&&console.error(n.errorMessage)}catch(r){console.error(r)}}async trackUserSession(){if(Ct)try{let e=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt();if(e){this.sessionBroadcastListener&&this.sessionBroadcastListener.postMessage({type:"my-sessionid",payload:e});let n=await Zr({data:{sessionId:e,url:window.location.href}});n.status==="error"&&console.error(n.errorMessage)}else{this.pendingUserSessionEventQueue.push({data:window.location.href,type:"pageVisit"}),this.debouncedClearPendingUserSessionEventQueue();let n=await xs({data:{url:window.location.href,referrerUrl:document.referrer,sessionInfo:{devicePlatform:Vs().type,screenWidth:window.screen.width,screenHeight:window.screen.height,devicePixelRatio:window.devicePixelRatio,language:navigator.language,timezoneOffsetInMins:new Date().getTimezoneOffset(),browserUserAgent:navigator.userAgent}}});if(n.status==="error"){console.error(n.errorMessage);return}let s=n.data.sessionId;this.setSessionIdInStorage(s)}let r=async()=>{await this.updateUserSessionPageVisitDuration(),clearTimeout(this.trackUserSessionInterval),this.trackUserSessionInterval=window.setTimeout(()=>{r()},this.UpdateUserSessionPageVisitDurationIntervalMs)};clearTimeout(this.trackUserSessionInterval),this.trackUserSessionInterval=window.setTimeout(()=>{r().catch(n=>{console.error("Error inside updateDurationInInterval",n)})},this.UpdateUserSessionPageVisitDurationIntervalMs)}catch(e){console.error("Error inside trackUserSession",e)}}getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt(){try{let e=sessionStorage.getItem(this.SESSION_ID_SESSION_STORAGE_KEY)||this.inMemoryStoredSessionId;if(!e)throw new Error("sessionId not found.");let r=sessionStorage.getItem(this.SESSION_ID_LAST_PINGED_AT_SESSION_STORAGE_KEY)||this.inMemoryStoredSessionIdLastPingedAt;if(!r)throw new Error("sessionIdLastPingedAtRaw not found.");if(Pt(r).isBefore(Pt().subtract(15,"minutes")))throw new Error("sessionIdLastPingedAtRaw too old.");return this.setSessionIdInStorage(e),e}catch(e){return console.warn(e),this.setSessionIdInStorage(null),null}}setSessionIdInStorage(e){e?(sessionStorage.setItem(this.SESSION_ID_SESSION_STORAGE_KEY,e),sessionStorage.setItem(this.SESSION_ID_LAST_PINGED_AT_SESSION_STORAGE_KEY,Pt().toString())):(sessionStorage.removeItem(this.SESSION_ID_SESSION_STORAGE_KEY),sessionStorage.removeItem(this.SESSION_ID_LAST_PINGED_AT_SESSION_STORAGE_KEY)),this.inMemoryStoredSessionId=e,this.inMemoryStoredSessionIdLastPingedAt=e?Pt().toString():null,e===null&&clearTimeout(this.trackUserSessionInterval)}static getCookie(e){let n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2)return n.pop()?.split(";").shift()}async clearPendingUserSessionEventQueue(){try{if(this.pendingUserSessionEventQueue.length===0)return;let e=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt();if(!e)this.debouncedClearPendingUserSessionEventQueue();else{for(let r of this.pendingUserSessionEventQueue)switch(r.type){case"custom":{let n=await qr({data:{sessionId:e,eventRecords:r.data}});n.status==="error"&&console.error(n.errorMessage);break}case"pageVisit":{let n=await Zr({data:{sessionId:e,url:r.data}});n.status==="error"&&console.error(n.errorMessage);break}default:break}this.pendingUserSessionEventQueue=[]}}catch(e){console.error(e),this.debouncedClearPendingUserSessionEventQueue()}}async updateUserSessionPageVisitDuration(){try{let e=zr({hostname:window.location.hostname}),r;if(e.websiteType==="fermion-school"&&window.location.pathname.startsWith("/embed/")?r=!0:r=!1,!r){if(!ss())return}let n=this.getSessionIdFromStorageAndUpdateLocalStorageLastPingedAt();if(!n){console.error("Stored session id not found trying to update user session page visit duration");return}let s=await Ps({data:{sessionId:n,url:window.location.href}});s.status==="error"&&console.error(s.errorMessage)}catch(e){console.error("Error with updateUserSessionPageVisitDuration",e)}}},Ys=new Jr;async function eo(){let t=Hs();if(!Ct&&t.includes("backend.codedamn.com"))console.warn("Skipping tracking scripts on non-production frontend when using production backend! THIS WILL STOP EVENT EXECUTION!!! Contact support@codedamn.com immediately if you see this for more than a few seconds!");else if(window.cdmTracking!=null)console.warn("Not initializing again as window.cdmTracking is defined");else if(!window.location.pathname.startsWith("/embed")){for(;;)try{bs(window.cdmSitewideContext);break}catch(e){console.warn("Waiting for sitewideContext to be available",e),await Pn("1s")}Ss(t),window.cdmTracking=Ys,Ys.trackUserSession()}}eo();})();