PageSourceSearch

https://macaly-f71wjgvq6i9xepyntwofq8h3.macaly.app/_next/static/ch…?dpl=dpl_EfLejsgFGE4Y2egSF27WaKymTHir

js macaly-f71wjgvq6i9xepyntwofq8h3.macaly.app collected 2026-10-03 04:59:16 UTC 209,522 bytes, 11 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,50711,2082,88218,1737,3697,90798,14001,39197,62849,71482,20344,82045,81958,82295,t=>{"use strict";let e,i;for(var s,n,r=t.i(71645),o=[],a=[],l=Uint8Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,c=u.length;h<c;++h)o[h]=u[h],a[u.charCodeAt(h)]=h;function d(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=e);var s=i===e?0:4-i%4;return[i,s]}function p(t){var e,i,s=d(t),n=s[0],r=s[1],o=new l((n+r)*3/4-r),u=0,h=r>0?n-4:n;for(i=0;i<h;i+=4)e=a[t.charCodeAt(i)]<<18|a[t.charCodeAt(i+1)]<<12|a[t.charCodeAt(i+2)]<<6|a[t.charCodeAt(i+3)],o[u++]=e>>16&255,o[u++]=e>>8&255,o[u++]=255&e;return 2===r&&(e=a[t.charCodeAt(i)]<<2|a[t.charCodeAt(i+1)]>>4,o[u++]=255&e),1===r&&(e=a[t.charCodeAt(i)]<<10|a[t.charCodeAt(i+1)]<<4|a[t.charCodeAt(i+2)]>>2,o[u++]=e>>8&255,o[u++]=255&e),o}function f(t){for(var e,i=t.length,s=i%3,n=[],r=0,a=i-s;r<a;r+=16383)n.push(function(t,e,i){for(var s,n=[],r=e;r<i;r+=3)s=(t[r]<<16&0xff0000)+(t[r+1]<<8&65280)+(255&t[r+2]),n.push(o[s>>18&63]+o[s>>12&63]+o[s>>6&63]+o[63&s]);return n.join("")}(t,r,r+16383>a?a:r+16383));return 1===s?n.push(o[(e=t[i-1])>>2]+o[e<<4&63]+"=="):2===s&&n.push(o[(e=(t[i-2]<<8)+t[i-1])>>10]+o[e>>4&63]+o[e<<2&63]+"="),n.join("")}function m(t){if(void 0===t)return{};if(!y(t))throw Error(`The arguments to a Convex function must be an object. Received: ${t}`);return t}function g(t){if(void 0===t)throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if("string"!=typeof t)throw Error(`Invalid deployment address: found ${t}".`);if(!(t.startsWith("http:")||t.startsWith("https:")))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${t}".`);try{new URL(t)}catch{throw Error(`Invalid deployment address: "${t}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(t.endsWith(".convex.site"))throw Error(`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function y(t){let e="object"==typeof t,i=Object.getPrototypeOf(t),s=null===i||i===Object.prototype||i?.constructor?.name==="Object";return e&&s}a[45]=62,a[95]=63,t.s(["byteLength",0,function(t){var e=d(t),i=e[0],s=e[1];return(i+s)*3/4-s},"fromByteArray",0,f,"fromByteArrayUrlSafeNoPadding",0,function(t){return f(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"toByteArray",0,p],95543),t.s(["isSimpleObject",0,y,"parseArgs",0,m,"validateDeploymentUrl",0,g],2082);let v=BigInt("-9223372036854775808"),w=BigInt("9223372036854775807"),b=BigInt("0"),x=BigInt("8"),S=BigInt("256");function k(t){return Number.isNaN(t)||!Number.isFinite(t)||Object.is(t,-0)}let T=DataView.prototype.setBigInt64?function(t){if(t<v||w<t)throw Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);let e=new ArrayBuffer(8);return new DataView(e).setBigInt64(0,t,!0),f(new Uint8Array(e))}:function(t){t<b&&(t-=v+v);let e=t.toString(16);e.length%2==1&&(e="0"+e);let i=new Uint8Array(new ArrayBuffer(8)),s=0;for(let n of e.match(/.{2}/g).reverse())i.set([parseInt(n,16)],s++),t>>=x;return f(i)},C=DataView.prototype.getBigInt64?function(t){let e=p(t);if(8!==e.byteLength)throw Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);return new DataView(e.buffer).getBigInt64(0,!0)}:function(t){let e=p(t);if(8!==e.byteLength)throw Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);let i=b,s=b;for(let t of e)i+=BigInt(t)*S**s,s++;return i>w&&(i+=v+v),i};function A(t){if(t.length>1024)throw Error(`Field name ${t} exceeds maximum field name length 1024.`);if(t.startsWith("$"))throw Error(`Field name ${t} starts with a '$', which is reserved.`);for(let e=0;e<t.length;e+=1){let i=t.charCodeAt(e);if(i<32||i>=127)throw Error(`Field name ${t}
1 has invalid character '${t[e]}': Field names can only contain non-control ASCII characters`)}}function P(t){if(null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t)return t;if(Array.isArray(t))return t.map(t=>P(t));if("object"!=typeof t)throw Error(`Unexpected type of ${t}`);let e=Object.entries(t);if(1===e.length){let i=e[0][0];if("$bytes"===i){if("string"!=typeof t.$bytes)throw Error(`Malformed $bytes field on ${t}`);return p(t.$bytes).buffer}if("$integer"===i){if("string"!=typeof t.$integer)throw Error(`Malformed $integer field on ${t}`);return C(t.$integer)}if("$float"===i){if("string"!=typeof t.$float)throw Error(`Malformed $float field on ${t}`);let e=p(t.$float);if(8!==e.byteLength)throw Error(`Received ${e.byteLength} bytes, expected 8 for $float`);let i=new DataView(e.buffer).getFloat64(0,!0);if(!k(i))throw Error(`Float ${i} should be encoded as a number`);return i}if("$set"===i)throw Error("Received a Set which is no longer supported as a Convex type.");if("$map"===i)throw Error("Received a Map which is no longer supported as a Convex type.")}let i={};for(let[e,s]of Object.entries(t))A(e),i[e]=P(s);return i}function E(t){return JSON.stringify(t,(t,e)=>void 0===e?"undefined":"bigint"==typeof e?`${e.toString()}n`:e)}function R(t,e,i,s){if(void 0===t){let t=i&&` (present at path ${i} in original object ${E(e)})`;throw Error(`undefined is not a valid Convex value${t}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(null===t)return t;if("bigint"==typeof t){if(t<v||w<t)throw Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);return{$integer:T(t)}}if("number"==typeof t)if(!k(t))return t;else{let e=new ArrayBuffer(8);return new DataView(e).setFloat64(0,t,!0),{$float:f(new Uint8Array(e))}}if("boolean"==typeof t||"string"==typeof t)return t;if(t instanceof ArrayBuffer)return{$bytes:f(new Uint8Array(t))};if(Array.isArray(t))return t.map((t,s)=>R(t,e,i+`[${s}]`,!1));if(t instanceof Set)throw Error(M(i,"Set",[...t],e));if(t instanceof Map)throw Error(M(i,"Map",[...t],e));if(!y(t)){let s=t?.constructor?.name;throw Error(M(i,s?`${s} `:"",t,e))}let n={},r=Object.entries(t);for(let[t,o]of(r.sort(([t,e],[i,s])=>t===i?0:t<i?-1:1),r))void 0!==o?(A(t),n[t]=R(o,e,i+`.${t}`,!1)):s&&(A(t),n[t]=V(o,e,i+`.${t}`));return n}function M(t,e,i,s){return t?`${e}${E(i)} is not a supported Convex type (present at path ${t} in original object ${E(s)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${e}${E(i)} is not a supported Convex type.`}function V(t,e,i){if(void 0===t)return{$undefined:null};if(void 0===e)throw Error(`Programming error. Current value is ${E(t)} but original value is undefined`);return R(t,e,i,!1)}function O(t){return R(t,t,"",!1)}t.s(["convexOrUndefinedToJson",0,function(t){return V(t,t,"")},"convexToJson",0,O,"jsonToConvex",0,P,"patchValueToJson",0,function(t){return R(t,t,"",!0)},"stringifyValueForError",0,E],88218);var I=Object.defineProperty,L=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?I(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class j{constructor({isOptional:t}){L(this,"type"),L(this,"fieldPaths"),L(this,"isOptional"),L(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}get optional(){return"optional"===this.isOptional}}class D extends j{constructor({isOptional:t,tableName:e}){if(super({isOptional:t}),L(this,"tableName"),L(this,"kind","id"),"string"!=typeof e)throw Error("v.id(tableName) requires a string");this.tableName=e}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new D({isOptional:"optional",tableName:this.tableName})}}class $ extends j{constructor(){super(...arguments),L(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new $({isOptional:"optional"})}}class q extends j{constructor(){super(...arguments),L(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new q({isOptional:"optional"})}}class F extends j{constructor(){super(...arguments),L(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new F({isOptional:"optional"})}}class B extends j{constructor(){super(...arguments),L(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new B({isOptional:"optional"})}}class U extends j{constructor(){super(...arguments),L(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new U({isOptional:"optional"})}}class N extends j{constructor(){super(...arguments),L(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new N({isOptional:"optional"})}}class _ extends j{constructor(){super(...arguments),L(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new _({isOptional:"optional"})}}class Q extends j{constructor({isOptional:t,fields:e}){super({isOptional:t}),L(this,"fields"),L(this,"kind","object"),globalThis.Object.values(e).forEach(t=>{if(!t.isConvexValidator)throw Error("v.object() entries must be validators")}),this.fields=e}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,e])=>[t,{fieldType:e.json,optional:"optional"===e.isOptional}]))}}asOptional(){return new Q({isOptional:"optional",fields:this.fields})}}class W extends j{constructor({isOptional:t,value:e}){if(super({isOptional:t}),L(this,"value"),L(this,"kind","literal"),"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&"bigint"!=typeof e)throw Error("v.literal(value) must be a string, number, or boolean");this.value=e}get json(){return{type:this.kind,value:O(this.value)}}asOptional(){return new W({isOptional:"optional",value:this.value})}}class z extends j{constructor({isOptional:t,element:e}){super({isOptional:t}),L(this,"element"),L(this,"kind","array"),this.element=e}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new z({isOptional:"optional",element:this.element})}}class H extends j{constructor({isOptional:t,key:e,value:i}){if(super({isOptional:t}
1),L(this,"key"),L(this,"value"),L(this,"kind","record"),"optional"===e.isOptional)throw Error("Record validator cannot have optional keys");if("optional"===i.isOptional)throw Error("Record validator cannot have optional values");if(!e.isConvexValidator||!i.isConvexValidator)throw Error("Key and value of v.record() but be validators");this.key=e,this.value=i}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new H({isOptional:"optional",key:this.key,value:this.value})}}class X extends j{constructor({isOptional:t,members:e}){super({isOptional:t}),L(this,"members"),L(this,"kind","union"),e.forEach(t=>{if(!t.isConvexValidator)throw Error("All members of v.union() must be validators")}),this.members=e}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new X({isOptional:"optional",members:this.members})}}function Y(t){return!!t.isConvexValidator}let J={id:t=>new D({isOptional:"required",tableName:t}),null:()=>new N({isOptional:"required"}),number:()=>new $({isOptional:"required"}),float64:()=>new $({isOptional:"required"}),bigint:()=>new q({isOptional:"required"}),int64:()=>new q({isOptional:"required"}),boolean:()=>new F({isOptional:"required"}),string:()=>new U({isOptional:"required"}),bytes:()=>new B({isOptional:"required"}),literal:t=>new W({isOptional:"required",value:t}),array:t=>new z({isOptional:"required",element:t}),object:t=>new Q({isOptional:"required",fields:t}),record:(t,e)=>new H({isOptional:"required",key:t,value:e}),union:(...t)=>new X({isOptional:"required",members:t}),any:()=>new _({isOptional:"required"}),optional:t=>t.asOptional()};t.s(["asObjectValidator",0,function(t){return Y(t)?t:J.object(t)},"isValidator",0,Y,"v",0,J],1737);var K=t.i(95543),G=Object.defineProperty,Z=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?G(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};let tt=Symbol.for("ConvexError");class te extends(n=Error,s=tt,n){constructor(t){super("string"==typeof t?t:E(t)),Z(this,"name","ConvexError"),Z(this,"data"),Z(this,s,!0),this.data=t}}t.s(["ConvexError",0,te],3697);let ti=()=>Array.from({length:4},()=>0);ti(),ti(),t.s([],90798),t.s(["ConvexProvider",()=>ei,"ConvexReactClient",()=>t7,"useConvex",()=>ee,"useMutation",()=>en,"useQuery",()=>es],82045),t.s([],20344);let ts="1.28.0";t.s(["version",0,ts],14001);var tn=Object.defineProperty,tr=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tn(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};function to(t){switch(t){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class ta{constructor(t){tr(this,"_onLogLineFuncs"),tr(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let e=Math.random().toString(36).substring(2,15);for(let t=0;t<10&&void 0!==this._onLogLineFuncs[e];t++)e=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[e]=t,()=>{delete this._onLogLineFuncs[e]}}logVerbose(...t){if(this._verbose)for(let e of Object.values(this._onLogLineFuncs))e("debug",`${new Date().toISOString()}`,...t)}log(...t){for(let e of Object.values(this._onLogLineFuncs))e("info",...t)}warn(...t){for(let e of Object.values(this._onLogLineFuncs))e("warn",...t)}error(...t){for(let e of Object.values(this._onLogLineFuncs))e("error",...t)}}function tl(t){let e=new ta(t);return e.addLogLineListener((t,...e)=>{switch(t){case"debug":console.debug(...e);break;case"info":default:console.log(...e);break;case"warn":console.warn(...e);break;case"error":console.error(...e)}}),e}function tu(t,e,i,s,n){let r=to(i);if("object"==typeof n&&(n=`ConvexError ${JSON.stringify(n.errorData,null,2)}`),"info"===e){let e=n.match(/^\[.*?\] /);if(null===e)return void t.error(`[CONVEX ${r}(${s})] Could not parse console.log`);let i=n.slice(1,e[0].length-2),o=n.slice(e[0].length);t.log(`%c[CONVEX ${r}(${s})] [${i}]`,"color:rgb(0, 145, 255)",o)}else t.error(`[CONVEX ${r}(${s})] ${n}`)}function th(t,e,i){let s=to(t);return`[CONVEX ${s}(${e})] ${i.errorMessage}
2  Called by client`}function tc(t,e){return e.data=t.errorData,e}function td(t){let e,i,s=t.split(":");return 1===s.length?(e=s[0],i="default"):(e=s.slice(0,s.length-1).join(":"),i=s[s.length-1]),e.endsWith(".js")&&(e=e.slice(0,-3)),`${e}:${i}`}function tp(t,e){return JSON.stringify({udfPath:td(t),args:O(e)})}var tf=Object.defineProperty,tm=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tf(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tg{constructor(){tm(this,"nextQueryId"),tm(this,"querySetVersion"),tm(this,"querySet"),tm(this,"queryIdToToken"),tm(this,"identityVersion"),tm(this,"auth"),tm(this,"outstandingQueriesOlderThanRestart"),tm(this,"outstandingAuthOlderThanRestart"),tm(this,"paused"),tm(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return 0===this.outstandingQueriesOlderThanRestart.size&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,e,i,s){let n=td(t),r=tp(n,e),o=this.querySet.get(r);if(void 0!==o)return o.numSubscribers+=1,{queryToken:r,modification:null,unsubscribe:()=>this.removeSubscriber(r)};{let t=this.nextQueryId++;this.querySet.set(r,{id:t,canonicalizedUdfPath:n,args:e,numSubscribers:1,journal:i,componentPath:s}),this.queryIdToToken.set(t,r);let o=this.querySetVersion,a=this.querySetVersion+1,l={type:"Add",queryId:t,udfPath:n,args:[O(e)],journal:i,componentPath:s};return this.paused?this.pendingQuerySetModifications.set(t,l):this.querySetVersion=a,{queryToken:r,modification:{type:"ModifyQuerySet",baseVersion:o,newVersion:a,modifications:[l]},unsubscribe:()=>this.removeSubscriber(r)}}}transition(t){for(let e of t.modifications)switch(e.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(e.queryId);let t=e.journal;if(void 0!==t){let i=this.queryIdToToken.get(e.queryId);void 0!==i&&(this.querySet.get(i).journal=t)}break}case"QueryRemoved":this.outstandingQueriesOlderThanRestart.delete(e.queryId);break;default:throw Error(`Invalid modification ${e.type}`)}}queryId(t,e){let i=tp(td(t),e),s=this.querySet.get(i);return void 0!==s?s.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",baseVersion:e,...this.auth}}setAdminAuth(t,e){let i={tokenType:"Admin",value:t,impersonating:e};this.auth=i;let s=this.identityVersion;
2return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...i}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){let e=this.queryIdToToken.get(t);return e?this.querySet.get(e).canonicalizedUdfPath:null}queryArgs(t){let e=this.queryIdToToken.get(t);return e?this.querySet.get(e).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let i of this.querySet.values()){let s={type:"Add",queryId:i.id,udfPath:i.canonicalizedUdfPath,args:[O(i.args)],journal:i.journal,componentPath:i.componentPath};e.push(s),t.has(i.id)||this.outstandingQueriesOlderThanRestart.add(i.id)}this.querySetVersion=1;let i={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[i,void 0];this.outstandingAuthOlderThanRestart=!0;let s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[i,s]}pause(){this.paused=!0}resume(){let t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,e=void 0!==this.auth?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,e]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){let e=this.querySet.get(t);if(e.numSubscribers>1)return e.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(e.id),this.outstandingQueriesOlderThanRestart.delete(e.id);let i=this.querySetVersion,s=this.querySetVersion+1,n={type:"Remove",queryId:e.id};return this.paused?this.pendingQuerySetModifications.has(e.id)?this.pendingQuerySetModifications.delete(e.id):this.pendingQuerySetModifications.set(e.id,n):this.querySetVersion=s,{type:"ModifyQuerySet",baseVersion:i,newVersion:s,modifications:[n]}}}}var ty=Object.defineProperty,tv=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?ty(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tw{constructor(t,e){this.logger=t,this.markConnectionStateDirty=e,tv(this,"inflightRequests"),tv(this,"requestsOlderThanRestart"),tv(this,"inflightMutationsCount",0),tv(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,e){let i=new Promise(i=>{this.inflightRequests.set(t.requestId,{message:t,status:{status:e?"Requested":"NotSent",requestedAt:new Date,onResult:i}}),"Mutation"===t.type?this.inflightMutationsCount++:"Action"===t.type&&this.inflightActionsCount++});return this.markConnectionStateDirty(),i}onResponse(t){let e,i,s=this.inflightRequests.get(t.requestId);if(void 0===s||"Completed"===s.status.status)return null;let n="Mutation"===s.message.type?"mutation":"action",r=s.message.udfPath;for(let e of t.logLines)tu(this.logger,"info",n,r,e);let o=s.status;if(t.success)e={success:!0,logLines:t.logLines,value:P(t.result)},i=()=>o.onResult(e);else{let s=t.result,{errorData:a}=t;tu(this.logger,"error",n,r,s),e={success:!1,errorMessage:s,errorData:void 0!==a?P(a):void 0,logLines:t.logLines},i=()=>o.onResult(e)}return"ActionResponse"!==t.type&&t.success?(s.status={status:"Completed",result:e,ts:t.ts,onResolve:i},null):(i(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),"Action"===s.message.type?this.inflightActionsCount--:"Mutation"===s.message.type&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:e})}removeCompleted(t){let e=new Map;for(let[i,s]of this.inflightRequests.entries()){let n=s.status;"Completed"===n.status&&n.ts.lessThanOrEqual(t)&&(n.onResolve(),e.set(i,n.result),"Mutation"===s.message.type?this.inflightMutationsCount--:"Action"===s.message.type&&this.inflightActionsCount--,this.inflightRequests.delete(i),this.requestsOlderThanRestart.delete(i))}return e.size>0&&this.markConnectionStateDirty(),e}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let t=[];for(let[e,i]of this.inflightRequests){if("NotSent"===i.status.status){i.status.status="Requested",t.push(i.message);continue}if("Mutation"===i.message.type)t.push(i.message);else if("Action"===i.message.type){if(this.inflightRequests.delete(e),this.requestsOlderThanRestart.delete(e),this.inflightActionsCount--,"Completed"===i.status.status)throw Error("Action should never be in 'Completed' state");i.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){let t=[];for(let[,e]of this.inflightRequests)if("NotSent"===e.status.status){e.status.status="Requested",t.push(e.message);continue}return t}hasIncompleteRequests(){for(let t of this.inflightRequests.values())if("Requested"===t.status.status)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return 0===this.requestsOlderThanRestart.size}timeOfOldestInflightRequest(){if(0===this.inflightRequests.size)return null;let t=Date.now();for(let e of this.inflightRequests.values())"Completed"!==e.status.status&&e.status.requestedAt.getTime()<t&&(t=e.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}let tb=Symbol.for("functionName"),tx=Symbol.for("toReferencePath");function tS(t){let e;if("string"==typeof t)e=t.startsWith("function://")?{functionHandle:t}:{name:t};else if(t[tb])e={name:t[tb]};else{let i=t[tx]??null;if(!i)throw Error(`${t} is not a functionReference`);e={reference:i}}return e}function tk(t){let e=tS(t);if(void 0===e.name){if(void 0!==e.functionHandle)throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`);if(void 0!==e.reference)throw Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${e.reference}`);throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`)}if("string"==typeof t)return t;let i=t[tb];if(!i)throw Error(`${t} is not a functionReference`);return i}function tT(t){return{[tb]:t}}t.s(["getFunctionAddress",0,tS,"setReferencePath",0,function(t,e){t[tx]=e},"toReferencePath",0,tx],39197);let tC=function t(e=[]){return new Proxy({}
2,{get(i,s){if("string"==typeof s)return t([...e,s]);if(s===tb){if(e.length<2){let t=["api",...e].join(".");throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let t=e.slice(0,-1).join("/"),i=e[e.length-1];return"default"===i?t:t+":"+i}return s===Symbol.toStringTag?"FunctionReference":void 0}})}();t.s(["anyApi",0,tC,"getFunctionName",0,tk,"makeFunctionReference",0,tT],62849);var tA=Object.defineProperty,tP=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tA(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tE{constructor(t){tP(this,"queryResults"),tP(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...e){let i=m(e[0]),s=tk(t),n=this.queryResults.get(tp(s,i));if(void 0!==n)return tE.queryValue(n.result)}getAllQueries(t){let e=[],i=tk(t);for(let t of this.queryResults.values())t.udfPath===td(i)&&e.push({args:t.args,value:tE.queryValue(t.result)});return e}setQuery(t,e,i){let s=m(e),n=tk(t),r=tp(n,s);this.queryResults.set(r,{udfPath:n,args:s,result:void 0===i?void 0:{success:!0,value:i,logLines:[]}}),this.modifiedQueries.push(r)}static queryValue(t){return void 0===t?void 0:t.success?t.value:void 0}}class tR{constructor(){tP(this,"queryResults"),tP(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,e){this.optimisticUpdates=this.optimisticUpdates.filter(t=>!e.has(t.mutationId));let i=this.queryResults;this.queryResults=new Map(t);let s=new tE(this.queryResults);for(let t of this.optimisticUpdates)t.update(s);let n=[];for(let[t,e]of this.queryResults){let s=i.get(t);(void 0===s||s.result!==e.result)&&n.push(t)}return n}applyOptimisticUpdate(t,e){this.optimisticUpdates.push({update:t,mutationId:e});let i=new tE(this.queryResults);return t(i),i.modifiedQueries}rawQueryResult(t){return this.queryResults.get(t)}queryResult(t){let e=this.queryResults.get(t);if(void 0===e)return;let i=e.result;if(void 0!==i){if(i.success)return i.value;if(void 0!==i.errorData)throw tc(i,new te(th("query",e.udfPath,i)));throw Error(th("query",e.udfPath,i))}}hasQueryResult(t){return void 0!==this.queryResults.get(t)}queryLogs(t){let e=this.queryResults.get(t);return e?.result?.logLines}}var tM=Object.defineProperty,tV=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tM(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tO{constructor(t,e){tV(this,"low"),tV(this,"high"),tV(this,"__isUnsignedLong__"),this.low=0|t,this.high=0|e,this.__isUnsignedLong__=!0}static isLong(t){return!0===(t&&t.__isUnsignedLong__)}static fromBytesLE(t){return new tO(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?tI:t>=tj?tD:new tO(t%tL|0,t/tL|0)}toString(){return(BigInt(this.high)*BigInt(tL)+BigInt(this.low)).toString()}equals(t){return tO.isLong(t)||(t=tO.fromValue(t)),(this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return(tO.isLong(t)||(t=tO.fromValue(t)),this.equals(t))?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return 0>=this.comp(t)}static fromValue(t){return"number"==typeof t?tO.fromNumber(t):new tO(t.low,t.high)}}let tI=new tO(0,0),tL=0x100000000,tj=0xffffffffffffffff,tD=new tO(-1,-1);var t$=Object.defineProperty,tq=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?t$(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tF{constructor(t,e){tq(this,"version"),tq(this,"remoteQuerySet"),tq(this,"queryPath"),tq(this,"logger"),this.version={querySet:0,ts:tO.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=e}transition(t){let e=t.startVersion;if(this.version.querySet!==e.querySet||this.version.ts.notEquals(e.ts)||this.version.identity!==e.identity)throw Error(`Invalid start version: ${e.ts.toString()}:${e.querySet}:${e.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let e of t.modifications)switch(e.type){case"QueryUpdated":{let t=this.queryPath(e.queryId);if(t)for(let i of e.logLines)tu(this.logger,"info","query",t,i);let i=P(e.value??null);this.remoteQuerySet.set(e.queryId,{success:!0,value:i,logLines:e.logLines});break}case"QueryFailed":{let t=this.queryPath(e.queryId);if(t)for(let i of e.logLines)tu(this.logger,"info","query",t,i);let{errorData:i}=e;this.remoteQuerySet.set(e.queryId,{success:!1,errorMessage:e.errorMessage,errorData:void 0!==i?P(i):void 0,logLines:e.logLines});break}case"QueryRemoved":this.remoteQuerySet.delete(e.queryId);break;default:throw Error(`Invalid modification ${e.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function tB(t){let e=K.toByteArray(t);return tO.fromBytesLE(Array.from(e))}function tU(t){switch(t.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...t};case"MutationResponse":if(t.success)return{...t,ts:tB(t.ts)};return{...t};case"Transition":return{...t,startVersion:{...t.startVersion,ts:tB(t.startVersion.ts)},endVersion:{...t.endVersion,ts:tB(t.endVersion.ts)}}}}var tN=Object.defineProperty,t_=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tN(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};
2function tQ(){return(void 0===e&&(e=Date.now()),"u"<typeof performance||!performance.now)?Date.now():Math.round(e+performance.now())}function tW(){return`t=${Math.round((tQ()-e)/100)/10}s`}let tz={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};class tH{constructor(t,e,i,s,n,r){this.markConnectionStateDirty=n,this.debug=r,t_(this,"socket"),t_(this,"connectionCount"),t_(this,"_hasEverConnected",!1),t_(this,"lastCloseReason"),t_(this,"transitionChunkBuffer",null),t_(this,"defaultInitialBackoff"),t_(this,"maxBackoff"),t_(this,"retries"),t_(this,"serverInactivityThreshold"),t_(this,"reconnectDueToServerInactivityTimeout"),t_(this,"uri"),t_(this,"onOpen"),t_(this,"onResume"),t_(this,"onMessage"),t_(this,"webSocketConstructor"),t_(this,"logger"),t_(this,"onServerDisconnectError"),this.webSocketConstructor=i,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=e.onOpen,this.onResume=e.onResume,this.onMessage=e.onMessage,this.onServerDisconnectError=e.onServerDisconnectError,this.logger=s,this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||0===t.totalParts||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,Error("Invalid TransitionChunk");if(null===this.transitionChunkBuffer&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){let e=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${e}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){let t=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;let e=tU(JSON.parse(t));if("Transition"!==e.type)throw Error(`Expected Transition, got ${e.type} after assembling chunks`);return e}return null}connect(){if("terminated"===this.socket.state)return;if("disconnected"!==this.socket.state&&"stopped"!==this.socket.state)throw Error("Didn't start connection from disconnected state: "+this.socket.state);let t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),"connecting"!==this.socket.state)throw Error("onopen called with socket not in connecting state");this.setSocketState({state:"ready",ws:t,paused:"yes"===this.socket.paused?"uninitialized":"no"}),this.resetServerInactivityTimeout(),"no"===this.socket.paused&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:tQ()})),"InitialConnect"!==this.lastCloseReason&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",tW(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",tW())),this.connectionCount+=1,this.lastCloseReason=null},t.onerror=t=>{this.transitionChunkBuffer=null;let e=t.message;e&&this.logger.log(`WebSocket error message: ${e}`)},t.onmessage=t=>{this.resetServerInactivityTimeout();let e=t.data.length,i=tU(JSON.parse(t.data));if(this._logVerbose(`received ws message with type ${i.type}
2`),"Ping"!==i.type){if("TransitionChunk"===i.type){let t=this.assembleTransition(i);if(!t)return;i=t,this._logVerbose(`assembled full ws message of type ${i.type}`)}null!==this.transitionChunkBuffer&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${i.type} while buffering TransitionChunks`)),"Transition"===i.type&&this.reportLargeTransition({messageLength:e,transition:i}),this.onMessage(i).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},t.onclose=t=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,null===this.lastCloseReason&&(this.lastCloseReason=t.reason||`closed with code ${t.code}`),1e3!==t.code&&1001!==t.code&&1005!==t.code&&4040!==t.code){let e=`WebSocket closed with code ${t.code}`;t.reason&&(e+=`: ${t.reason}`),this.logger.log(e),this.onServerDisconnectError&&t.reason&&this.onServerDisconnectError(e)}let e=function(t){if(void 0===t)return"Unknown";for(let e of Object.keys(tz))if(t.startsWith(e))return e;return"Unknown"}(t.reason);this.scheduleReconnect(e)}}socketState(){return this.socket.state}sendMessage(t){let e={type:t.type,..."Authenticate"===t.type&&"User"===t.tokenType?{value:`...${t.value.slice(-7)}`}:{}};if("ready"===this.socket.state&&"no"===this.socket.paused){let i=JSON.stringify(function(t){switch(t.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...t};case"Connect":let e;if(void 0===t.maxObservedTimestamp)return{...t,maxObservedTimestamp:void 0};return{...t,maxObservedTimestamp:(e=new Uint8Array(t.maxObservedTimestamp.toBytesLE()),K.fromByteArray(e))}}}(t)),s=!1;try{this.socket.ws.send(i),s=!0}catch(t){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${t}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${s?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(e)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(e)}`),!1}resetServerInactivityTimeout(){"terminated"!==this.socket.state&&(null!==this.reconnectDueToServerInactivityTimeout&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.socket={state:"disconnected"};let e=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(e)}ms`),setTimeout(()=>this.connect(),e)}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{let t=this.socket.ws;return t.onmessage=t=>{this._logVerbose("Ignoring message received after close")},new Promise(e=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),e()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");let t=this.socket.ws;t.onmessage=t=>{this._logVerbose("Ignoring message received after close")};let e=new Promise(e=>{t.onclose=()=>{e()}});return t.close(),e}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{let t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{let t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":this.socket={...this.socket,paused:"yes"};return;default:return void this.socket}}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":"uninitialized"===this.socket.paused?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:tQ()})):"yes"===this.socket.paused&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:"ready"===this.socket.state,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){let e=("client"===t?100:"Unknown"===t?this.defaultInitialBackoff:tz[t].timeout)*Math.pow(2,this.retries);this.retries+=1;let i=Math.min(e,this.maxBackoff),s=i*(Math.random()-.5);return i+s}reportLargeTransition({transition:t,messageLength:e}){if(void 0===t.clientClockSkew||void 0===t.serverTs)return;let i=tQ()-t.clientClockSkew-t.serverTs/1e6,s=`${Math.round(i)}ms`,n=`${Math.round(e/1e4)/100}MB`,r=e/(i/1e3),o=`${Math.round(r/1e4)/100}MB per second`;this._logVerbose(`received ${n} transition in ${s} at ${o}`),e>2e7?this.logger.log(`received query results totaling more that 20MB (${n}
2) which will take a long time to download on slower connections`):i>2e4&&this.logger.log(`received query results totaling ${n} which took more than 20s to arrive (${s})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:i,messageLength:e}})}}class tX extends Error{}function tY(t,e){let i;if("string"!=typeof t)throw new tX("Invalid token specified: must be a string");e||(e={});let s=+(!0!==e.header),n=t.split(".")[s];if("string"!=typeof n)throw new tX(`Invalid token specified: missing part #${s+1}`);try{i=function(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Error("base64 string is not of the correct length")}try{var i;return i=e,decodeURIComponent(atob(i).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}catch{return atob(e)}}(n)}catch(t){throw new tX(`Invalid token specified: invalid base64 for part #${s+1} (${t.message})`)}try{return JSON.parse(i)}catch(t){throw new tX(`Invalid token specified: invalid json for part #${s+1} (${t.message})`)}}tX.prototype.name="InvalidTokenError";var tJ=Object.defineProperty,tK=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?tJ(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class tG{constructor(t,e,i){tK(this,"authState",{state:"noAuth"}),tK(this,"configVersion",0),tK(this,"syncState"),tK(this,"authenticate"),tK(this,"stopSocket"),tK(this,"tryRestartSocket"),tK(this,"pauseSocket"),tK(this,"resumeSocket"),tK(this,"clearAuth"),tK(this,"logger"),tK(this,"refreshTokenLeewaySeconds"),tK(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=e.authenticate,this.stopSocket=e.stopSocket,this.tryRestartSocket=e.tryRestartSocket,this.pauseSocket=e.pauseSocket,this.resumeSocket=e.resumeSocket,this.clearAuth=e.clearAuth,this.logger=i.logger,this.refreshTokenLeewaySeconds=i.refreshTokenLeewaySeconds}async setConfig(t,e){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();let i=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});i.isFromOutdatedConfig||(i.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:e},hasRetried:!1}),this.authenticate(i.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:e}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if("waitingForServerConfirmationOfCachedToken"===this.authState.state){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}"waitingForServerConfirmationOfFreshToken"===this.authState.state&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(!1===t.authUpdateAttempted&&("waitingForServerConfirmationOfFreshToken"===this.authState.state||"waitingForServerConfirmationOfCachedToken"===this.authState.state))return void this._logVerbose("ignoring non-auth token expired error");let{baseVersion:e}=t;this.syncState.isCurrentOrNewerAuthVersion(e+1)?this.tryToReauthenticate(t):this._logVerbose("ignoring auth error for previous auth attempt")}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),"noAuth"===this.authState.state||"waitingForServerConfirmationOfFreshToken"===this.authState.state&&this.tokenConfirmationAttempts>=2){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),"noAuth"!==this.authState.state&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}"waitingForServerConfirmationOfFreshToken"===this.authState.state&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${2-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value&&this.syncState.isNewAuth(e.value)?(this.authenticate(e.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:e.value,hadAuth:"notRefetching"===this.authState.state||"waitingForScheduledRefetch"===this.authState.state})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if("noAuth"===this.authState.state)return;this._logVerbose("refetching auth token");let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if("noAuth"===this.authState.state)return;let e=this.decodeToken(t);if(!e)return void this.logger.error("Auth token is not a valid JWT, cannot refetch the token");let{iat:i,exp:s}=e;if(!i||!s)return void this.logger.error("Auth token does not have required fields, cannot refetch the token");let n=s-i;if(n<=2)return void this.logger.error("Auth token does not live long enough, cannot refetch the token");let r=Math.min(1728e6,(n-this.refreshTokenLeewaySeconds)*1e3);r<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${n}s`),r=0);let o=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},r);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:o,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${r}ms`)}async fetchTokenAndGuardAgainstRace(t,e){let i=++this.configVersion;this._logVerbose(`fetching token with config version ${i}`);let s=await t(e);
2return this.configVersion!==i?(this._logVerbose(`stale config version, expected ${i}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:s}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){let e="waitingForServerConfirmationOfFreshToken"===t.state?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(e)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0}"waitingForScheduledRefetch"===this.authState.state&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return tY(t)}catch(t){return this._logVerbose(`Error decoding token: ${t instanceof Error?t.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}let tZ=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function t0(t){let e=t.name.slice(6);return{name:e=e.charAt(0).toLowerCase()+e.slice(1),startTime:t.startTime}}
2var t1=Object.defineProperty,t2=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?t1(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class t3{constructor(t,e,i){let s;if(t2(this,"address"),t2(this,"state"),t2(this,"requestManager"),t2(this,"webSocketManager"),t2(this,"authenticationManager"),t2(this,"remoteQuerySet"),t2(this,"optimisticQueryResults"),t2(this,"_transitionHandlerCounter",0),t2(this,"_nextRequestId"),t2(this,"_onTransitionFns",new Map),t2(this,"_sessionId"),t2(this,"firstMessageReceived",!1),t2(this,"debug"),t2(this,"logger"),t2(this,"maxObservedTimestamp"),t2(this,"connectionStateSubscribers",new Map),t2(this,"nextConnectionStateSubscriberId",0),t2(this,"_lastPublishedConnectionState"),t2(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{let t=this.connectionState();if(JSON.stringify(t)!==JSON.stringify(this._lastPublishedConnectionState))for(let e of(this._lastPublishedConnectionState=t,this.connectionStateSubscribers.values()))e(t)})}),t2(this,"mark",t=>{var e;this.debug&&(e=this.sessionId,"u">typeof performance&&performance.mark&&performance.mark(t,{detail:{sessionId:e}}))}),"object"==typeof t)throw Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");i?.skipConvexDeploymentUrlCheck!==!0&&g(t);const n=(i={...i}).authRefreshTokenLeewaySeconds??2;let r=i.webSocketConstructor;if(!r&&"u"<typeof WebSocket)throw Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");r=r||WebSocket,this.debug=i.reportDebugInfoToConvex??!1,this.address=t,this.logger=!1===i.logger?function(t){return new ta(t)}({verbose:i.verbose??!1}):!0!==i.logger&&i.logger?i.logger:tl({verbose:i.verbose??!1});const o=t.search("://");if(-1===o)throw Error("Provided address was not an absolute URL.");const a=t.substring(o+3),l=t.substring(0,o);if("http"===l)s="ws";else if("https"===l)s="wss";else throw Error(`Unknown parent protocol ${l}`);const u=`${s}://${a}/api/${ts}/sync`;this.state=new tg,this.remoteQuerySet=new tF(t=>this.state.queryPath(t),this.logger),this.requestManager=new tw(this.logger,this.markConnectionStateDirty);const h=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new tG(this.state,{authenticate:t=>{let e=this.state.setAuth(t);return this.webSocketManager.sendMessage(e),e.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:h,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:n}),this.optimisticQueryResults=new tR,this.addOnTransitionHandler(t=>{e(t.queries.map(t=>t.token))}),this._nextRequestId=0,this._sessionId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)});const{unsavedChangesWarning:c}=i;if("u"<typeof window||void 0===window.addEventListener){if(!0===c)throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else!1!==c&&window.addEventListener("beforeunload",t=>{if(this.requestManager.hasIncompleteRequests()){t.preventDefault();let e="Are you sure you want to leave? Your changes may not be saved.";return(t||window.event).returnValue=e,e}});this.webSocketManager=new tH(u,{onOpen:t=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...t,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});let e=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new tF(t=>this.state.queryPath(t),this.logger);let[i,s]=this.state.restart(e);for(let t of(s&&this.webSocketManager.sendMessage(s),this.webSocketManager.sendMessage(i),this.requestManager.restart()))this.webSocketManager.sendMessage(t)},onResume:()=>{let[t,e]=this.state.resume();for(let i of(e&&this.webSocketManager.sendMessage(e),t&&this.webSocketManager.sendMessage(t),this.requestManager.resume()))this.webSocketManager.sendMessage(i)},onMessage:t=>{switch(!this.firstMessageReceived&&(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMar
2ks()),t.type){case"Transition":{this.observedTimestamp(t.endVersion.ts),this.authenticationManager.onTransition(t),this.remoteQuerySet.transition(t),this.state.transition(t);let e=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(e);break}case"MutationResponse":{t.success&&this.observedTimestamp(t.ts);let e=this.requestManager.onResponse(t);null!==e&&this.notifyOnQueryResultChanges(new Map([[e.requestId,e.result]]));break}case"ActionResponse":this.requestManager.onResponse(t);break;case"AuthError":this.authenticationManager.onAuthError(t);break;case"FatalError":{var e,i;let s,n=(e=this.logger,i=t.error,s=`[CONVEX FATAL ERROR] ${i}`,e.error(s),Error(s));throw this.webSocketManager.terminate(),n}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:i.onServerDisconnectError},r,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),i.expectAuth&&h()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(void 0===this.maxObservedTimestamp||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){let e=this.remoteQuerySet.remoteQueryResults(),i=new Map;for(let[t,s]of e){let e=this.state.queryToken(t);if(null!==e){let n={result:s,udfPath:this.state.queryPath(t),args:this.state.queryArgs(t)};i.set(e,n)}}let s=this.optimisticQueryResults.ingestQueryResultsFromServer(i,new Set(t.keys()));this.handleTransition({queries:s.map(t=>{let e=this.optimisticQueryResults.rawQueryResult(t);return{token:t,modification:{kind:"Updated",result:e.result}}}),reflectedMutations:Array.from(t).map(([t,e])=>({requestId:t,result:e})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(let e of this._onTransitionFns.values())e(t)}addOnTransitionHandler(t){let e=this._transitionHandlerCounter++;return this._onTransitionFns.set(e,t),()=>this._onTransitionFns.delete(e)}getCurrentAuthClaims(){let t=this.state.getAuth(),e={};if(t&&"User"===t.tokenType){try{e=t?tY(t.value):{}}catch{e={}}return{token:t.value,decoded:e}}}setAuth(t,e){this.authenticationManager.setConfig(t,e)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,e){let i=this.state.setAdminAuth(t,e);this.webSocketManager.sendMessage(i)}clearAuth(){let t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,e,i){let s=m(e),{modification:n,queryToken:r,unsubscribe:o}=this.state.subscribe(t,s,i?.journal,i?.componentPath);return null!==n&&this.webSocketManager.sendMessage(n),{queryToken:r,unsubscribe:()=>{let t=o();t&&this.webSocketManager.sendMessage(t)}}}localQueryResult(t,e){let i=tp(t,m(e));return this.optimisticQueryResults.queryResult(i)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,e){let i=tp(t,m(e));return this.optimisticQueryResults.queryLogs(i)}queryJournal(t,e){let i=tp(t,m(e));return this.state.queryJournal(i)}connectionState(){let t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){let e=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(e,t),()=>{this.connectionStateSubscribers.delete(e)}}async mutation(t,e,i){let s=await this.mutationInternal(t,e,i);if(!s.success){if(void 0!==s.errorData)throw tc(s,new te(th("mutation",t,s)));throw Error(th("mutation",t,s))}return s.value}async mutationInternal(t,e,i,s){let{mutationPromise:n}=this.enqueueMutation(t,e,i,s);return n}
2enqueueMutation(t,e,i,s){let n=m(e);this.tryReportLongDisconnect();let r=this.nextRequestId;if(this._nextRequestId++,void 0!==i){let t=i.optimisticUpdate;if(void 0!==t){let e=e=>{t(e,n)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},i=this.optimisticQueryResults.applyOptimisticUpdate(e,r).map(t=>{let e=this.localQueryResultByToken(t);return{token:t,modification:{kind:"Updated",result:void 0===e?void 0:{success:!0,value:e,logLines:[]}}}});this.handleTransition({queries:i,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:"Mutation",requestId:r,udfPath:t,componentPath:s,args:[O(n)]},a=this.webSocketManager.sendMessage(o);return{requestId:r,mutationPromise:this.requestManager.request(o,a)}}async action(t,e){let i=await this.actionInternal(t,e);if(!i.success){if(void 0!==i.errorData)throw tc(i,new te(th("action",t,i)));throw Error(th("action",t,i))}return i.value}async actionInternal(t,e,i){let s=m(e),n=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let r={type:"Action",requestId:n,udfPath:t,componentPath:i,args:[O(s)]},o=this.webSocketManager.sendMessage(r);return this.requestManager.request(r,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){let t=function(t){if("u"<typeof performance||!performance.getEntriesByName)return[];let e=[];for(let i of tZ){let s=performance.getEntriesByName(i).filter(t=>"mark"===t.entryType).filter(e=>e.detail.sessionId===t);e.push(...s)}return e.map(t0)}(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;let t=this.connectionState().timeOfOldestInflightRequest;null===t||Date.now()-t.getTime()<=6e4||fetch(`${this.address}/api/debug_event`,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${ts}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(t=>{t.ok||this.logger.warn("Analytics request failed with response:",t.body)}).catch(t=>{this.logger.warn("Analytics response failed with error:",t)})}}var t5=Object.defineProperty,t4=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?t5(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};function t6(t,e){return e.data=P(t),e}t.s(["ConvexHttpClient",0,class{constructor(t,e){if(t4(this,"address"),t4(this,"auth"),t4(this,"adminAuth"),t4(this,"encodedTsPromise"),t4(this,"debug"),t4(this,"fetchOptions"),t4(this,"logger"),t4(this,"mutationQueue",[]),t4(this,"isProcessingQueue",!1),"boolean"==typeof e)throw Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");!0!==(e??{}).skipConvexDeploymentUrlCheck&&g(t),this.logger=e?.logger===!1?function(t){return new ta(t)}({verbose:!1}):e?.logger!==!0&&e?.logger?e.logger:tl({verbose:!1}),this.address=t,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,e?.auth&&this.setAuth(e.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(t){this.clearAuth(),this.auth=t}setAdminAuth(t,e){if(this.clearAuth(),void 0!==e){let i=btoa(String.fromCodePoint(...new TextEncoder().encode(JSON.stringify(e))));this.adminAuth=`${t}:${i}`}else this.adminAuth=t}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(t){this.debug=t}setFetchOptions(t){this.fetchOptions=t}async consistentQuery(t,...e){let i=m(e[0]),s=this.getTimestamp();return await this.queryInner(t,i,{timestampPromise:s})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let t=i||fetch,e={"Content-Type":"application/json","Convex-Client":`npm-${ts}`},s=await t(`${this.address}/api/query_ts`,{...this.fetchOptions,method:"POST",headers:e});if(!s.ok)throw Error(await s.text());let{ts:n}=await s.json();return n}async query(t,...e){let i=m(e[0]);return await this.queryInner(t,i,{})}async queryInner(t,e,s){let n=tk(t),r=[O(e)],o={"Content-Type":"application/json","Convex-Client":`npm-${ts}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);let a=i||fetch,l=s.timestampPromise?await s.timestampPromise:void 0,u=JSON.stringify({path:n,format:"convex_encoded_json",args:r,...l?{ts:l}:{}}),h=l?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,c=await a(h,{...this.fetchOptions,body:u,method:"POST",headers:o});if(!c.ok&&560!==c.status)throw Error(await c.text());let d=await c.json();if(this.debug)for(let t of d.logLines??[])tu(this.logger,"info","query",n,t);switch(d.status){case"success":return P(d.value);case"error":if(void 0!==d.errorData)throw t6(d.errorData,new te(d.errorMessage));throw Error(d.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(d)}`)}}async mutationInner(t,e){let s=tk(t),n=JSON.stringify({path:s,format:"convex_encoded_json",args:[O(e)]}),r={"Content-Type":"application/json","Convex-Client":`npm-${ts}`};this.adminAuth?r.Authorization=`Convex ${this.adminAuth}`:this.auth&&(r.Authorization=`Bearer ${this.auth}`);let o=i||fetch,a=await o(`${this.address}/api/mutation`,{...this.fetchOptions,body:n,method:"POST",headers:r});if(!a.ok&&560!==a.status)throw Error(await a.text());let l=await a.json();if(this.debug)for(let t of l.logLines??[])tu(this.logger,"info","mutation",s,t);switch(l.status){case"success":return P(l.value);case"error":if(void 0!==l.errorData)throw t6(l.errorData,new te(l.errorMessage));throw Error(l.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(l)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;
2this.mutationQueue.length>0;){let{mutation:t,args:e,resolve:i,reject:s}=this.mutationQueue.shift();try{let s=await this.mutationInner(t,e);i(s)}catch(t){s(t)}}this.isProcessingQueue=!1}}enqueueMutation(t,e){return new Promise((i,s)=>{this.mutationQueue.push({mutation:t,args:e,resolve:i,reject:s}),this.processMutationQueue()})}async mutation(t,...e){let[i,s]=e,n=m(i);return s?.skipQueue?await this.mutationInner(t,n):await this.enqueueMutation(t,n)}async action(t,...e){let s=m(e[0]),n=tk(t),r=JSON.stringify({path:n,format:"convex_encoded_json",args:[O(s)]}),o={"Content-Type":"application/json","Convex-Client":`npm-${ts}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);let a=i||fetch,l=await a(`${this.address}/api/action`,{...this.fetchOptions,body:r,method:"POST",headers:o});if(!l.ok&&560!==l.status)throw Error(await l.text());let u=await l.json();if(this.debug)for(let t of u.logLines??[])tu(this.logger,"info","action",n,t);switch(u.status){case"success":return P(u.value);case"error":if(void 0!==u.errorData)throw t6(u.errorData,new te(u.errorMessage));throw Error(u.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(u)}`)}}async function(t,e,...s){let n=m(s[0]),r="string"==typeof t?t:tk(t),o=JSON.stringify({componentPath:e,path:r,format:"convex_encoded_json",args:O(n)}),a={"Content-Type":"application/json","Convex-Client":`npm-${ts}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let l=i||fetch,u=await l(`${this.address}/api/function`,{...this.fetchOptions,body:o,method:"POST",headers:a});if(!u.ok&&560!==u.status)throw Error(await u.text());let h=await u.json();if(this.debug)for(let t of h.logLines??[])tu(this.logger,"info","any",r,t);switch(h.status){case"success":return P(h.value);case"error":if(void 0!==h.errorData)throw t6(h.errorData,new te(h.errorMessage));throw Error(h.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(h)}`)}}}],71482);var t8=Object.defineProperty,t9=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?t8(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};if(void 0===r.default)throw Error("Required dependency 'react' not found");class t7{constructor(t,e){if(t9(this,"address"),t9(this,"cachedSync"),t9(this,"listeners"),t9(this,"options"),t9(this,"closed",!1),t9(this,"_logger"),t9(this,"adminAuth"),t9(this,"fakeUserIdentity"),void 0===t)throw Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if("string"!=typeof t)throw Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=e?.logger===!1?function(t){return new ta(t)}({verbose:e?.verbose??!1}):e?.logger!==!0&&e?.logger?e.logger:tl({verbose:e?.verbose??!1}),this.options={...e,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw Error("ConvexReactClient has already been closed.");return this.cachedSync||(this.cachedSync=new t3(this.address,t=>this.transition(t),this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity)),this.cachedSync}setAuth(t,e){if("string"==typeof t)throw Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,e??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,e){if(this.adminAuth=t,this.fakeUserIdentity=e,this.closed)throw Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,e)}watchQuery(t,...e){let[i,s]=e,n=tk(t);return{onUpdate:t=>{let{queryToken:e,unsubscribe:r}=this.sync.subscribe(n,i,s),o=this.listeners.get(e);return void 0!==o?o.add(t):this.listeners.set(e,new Set([t])),()=>{if(this.closed)return;let i=this.listeners.get(e);i.delete(t),0===i.size&&this.listeners.delete(e),r()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(n,i)},localQueryLogs:()=>
2{if(this.cachedSync)return this.cachedSync.localQueryLogs(n,i)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(n,i)}}}prewarmQuery(t){let e=t.extendSubscriptionFor??5e3;setTimeout(this.watchQuery(t.query,t.args||{}).onUpdate(()=>{}),e)}mutation(t,...e){let[i,s]=e,n=tk(t);return this.sync.mutation(n,i,s)}action(t,...e){let i=tk(t);return this.sync.action(i,...e)}query(t,...e){let i=this.watchQuery(t,...e),s=i.localQueryResult();return void 0!==s?Promise.resolve(s):new Promise((t,e)=>{let s=i.onUpdate(()=>{s();try{t(i.localQueryResult())}catch(t){e(t)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedSync){let t=this.cachedSync;this.cachedSync=void 0,await t.close()}}transition(t){for(let e of t){let t=this.listeners.get(e);if(t)for(let e of t)e()}}}let et=r.default.createContext(void 0);function ee(){return(0,r.useContext)(et)}let ei=({client:t,children:e})=>r.default.createElement(et.Provider,{value:t},e);function es(t,...e){let i="skip"===e[0],s="skip"===e[0]?{}:m(e[0]),n="string"==typeof t?tT(t):t,o=tk(n),a=function(t){let e=ee();if(void 0===e)throw Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return function(t,e){let[i]=(0,r.useState)(()=>new ea(e));return i.createWatch!==e&&i.setCreateWatch(e),(0,r.useEffect)(()=>()=>i.destroy(),[i]),function({getCurrentValue:t,subscribe:e}){let[i,s]=(0,r.useState)(()=>({getCurrentValue:t,subscribe:e,value:t()})),n=i.value;return(i.getCurrentValue!==t||i.subscribe!==e)&&(n=t(),s({getCurrentValue:t,subscribe:e,value:n})),(0,r.useEffect)(()=>{let i=!1,n=()=>{i||s(i=>{if(i.getCurrentValue!==t||i.subscribe!==e)return i;let s=t();return i.value===s?i:{...i,value:s}})},r=e(n);return n(),()=>{i=!0,r()}},[t,e]),n}((0,r.useMemo)(()=>({getCurrentValue:()=>i.getLocalResults(t),subscribe:e=>(i.setQueries(t),i.subscribe(e))}),[i,t]))}(t,(0,r.useMemo)(()=>(t,i,s)=>e.watchQuery(t,i,s?{journal:s}:{}),[e]))}((0,r.useMemo)(()=>i?{}:{query:{query:n,args:s}},[JSON.stringify(O(s)),o,i])).query;if(a instanceof Error)throw a;return a}function en(t){let e="string"==typeof t?tT(t):t,i=(0,r.useContext)(et);if(void 0===i)throw Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,r.useMemo)(()=>(function t(e,i,s){function n(t){return function(t){if("object"==typeof t&&null!==t&&"bubbles"in t&&"persist"in t&&"isDefaultPrevented"in t)throw Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}(t),i.mutation(e,t,{optimisticUpdate:s})}return n.withOptimisticUpdate=function(n){if(void 0!==s)throw Error(`Already specified optimistic update for mutation ${tk(e)}`);return t(e,i,n)},n})(e,i),[i,tk(e)])}var er=Object.defineProperty,eo=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?er(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class ea{constructor(t){eo(this,"createWatch"),eo(this,"queries"),eo(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(let e of Object.keys(t)){let{query:i,args:s}=t[e];if(tk(i),void 0===this.queries[e])this.addQuery(e,i,s);else{let t=this.queries[e];(tk(i)!==tk(t.query)||JSON.stringify(O(s))!==JSON.stringify(O(t.args)))&&(this.removeQuery(e),this.addQuery(e,i,s))}}for(let e of Object.keys(this.queries))void 0===t[e]&&this.removeQuery(e)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){let e={};for(let i of Object.keys(t)){let s,{query:n,args:r}=t[i];tk(n);let o=this.createWatch(n,r);try{s=o.localQueryResult()}catch(t){if(t instanceof Error)s=t;else throw t}e[i]=s}return e}setCreateWatch(t){for(let e of(this.createWatch=t,Object.keys(this.queries))){let{query:t,args:i,watch:s}=this.queries[e],n=s.journal();this.removeQuery(e),this.addQuery(e,t,i,n)}}destroy(){for(let t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,e,i,s){if(void 0!==this.queries[t])throw Error(`Tried to add a new query with identifier ${t} when it already exists.`);let n=this.createWatch(e,i,s),r=n.onUpdate(()=>this.notifyListeners());this.queries[t]={query:e,args:i,watch:n,unsubscribe:r}}removeQuery(t){let e=this.queries[t];
2if(void 0===e)throw Error(`No query found with identifier ${t}.`);e.unsubscribe(),delete this.queries[t]}notifyListeners(){for(let t of this.listeners)t()}}Symbol("includePageKeys"),Symbol("page");let el=(0,r.createContext)(void 0);function eu(){let t=(0,r.useContext)(el);if(void 0===t)throw Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return t}function eh({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:i,client:s,setIsConvexAuthenticated:n}){return(0,r.useEffect)(()=>{let i=!0;if(t)return s.setAuth(e,t=>{i&&n(()=>t)}),()=>{i=!1,n(t=>!t&&null)}},[t,e,i,s,n]),null}function ec({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:i,client:s,setIsConvexAuthenticated:n}){return(0,r.useEffect)(()=>{if(t)return()=>{s.clearAuth(),n(()=>null)}},[t,e,i,s,n]),null}t.s(["ConvexProviderWithAuth",0,function({children:t,client:e,useAuth:i}){let{isLoading:s,isAuthenticated:n,fetchAccessToken:o}=i(),[a,l]=(0,r.useState)(null);return s&&null!==a&&l(null),s||n||!1===a||l(!1),r.default.createElement(el.Provider,{value:{isLoading:null===a,isAuthenticated:n&&(a??!1)}},r.default.createElement(eh,{authProviderAuthenticated:n,fetchAccessToken:o,authProviderLoading:s,client:e,setIsConvexAuthenticated:l}),r.default.createElement(ei,{client:e},t),r.default.createElement(ec,{authProviderAuthenticated:n,fetchAccessToken:o,authProviderLoading:s,client:e,setIsConvexAuthenticated:l}))},"useConvexAuth",0,eu],81958),t.s(["Authenticated",0,function({children:t}){let{isLoading:e,isAuthenticated:i}=eu();return e||!i?null:r.default.createElement(r.default.Fragment,null,t)},"Unauthenticated",0,function({children:t}){let{isLoading:e,isAuthenticated:i}=eu();return e||i?null:r.default.createElement(r.default.Fragment,null,t)}],82295),t.s([],50711)},95057,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s={formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var n in s)Object.defineProperty(i,n,{enumerable:!0,get:s[n]});let r=t.r(90809)._(t.r(98183)),o=/https?|ftp|gopher|file/;function a(t){let{auth:e,hostname:i}=t,s=t.protocol||"",n=t.pathname||"",a=t.hash||"",l=t.query||"",u=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?u=e+t.host:i&&(u=e+(~i.indexOf(":")?`[${i}]`:i),t.port&&(u+=":"+t.port)),l&&"object"==typeof l&&(l=String(r.urlQueryToSearchParams(l)));let h=t.search||l&&`?${l}`||"";return s&&!s.endsWith(":")&&(s+=":"),t.slashes||(!s||o.test(s))&&!1!==u?(u="//"+(u||""),n&&"/"!==n[0]&&(n="/"+n)):u||(u=""),a&&"#"!==a[0]&&(a="#"+a),h&&"?"!==h[0]&&(h="?"+h),n=n.replace(/[?#]/g,encodeURIComponent),h=h.replace("#","%23"),`${s}${u}${n}${h}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(t){return a(t)}},18581,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"useMergedRef",{enumerable:!0,get:function(){return n}});let s=t.r(71645);function n(t,e){let i=(0,s.useRef)(null),n=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let t=i.current;t&&(i.current=null,t());let e=n.current;e&&(n.current=null,e())}else t&&(i.current=r(t,s)),e&&(n.current=r(e,s))},[t,e])}function r(t,e){if("function"!=typeof t)return t.current=e,()=>{t.current=null};{let i=t(e);return"function"==typeof i?i:()=>t(null)}}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),e.exports=i.default)},73668,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"isLocalURL",{enumerable:!0,get:function(){return r}});let s=t.r(18967),n=t.r(52817);function r(t){if(!(0,s.isAbsoluteUrl)(t))return!0;try{let e=(0,s.getLocationOrigin)(),i=new URL(t,e);return i.origin===e&&(0,n.hasBasePath)(i.pathname)}catch(t){return!1}}},84508,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"errorOnce",{enumerable:!0,get:function(){return s}});let s=t=>{}},22016,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s={default:function(){return y},useLinkStatus:function(){return w}};for(var n in s)Object.defineProperty(i,n,{enumerable:!0,get:s[n]});let r=t.r(90809),o=t.r(43476),a=r._(t.r(71645)),l=t.r(95057),u=t.r(8372),h=t.r(18581),c=t.r(18967),d=t.r(5550);t.r(33525);let p=t.r(88540),f=t.r(91949),m=t.r(73668),g=t.r(9396);function y(e){var i,s;let n,r,y,[w,b]=(0,a.useOptimistic)(f.IDLE_LINK_STATUS),x=(0,a.useRef)(null),{href:S,as:k,children:T,prefetch:C=null,passHref:A,replace:P,shallow:E,scroll:R,onClick:M,onMouseEnter:V,onTouchStart:O,legacyBehavior:I=!1,onNavigate:L,transitionTypes:j,ref:D,unstable_dynamicOnHover:$,...q}=e;n=T,I&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let F=a.default.useContext(u.AppRouterContext),B=!1!==C,U=!1!==C?null===(s=C)||"auto"===s?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,N="string"==typeof(i=k||S)?i:(0,l.formatUrl)(i);if(I){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>
2` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});r=a.default.Children.only(n)}let _=I?r&&"object"==typeof r&&r.ref:D,Q=a.default.useCallback(t=>(null!==F&&(x.current=(0,f.mountLinkInstance)(t,N,F,U,B,b)),()=>{x.current&&((0,f.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,f.unmountPrefetchableInstance)(t)}),[B,N,F,U,b]),W={ref:(0,h.useMergedRef)(Q,_),onClick(e){I||"function"!=typeof M||M(e),I&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),!F||e.defaultPrevented||function(e,i,s,n,r,o,l){if("u">typeof window){let u,{nodeName:h}=e.currentTarget;if("A"===h.toUpperCase()&&((u=e.currentTarget.getAttribute("target"))&&"_self"!==u||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(i)){n&&(e.preventDefault(),location.replace(i));return}if(e.preventDefault(),o){let t=!1;if(o({preventDefault:()=>{t=!0}}),t)return}let{dispatchNavigateAction:c}=t.r(99781);a.default.startTransition(()=>{c(i,n?"replace":"push",!1===r?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,s.current,l)})}}(e,N,x,P,R,L,j)},onMouseEnter(t){I||"function"!=typeof V||V(t),I&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(t),F&&B&&(0,f.onNavigationIntent)(t.currentTarget,!0===$)},onTouchStart:function(t){I||"function"!=typeof O||O(t),I&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(t),F&&B&&(0,f.onNavigationIntent)(t.currentTarget,!0===$)}};return(0,c.isAbsoluteUrl)(N)?W.href=N:I&&!A&&("a"!==r.type||"href"in r.props)||(W.href=(0,d.addBasePath)(N)),y=I?a.default.cloneElement(r,W):(0,o.jsx)("a",{...q,...W,children:n}),(0,o.jsx)(v.Provider,{value:w,children:y})}t.r(84508);let v=(0,a.createContext)(f.IDLE_LINK_STATUS),w=()=>(0,a.useContext)(v);("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),e.exports=i.default)},83394,t=>{"use strict";t.i(90798);var e=t.i(88218),i=t.i(1737),s=t.i(14001),n=t.i(3697);function r(t,e){if("u"<typeof Convex||void 0===Convex.syscall)throw Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");return JSON.parse(Convex.syscall(t,JSON.stringify(e)))}async function o(t,i){let s;if("u"<typeof Convex||void 0===Convex.asyncSyscall)throw Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");try{s=await Convex.asyncSyscall(t,JSON.stringify(i))}catch(t){if(void 0!==t.data){let i=new n.ConvexError(t.message);throw i.data=(0,e.jsonToConvex)(t.data),i}throw Error(t.message)}return JSON.parse(s)}t.i(2082);var a=t.i(39197);function l(t,e,i,s){if(void 0===t)throw TypeError(`Must provide arg ${e} \`${s}\` to \`${i}\``)}var u=Object.defineProperty,h=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?u(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class c{constructor(){h(this,"_isExpression"),h(this,"_value")}}var d=Object.defineProperty;class p extends c{constructor(t){super(),((t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?d(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i})(this,"inner"),this.inner=t}serialize(){return this.inner}}function f(t){return t instanceof p?t.serialize():{$literal:(0,e.convexOrUndefinedToJson)(t)}}let m={eq:(t,e)=>new p({$eq:[f(t),f(e)]}),neq:(t,e)=>new p({$neq:[f(t),f(e)]}),lt:(t,e)=>new p({$lt:[f(t),f(e)]}),lte:(t,e)=>new p({$lte:[f(t),f(e)]}),gt:(t,e)=>new p({$gt:[f(t),f(e)]}),gte:(t,e)=>new p({$gte:[f(t),f(e)]}),add:(t,e)=>new p({$add:[f(t),f(e)]}),sub:(t,e)=>new p({$sub:[f(t),f(e)]}),mul:(t,e)=>new p({$mul:[f(t),f(e)]}),div:(t,e)=>new p({$div:[f(t),f(e)]}),mod:(t,e)=>new p({$mod:[f(t),f(e)]}),neg:t=>new p({$neg:f(t)}),and:(...t)=>new p({$and:t.map(f)}),or:(...t)=>new p({$or:t.map(f)}),not:t=>new p({$not:f(t)}),field:t=>new p({$field:t})};var g=Object.defineProperty,y=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?g(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};function v(t){throw Error("consumed"===t?"This query is closed and can't emit any more values.":"This query has been chained with another operator and can't be reused.")}class w{constructor(t){y(this,"state"),y(this,"tableNameForErrorMessages"),this.state={type:"preparing",query:t},"FullTableScan"===t.source.type?this.tableNameForErrorMessages=t.source.tableName:this.tableNameForErrorMessages=t.source.indexName.split(".")[0]}takeQuery(){if("preparing"!==this.state.type)throw Error("A query can only be chained once and can't be chained after iteration begins.");let t=this.state.query;return this.state={type:"closed"},t}startQuery(){if("executing"===this.state.type)throw Error("Iteration can only begin on a query once.");("closed"===this.state.type||"consumed"===this.state.type)&&v(this.state.type);let{queryId:t}=r("1.0/queryStream",{query:this.state.query,version:s.version});return this.state={type:"executing",queryId:t},t}closeQuery(){"executing"===this.state.type&&r("1.0/queryCleanup",{queryId:this.state.queryId}),this.state={type:"consumed"}}order(t){l(t,1,"order","order");let e=this.takeQuery();
2if("Search"===e.source.type)throw Error("Search queries must always be in relevance order. Can not set order manually.");if(null!==e.source.order)throw Error("Queries may only specify order at most once");return e.source.order=t,new w(e)}filter(t){l(t,1,"filter","predicate");let e=this.takeQuery();if(e.operators.length>=256)throw Error("Can't construct query with more than 256 operators");return e.operators.push({filter:f(t(m))}),new w(e)}limit(t){l(t,1,"limit","n");let e=this.takeQuery();return e.operators.push({limit:t}),new w(e)}[Symbol.asyncIterator](){return this.startQuery(),this}async next(){("closed"===this.state.type||"consumed"===this.state.type)&&v(this.state.type);let t="preparing"===this.state.type?this.startQuery():this.state.queryId,{value:i,done:s}=await o("1.0/queryStreamNext",{queryId:t});return s&&this.closeQuery(),{value:(0,e.jsonToConvex)(i),done:s}}return(){return this.closeQuery(),Promise.resolve({done:!0,value:void 0})}async paginate(t){if(l(t,1,"paginate","options"),"number"!=typeof t?.numItems||t.numItems<0)throw Error(`\`options.numItems\` must be a positive number. Received \`${t?.numItems}\`.`);let i=this.takeQuery(),n=t.numItems,r=t.cursor,a=t?.endCursor??null,u=t.maximumRowsRead??null,{page:h,isDone:c,continueCursor:d,splitCursor:p,pageStatus:f}=await o("1.0/queryPage",{query:i,cursor:r,endCursor:a,pageSize:n,maximumRowsRead:u,maximumBytesRead:t.maximumBytesRead,version:s.version});return{page:h.map(t=>(0,e.jsonToConvex)(t)),isDone:c,continueCursor:d,splitCursor:p,pageStatus:f}}async collect(){let t=[];for await(let e of this)t.push(e);return t}async take(t){l(t,1,"take","n");if(!Number.isInteger(t)||t<0)throw TypeError("Arg 1 `n` to `take` must be a non-negative integer");return this.limit(t).collect()}async first(){let t=await this.take(1);return 0===t.length?null:t[0]}async unique(){let t=await this.take(2);if(0===t.length)return null;if(2===t.length)throw Error(`unique() query returned more than one result from table ${this.tableNameForErrorMessages}:
3 [${t[0]._id}, ${t[1]._id}, ...]`);return t[0]}}i.v.object({numItems:i.v.number(),cursor:i.v.union(i.v.string(),i.v.null()),endCursor:i.v.optional(i.v.union(i.v.string(),i.v.null())),id:i.v.optional(i.v.number()),maximumRowsRead:i.v.optional(i.v.number()),maximumBytesRead:i.v.optional(i.v.number())});var b=t.i(62849),x=Object.defineProperty,S=Object.defineProperty,k=(t,e,i)=>{let s;return(s="symbol"!=typeof e?e+"":e)in t?S(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i};class T{constructor(t){k(this,"indexes"),k(this,"stagedDbIndexes"),k(this,"searchIndexes"),k(this,"stagedSearchIndexes"),k(this,"vectorIndexes"),k(this,"stagedVectorIndexes"),k(this,"validator"),this.indexes=[],this.stagedDbIndexes=[],this.searchIndexes=[],this.stagedSearchIndexes=[],this.vectorIndexes=[],this.stagedVectorIndexes=[],this.validator=t}" indexes"(){return this.indexes}index(t,e){return Array.isArray(e)?this.indexes.push({indexDescriptor:t,fields:e}):e.staged?this.stagedDbIndexes.push({indexDescriptor:t,fields:e.fields}):this.indexes.push({indexDescriptor:t,fields:e.fields}),this}searchIndex(t,e){return e.staged?this.stagedSearchIndexes.push({indexDescriptor:t,searchField:e.searchField,filterFields:e.filterFields||[]}):this.searchIndexes.push({indexDescriptor:t,searchField:e.searchField,filterFields:e.filterFields||[]}),this}vectorIndex(t,e){return e.staged?this.stagedVectorIndexes.push({indexDescriptor:t,vectorField:e.vectorField,dimensions:e.dimensions,filterFields:e.filterFields||[]}):this.vectorIndexes.push({indexDescriptor:t,vectorField:e.vectorField,dimensions:e.dimensions,filterFields:e.filterFields||[]}),this}self(){return this}export(){let t=this.validator.json;if("object"!=typeof t)throw Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,stagedDbIndexes:this.stagedDbIndexes,searchIndexes:this.searchIndexes,stagedSearchIndexes:this.stagedSearchIndexes,vectorIndexes:this.vectorIndexes,stagedVectorIndexes:this.stagedVectorIndexes,documentType:t}}}function C(t){return new T((0,i.isValidator)(t)?t:i.v.object(t))}new class t{constructor(t,e){k(this,"tables"),k(this,"strictTableNameTypes"),k(this,"schemaValidation"),this.tables=t,this.schemaValidation=e?.schemaValidation===void 0||e.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([t,e])=>{let{indexes:i,stagedDbIndexes:s,searchIndexes:n,stagedSearchIndexes:r,vectorIndexes:o,stagedVectorIndexes:a,documentType:l}=e.export();return{tableName:t,indexes:i,stagedDbIndexes:s,searchIndexes:n,stagedSearchIndexes:r,vectorIndexes:o,stagedVectorIndexes:a,documentType:l}}),schemaValidation:this.schemaValidation})}}({_scheduled_functions:C({name:i.v.string(),args:i.v.array(i.v.any()),scheduledTime:i.v.float64(),completedTime:i.v.optional(i.v.float64()),state:i.v.union(i.v.object({kind:i.v.literal("pending")}),i.v.object({kind:i.v.literal("inProgress")}),i.v.object({kind:i.v.literal("success")}),i.v.object({kind:i.v.literal("failed"),error:i.v.string()}),i.v.object({kind:i.v.literal("canceled")}))}),_storage:C({sha256:i.v.string(),size:i.v.float64(),contentType:i.v.optional(i.v.string())})},void 0);let A=b.anyApi;b.anyApi,function t(e,i){return new Proxy({}
3,{get(s,n){if("string"==typeof n)return t(e,[...i,n]);if(n===a.toReferencePath){if(i.length<1){let t=[e,...i].join(".");throw Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${t}\``)}return"_reference/childComponent/"+i.join("/")}}})}("components",[]),t.s(["api",0,A],83394)},75254,t=>{"use strict";var e=t.i(71645);let i=t=>{let e=t.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,i)=>i?i.toUpperCase():e.toLowerCase());return e.charAt(0).toUpperCase()+e.slice(1)},s=(...t)=>t.filter((t,e,i)=>!!t&&""!==t.trim()&&i.indexOf(t)===e).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,e.forwardRef)(({color:t="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:u,...h},c)=>(0,e.createElement)("svg",{ref:c,...n,width:i,height:i,stroke:t,strokeWidth:o?24*Number(r)/Number(i):r,className:s("lucide",a),...!l&&!(t=>{for(let e in t)if(e.startsWith("aria-")||"role"===e||"title"===e)return!0})(h)&&{"aria-hidden":"true"},...h},[...u.map(([t,i])=>(0,e.createElement)(t,i)),...Array.isArray(l)?l:[l]]));t.s(["default",0,(t,n)=>{let o=(0,e.forwardRef)(({className:o,...a},l)=>(0,e.createElement)(r,{ref:l,iconNode:n,className:s(`lucide-${i(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,o),...a}));return o.displayName=i(t),o}],75254)},46932,31178,37806,21476,47414,74008,64978,72846,t=>{"use strict";let e,i,s,n,r,o=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a=new Set(o),l=(t,e,i)=>i>e?e:i<t?t:i,u={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},h={...u,transform:t=>l(0,1,t)},c={...u,default:1},d=t=>Math.round(1e5*t)/1e5,p=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,f=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,m=(t,e)=>i=>!!("string"==typeof i&&f.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),g=(t,e,i)=>s=>{if("string"!=typeof s)return s;let[n,r,o,a]=s.match(p);return{[t]:parseFloat(n),[e]:parseFloat(r),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},y={...u,transform:t=>Math.round(l(0,255,t))},v={test:m("rgb","red"),parse:g("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+y.transform(t)+", "+y.transform(e)+", "+y.transform(i)+", "+d(h.transform(s))+")"},w={test:m("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:v.transform},b=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),x=b("deg"),S=b("%"),k=b("px"),T=b("vh"),C=b("vw"),A={...S,parse:t=>S.parse(t)/100,transform:t=>S.transform(100*t)},P={test:m("hsl","hue"),parse:g("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+S.transform(d(e))+", "+S.transform(d(i))+", "+d(h.transform(s))+")"},E={test:t=>v.test(t)||w.test(t)||P.test(t),parse:t=>v.test(t)?v.parse(t):P.test(t)?P.parse(t):w.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?v.transform(t):P.transform(t),getAnimatableNone:t=>{let e=E.parse(t);return e.alpha=0,E.transform(e)}},R=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,M="number",V="color",O=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function I(t){let e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[],r=0,o=e.replace(O,t=>(E.test(t)?(s.color.push(r),n.push(V),i.push(E.parse(t))):t.startsWith("var(")?(s.var.push(r),n.push("var"),i.push(t)):(s.number.push(r),n.push(M),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:o,indexes:s,types:n}}function L(t){return I(t).values}function j(t){let{split:e,types:i}=I(t),s=e.length;return t=>{let n="";for(let r=0;r<s;r++)if(n+=e[r],void 0!==t[r]){let e=i[r];e===M?n+=d(t[r]):e===V?n+=E.transform(t[r]):n+=t[r]}return n}}let D=t=>"number"==typeof t?0:E.test(t)?E.getAnimatableNone(t):t,$={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(p)?.length||0)+(t.match(R)?.length||0)>0},parse:L,createTransformer:j,getAnimatableNone:function(t){let e=L(t);return j(t)(e.map(D))}},q=new Set(["brightness","contrast","saturate","opacity"]);function F(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[s]=i.match(p)||[];if(!s)return t;let n=i.replace(s,""),r=+!!q.has(e);return s!==i&&(r*=100),e+"("+r+n+")"}let B=/\b([a-z-]*)\(.*?\)/gu,U={...$,getAnimatableNone:t=>{let e=t.match(B);return e?e.map(F).join(" "):t}},N={...u,transform:Math.round},_={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,rotate:x,rotateX:x,rotateY:x,rotateZ:x,scale:c,scaleX:c,scaleY:c,scaleZ:c,skew:x,skewX:x,skewY:x,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:h,originX:A,originY:A,originZ:k,zIndex:N,fillOpacity:h,strokeOpacity:h,numOctaves:N},Q={..._,color:E,backgroundColor:E,outlineColor:E,fill:E,stroke:E,borderColor:E,borderTopColor:E,borderRightColor:E,borderBottomColor:E,borderLeftColor:E,filter:U,WebkitFilter:U},W=t=>Q[t],z=()=>({translate:0,scale:1,origin:0,originPoint:0}),H=()=>({x:z(),y:z()}),X=()=>({min:0,max:0}),Y=()=>({x:X(),y:X()}),J=t=>!!(t&&t.getVelocity),K=new Set(["width","height","top","left","right","bottom",...o]),G=t=>e=>e.test(t),Z=[u,k,S,x,C,T,{test:t=>"auto"===t,parse:t=>t}],tt=t=>Z.find(G(t));var te,ti=t.i(47167);let ts=()=>{},tn=()=>{};
3ti.default;let tr=t=>e=>"string"==typeof e&&e.startsWith(t),to=tr("--"),ta=tr("var(--"),tl=t=>!!ta(t)&&tu.test(t.split("/*")[0].trim()),tu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function th(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}let tc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,td=t=>180*t/Math.PI,tp=t=>tm(td(Math.atan2(t[1],t[0]))),tf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tp,rotateZ:tp,skewX:t=>td(Math.atan(t[1])),skewY:t=>td(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tm=t=>((t%=360)<0&&(t+=360),t),tg=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ty=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),tv={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tg,scaleY:ty,scale:t=>(tg(t)+ty(t))/2,rotateX:t=>tm(td(Math.atan2(t[6],t[5]))),rotateY:t=>tm(td(Math.atan2(-t[2],t[0]))),rotateZ:tp,rotate:tp,skewX:t=>td(Math.atan(t[4])),skewY:t=>td(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tw(t){return+!!t.includes("scale")}function tb(t,e){let i,s;if(!t||"none"===t)return tw(e);let n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(n)i=tv,s=n;else{let e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=tf,s=e}if(!s)return tw(e);let r=i[e],o=s[1].split(",").map(tx);return"function"==typeof r?r(o):o[r]}function tx(t){return parseFloat(t.trim())}let tS=t=>t===u||t===k,tk=new Set(["x","y","z"]),tT=o.filter(t=>!tk.has(t)),tC={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>tb(e,"x"),y:(t,{transform:e})=>tb(e,"y")};tC.translateX=tC.x,tC.translateY=tC.y;let tA=t=>t,tP={},tE=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tR(t,e){let i=!1,s=!0,n={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=tE.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,s=new Set,n=!1,r=!1,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(h.schedule(e),t()),l++,e(a)}let h={schedule:(t,e=!1,r=!1)=>{let a=r&&n?i:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{if(a=t,n){r=!0;return}n=!0,[i,s]=[s,i],i.forEach(u),e,l=0,i.clear(),n=!1,r&&(r=!1,h.process(t))}};return h}(r,e?i:void 0),t),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:h,update:c,preRender:d,render:p,postRender:f}=o,m=()=>{let r=tP.useManualTiming?n.timestamp:performance.now();i=!1,tP.useManualTiming||(n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),u.process(n),h.process(n),c.process(n),d.process(n),p.process(n),f.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(m))};return{schedule:tE.reduce((e,r)=>{let a=o[r];return e[r]=(e,r=!1,o=!1)=>(!i&&(i=!0,s=!0,n.isProcessing||t(m)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<tE.length;e++)o[tE[e]].cancel(t)},state:n,steps:o}}let{schedule:tM,cancel:tV,state:tO,steps:tI}=tR("u">typeof requestAnimationFrame?requestAnimationFrame:tA,!0),tL=new Set,tj=!1,tD=!1,t$=!1;function tq(){if(tD){let t=Array.from(tL).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e,s=(e=[],tT.forEach(i=>{let s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(+!!i.startsWith("scale")))}),e);s.length&&(i.set(t,s),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}tD=!1,tj=!1,tL.forEach(t=>t.complete(t$)),tL.clear()}function tF(){tL.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tD=!0)})}class tB{constructor(t,e,i,s,n,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(tL.add(this),tj||(tj=!0,tM.read(tF),tM.resolveKeyframes(tq))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;
3if(null===t[0]){let n=s?.get(),r=t[t.length-1];if(void 0!==n)t[0]=n;else if(i&&e){let s=i.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===n&&s.set(t[0])}for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),tL.delete(this)}cancel(){"scheduled"===this.state&&(tL.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function tU(t,e){let i=W(t);return i!==U&&(i=$),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let tN=new Set(["auto","none","0"]);class t_ extends tB{constructor(t,e,i,s,n){super(t,e,i,s,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let s=t[i];if("string"==typeof s&&tl(s=s.trim())){let n=function t(e,i,s=1){tn(s<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,r]=function(t){let e=tc.exec(t);if(!e)return[,];let[,i,s,n]=e;return[`--${i??s}`,n]}(e);if(!n)return;let o=window.getComputedStyle(i).getPropertyValue(n);if(o){let t=o.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t)?parseFloat(t):t}return tl(r)?t(r,i,s+1):r}(s,e.current);void 0!==n&&(t[i]=n),i===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!K.has(i)||2!==t.length)return;let[s,n]=t,r=tt(s),o=tt(n);if(th(s)!==th(n)&&tC[i]){this.needsMeasurement=!0;return}if(r!==o)if(tS(r)&&tS(o))for(let e=0;e<t.length;e++){let i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else tC[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||function(t){if("number"==typeof t)return 0===t;if(null===t)return!0;return"none"===t||"0"===t||/^0[^.\s]+$/u.test(t)}(t[e]))&&i.push(e);i.length&&function(t,e,i){let s,n=0;for(;n<t.length&&!s;){let e=t[n];"string"==typeof e&&!tN.has(e)&&I(e).values.length&&(s=t[n]),n++}if(s&&i)for(let n of e)t[n]=tU(i,s)}(t,i,e)}measureInitialState(){let{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tC[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;let s=e[e.length-1];void 0!==s&&t.getValue(i,s).jump(s,!1)}measureEndState(){let{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;let s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);let n=i.length-1,r=i[n];i[n]=tC[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEac
3h(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let tQ=t=>1e3*t;function tW(t,e){-1===t.indexOf(e)&&t.push(e)}function tz(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}class tH{constructor(){this.subscriptions=[]}add(t){return tW(this.subscriptions,t),()=>tz(this.subscriptions,t)}notify(t,e,i){let s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n<s;n++){let s=this.subscriptions[n];s&&s(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function tX(t){let e;return()=>(void 0===e&&(e=t()),e)}let tY=tX(()=>void 0!==window.ScrollTimeline),tJ=t=>null!==t;function tK(t,{repeat:e,repeatType:i="loop"},s,n=1){let r=t.filter(tJ),o=n<0||e&&"loop"!==i&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}class tG{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}let tZ={layout:0,mainThread:0,waapi:0},t0=t=>Array.isArray(t)&&"number"==typeof t[0],t1={},t2=(r=tX(()=>{try{document.createElement("div").animate({opacity:0}
3,{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),()=>t1.linearEasing??r()),t3=(t,e,i=10)=>{let s="",n=Math.max(Math.round(e/i),2);for(let e=0;e<n;e++)s+=Math.round(1e4*t(e/(n-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},t5=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,t4={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:t5([0,.65,.55,1]),circOut:t5([.55,0,1,.45]),backIn:t5([.31,.01,.66,-.59]),backOut:t5([.33,1.53,.69,.99])};function t6(t){return"function"==typeof t&&"applyToOptions"in t}class t8 extends tG{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:n,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=!!n,this.allowFlatten=r,this.options=t,tn("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return t6(t)&&t2()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,i,{delay:s=0,duration:n=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u){let h={[e]:i};l&&(h.offset=l);let c=function t(e,i){if(e)return"function"==typeof e?t2()?t3(e,i):"ease-out":t0(e)?t5(e):Array.isArray(e)?e.map(e=>t(e,i)||t4.easeOut):t4[e]}(a,n);Array.isArray(c)&&(h.easing=c);let d={delay:s,duration:n,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);let p=t.animate(h,d);return p}(e,i,s,l,n),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let t=tK(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):i.startsWith("--")?e.style.setProperty(i,t):e.style[i]=t,this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tQ(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tY())?(this.animation.timeline=t,tA):e(this)}}let t9=new Set(["opacity","clipPath","filter","transform"]),{schedule:t7}=tR(queueMicrotask,!1);function et(){i=void 0}let ee={now:()=>(void 0===i&&ee.set(tO.isProcessing||tP.useManualTiming?tO.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(et)}};class ei{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{let e=ee.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ee.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new tH);let i=this.events[t].add(e);return"change"===t?()=>{i(),tM.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return e&&e.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=ee.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function es(t,e){return new ei(t,e)}let en=[...Z,E,$],er=new WeakMap;function eo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ea(t){return"string"==typeof t||Array.isArray(t)}let el=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eu=["initial",...el];function eh(t){return eo(t.animate)||eu.some(e=>ea(t[e]))}function ec(t){return!!(eh(t)||t.variants)}let ed={current:null},ep={current:!1},ef="u">typeof window;function em(t){let e=[{},{}];
3return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function eg(t,e,i,s){if("function"==typeof e){let[n,r]=em(s);e=e(void 0!==i?i:t.custom,n,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[n,r]=em(s);e=e(void 0!==i?i:t.custom,n,r)}return e}let ey=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ev={};class ew{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,skipAnimations:n,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=tB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=ee.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,tM.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=n,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=eh(e),this.isVariantNode=ec(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&J(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(let t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,er.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ep.current||function(){if(ep.current=!0,ef)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ed.current=t.matches;t.addEventListener("change",e),e()}else ed.current=!1}(),this.shouldReduceMotion=ed.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let t in this.projection&&this.projection.unmount(),tV(this.notifyUpdate),tV(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){let i;if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&t9.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:s,times:n,ease:r,duration:o}=e.accelerate,a=new t8({element:this.current,name:t,keyframes:s,times:n,ease:r,duration:tQ(o)}),l=i(a);this.valueSubscriptions.set(t,()=>{l(),a.cancel()});return}let s=a.has(t);s&&this.onBindTransform&&this.onBindTransform();let n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tM.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ev){let e=ev[t];if(!e)continue;let{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){let e=this.features[t];
3e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ey.length;e++){let i=ey[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s=t["on"+i];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=function(t,e,i){for(let s in e){let n=e[s],r=i[s];if(J(n))t.addValue(s,n);else if(J(r))t.addValue(s,es(n,{owner:t}));else if(r!==n)if(t.hasValue(s)){let e=t.getValue(s);!0===e.liveStyle?e.jump(n):e.hasAnimated||e.set(n)}else{let e=t.getStaticValue(s);t.addValue(s,es(void 0!==e?e:n,{owner:t}))}}for(let s in i)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=es(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];if(null!=i){let s,n;if("string"==typeof i&&(s=i,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(s)||(n=i,/^0[^.\s]+$/u.test(n))))i=parseFloat(i);else{let s;s=i,!en.find(G(s))&&$.test(e)&&(i=tU(t,e))}this.setBaseTarget(t,J(i)?i.get():i)}return J(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){let e,{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let s=eg(this.props,i,this.presenceContext?.custom);s&&(e=s[t])}if(i&&void 0!==e)return e;let s=this.getBaseTargetFromProps(this.props,t);return void 0===s||J(s)?void 0!==this.initialValues[t]&&void 0===e?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new tH),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){t7.render(this.render)}}class eb extends ew{constructor(){super(...arguments),this.KeyframeResolver=t_}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){let i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;J(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function ex(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}let eS=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ek={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eT=o.length;function eC(t,e,i){let{style:s,vars:n,transformOrigin:r}=t,l=!1,u=!1;for(let t in e){let i=e[t];if(a.has(t)){l=!0;continue}if(to(t)){n[t]=i;continue}{let e=eS(i,_[t]);t.startsWith("origin")?(u=!0,r[t]=e):s[t]=e}}
3if(!e.transform&&(l||i?s.transform=function(t,e,i){let s="",n=!0;for(let r=0;r<eT;r++){let a=o[r],l=t[a];if(void 0===l)continue;let u=!0;if("number"==typeof l)u=l===+!!a.startsWith("scale");else{let t=parseFloat(l);u=a.startsWith("scale")?1===t:0===t}if(!u||i){let t=eS(l,_[a]);if(!u){n=!1;let e=ek[a]||a;s+=`${e}(${t}) `}i&&(e[a]=t)}}return s=s.trim(),i?s=i(e,n?"":s):n&&(s="none"),s}(e,t.transform,i):s.transform&&(s.transform="none")),u){let{originX:t="50%",originY:e="50%",originZ:i=0}=r;s.transformOrigin=`${t} ${e} ${i}`}}let eA={offset:"stroke-dashoffset",array:"stroke-dasharray"},eP={offset:"strokeDashoffset",array:"strokeDasharray"},eE=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eR(t,{attrX:e,attrY:i,attrScale:s,pathLength:n,pathSpacing:r=1,pathOffset:o=0,...a},l,u,h){if(eC(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:c,style:d}=t;for(let t of(c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox),eE))void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==i&&(c.y=i),void 0!==s&&(c.scale=s),void 0!==n&&function(t,e,i=1,s=0,n=!0){t.pathLength=1;let r=n?eA:eP;t[r.offset]=`${-s}`,t[r.array]=`${e} ${i}`}(c,n,r,o,!1)}let eM=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),eV=t=>"string"==typeof t&&"svg"===t.toLowerCase();function eO(t,{style:e,vars:i},s,n){let r,o=t.style;for(r in e)o[r]=e[r];for(r in n?.applyProjectionStyles(o,s),i)o.setProperty(r,i[r])}function eI(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let eL={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t)if(!k.test(t))return t;else t=parseFloat(t);let i=eI(t,e.target.x),s=eI(t,e.target.y);return`${i}% ${s}%`}},ej=(t,e,i)=>t+(e-t)*i,eD={borderRadius:{...eL,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:eL,borderTopRightRadius:eL,borderBottomLeftRadius:eL,borderBottomRightRadius:eL,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let s=$.parse(t);if(s.length>5)return t;let n=$.createTransformer(t),r=+("number"!=typeof s[0]),o=i.x.scale*e.x,a=i.y.scale*e.y;s[0+r]/=o,s[1+r]/=a;let l=ej(o,a,.5);return"number"==typeof s[2+r]&&(s[2+r]/=l),"number"==typeof s[3+r]&&(s[3+r]/=l),n(s)}}};function e$(t,{layout:e,layoutId:i}){return a.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!eD[t]||"opacity"===t)}function eq(t,e,i){let s=t.style,n=e?.style,r={};if(!s)return r;for(let e in s)(J(s[e])||n&&J(n[e])||e$(e,t)||i?.getValue(e)?.liveStyle!==void 0)&&(r[e]=s[e]);return r}function eF(t,e,i){let s=eq(t,e,i);for(let i in t)(J(t[i])||J(e[i]))&&(s[-1!==o.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return s}class eB extends eb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(a.has(e)){let t=W(e);return t&&t.default||0}return e=eM.has(e)?e:ex(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return eF(t,e,i)}build(t,e,i){eR(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,s){for(let i in eO(t,e,void 0,s),e.attrs)t.setAttribute(eM.has(i)?i:ex(i),e.attrs[i])}mount(t){this.isSVGTag=eV(t.tagName),super.mount(t)}}function eU({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function eN(t){return void 0===t||1===t}function e_({scale:t,scaleX:e,scaleY:i}){return!eN(t)||!eN(e)||!eN(i)}function eQ(t){return e_(t)||eW(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eW(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function ez(t,e,i,s,n){return void 0!==n&&(t=s+n*(t-s)),s+i*(t-s)+e}function eH(t,e=0,i=1,s,n){t.min=ez(t.min,e,i,s,n),t.max=ez(t.max,e,i,s,n)}function eX(t,{x:e,y:i}){eH(t.x,e.translate,e.scale,e.originPoint),eH(t.y,i.translate,i.scale,i.originPoint)}function eY(t,e){t.min=t.min+e,t.max=t.max+e}function eJ(t,e,i,s,n=.5){let r=ej(t.min,t.max,n);eH(t,e,i,r,s)}function eK(t,e){eJ(t.x,e.x,e.scaleX,e.scale,e.originX),eJ(t.y,e.y,e.scaleY,e.scale,e.originY)}function eG(t,e){return eU(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}class eZ extends eb{constructor(){super(...arguments),this.type="html",this.renderInstance=eO}readValueFromInstance(t,e){if(a.has(e))return this.projection?.isProjecting?tw(e):((t,e)=>{let{transform:i="none"}=getComputedStyle(t);return tb(i,e)})(t,e);{let i=window.getComputedStyle(t),s=(to(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:e}){return eG(t,e)}build(t,e,i){eC(t,e,i.transformTemplate)}
3scrapeMotionValuesFromProps(t,e,i){return eq(t,e,i)}}var e0=t.i(71645);let e1=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function e2(t){if("string"!=typeof t||t.includes("-"));else if(e1.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}var e3=t.i(43476);let e5=(0,e0.createContext)({});t.s(["LayoutGroupContext",0,e5],31178);let e4=(0,e0.createContext)({strict:!1}),e6=(0,e0.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});t.s(["MotionConfigContext",0,e6],37806);let e8=(0,e0.createContext)({});function e9(t){return Array.isArray(t)?t.join(" "):t}let e7=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function it(t,e,i){for(let s in e)J(e[s])||e$(s,i)||(t[s]=e[s])}let ie=()=>({...e7(),attrs:{}}),ii=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function is(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ii.has(t)}let ir=t=>!is(t);try{te=(()=>{let t=Error("Cannot find module '@emotion/is-prop-valid'");throw t.code="MODULE_NOT_FOUND",t})().default,"function"==typeof te&&(ir=t=>t.startsWith("on")?!is(t):te(t))}catch{}function io(t){return J(t)?t.get():t}let ia=(0,e0.createContext)(null);function il(t){let e=(0,e0.useRef)(null);return null===e.current&&(e.current=t()),e.current}t.s(["PresenceContext",0,ia],21476),t.s(["useConstant",0,il],47414);let iu=t=>(e,i)=>{let s=(0,e0.useContext)(e8),n=(0,e0.useContext)(ia),r=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e},i,s,n){return{latestValues:function(t,e,i,s){let n={},r=s(t,{});for(let t in r)n[t]=io(r[t]);let{initial:o,animate:a}=t,l=eh(t),u=ec(t);e&&u&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let h=!!i&&!1===i.initial,c=(h=h||!1===o)?a:o;if(c&&"boolean"!=typeof c&&!eo(c)){let e=Array.isArray(c)?c:[c];for(let i=0;i<e.length;i++){let s=eg(t,e[i]);if(s){let{transitionEnd:t,transition:e,...i}=s;for(let t in i){let e=i[t];if(Array.isArray(e)){let t=h?e.length-1:0;e=e[t]}null!==e&&(n[t]=e)}for(let e in t)n[e]=t[e]}}}return n}(i,s,n,t),renderState:e()}})(t,e,s,n);return i?r():il(r)},ih=iu({scrapeMotionValuesFromProps:eq,createRenderState:e7}),ic=iu({scrapeMotionValuesFromProps:eF,createRenderState:ie}),id="u">typeof window,ip={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},im=!1;function ig(){return!function(){if(im)return;let t={};for(let e in ip)t[e]={isEnabled:t=>ip[e].some(e=>!!t[e])};ev=t,im=!0}(),ev}let iy=Symbol.for("motionComponentSymbol"),iv="data-"+ex("framerAppearId"),iw=(0,e0.createContext)({});function ib(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}let ix=id?e0.useLayoutEffect:e0.useEffect;function iS(t,{forwardMotionProps:e=!1,type:i}={},s,n){s&&function(t){let e=ig();for(let i in t)e[i]={...e[i],...t[i]};ev=e}(s);let r=i?"svg"===i:e2(t),o=r?ic:ih;function a(i,s){var a;let l,u,h,c={...(0,e0.useContext)(e6),...i,layoutId:function({layoutId:t}){let e=(0,e0.useContext)(e5).id;return e&&void 0!==t?e+"-"+t:t}(i)},{isStatic:d}=c,p=function(t){let{initial:e,animate:i}=function(t,e){if(eh(t)){let{initial:e,animate:i}=t;return{initial:!1===e||ea(e)?e:void 0,animate:ea(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,e0.useContext)(e8));return(0,e0.useMemo)(()=>({initial:e,animate:i}),[e9(e),e9(i)])}(i),f=o(i,d);if(!d&&id){(0,e0.useContext)(e4).strict;let e=function(t){let{drag:e,layout:i}=ig();if(!e&&!i)return{};let s={...e,...i};return{MeasureLayout:e?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}
3(c);l=e.MeasureLayout,p.visualElement=function(t,e,i,s,n,r){let{visualElement:o}=(0,e0.useContext)(e8),a=(0,e0.useContext)(e4),l=(0,e0.useContext)(ia),u=(0,e0.useContext)(e6),h=u.reducedMotion,c=u.skipAnimations,d=(0,e0.useRef)(null),p=(0,e0.useRef)(!1);s=s||a.renderer,!d.current&&s&&(d.current=s(t,{visualState:e,parent:o,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:h,skipAnimations:c,isSVG:r}),p.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let f=d.current,m=(0,e0.useContext)(iw);f&&!f.projection&&n&&("html"===f.type||"svg"===f.type)&&function(t,e,i,s){let{layoutId:n,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:h}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:n,layout:r,alwaysMeasureLayout:!!o||a&&ib(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:l,layoutRoot:u})}(d.current,i,n,m);let g=(0,e0.useRef)(!1);(0,e0.useInsertionEffect)(()=>{f&&g.current&&f.update(i,l)});let y=i[iv],v=(0,e0.useRef)(!!y&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return ix(()=>{p.current=!0,f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),v.current&&f.animationState&&f.animationState.animateChanges())}),(0,e0.useEffect)(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),v.current=!1),f.enteringChildren=void 0)}),f}(t,f,c,n,e.ProjectionNode,r)}return(0,e3.jsxs)(e8.Provider,{value:p,children:[l&&p.visualElement?(0,e3.jsx)(l,{visualElement:p.visualElement,...c}):null,function(t,e,i,{latestValues:s},n,r=!1,o){let a=(o??e2(t)?function(t,e,i,s){let n=(0,e0.useMemo)(()=>{let i=ie();return eR(i,e,eV(s),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};it(e,t.style,t),n.style={...e,...n.style}}return n}:function(t,e){let i,s,n={},r=(i=t.style||{},it(s={},i,t),Object.assign(s,function({transformTemplate:t},e){return(0,e0.useMemo)(()=>{let i=e7();return eC(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),s);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n})(e,s,n,t),l=function(t,e,i){let s={};for(let n in t)("values"!==n||"object"!=typeof t.values)&&(ir(n)||!0===i&&is(n)||!e&&!is(n)||t.draggable&&n.startsWith("onDrag"))&&(s[n]=t[n]);return s}(e,"string"==typeof t,r),u=t!==e0.Fragment?{...l,...a,ref:i}
3:{},{children:h}=e,c=(0,e0.useMemo)(()=>J(h)?h.get():h,[h]);return(0,e0.createElement)(t,{...u,children:c})}(t,i,(a=p.visualElement,u=(0,e0.useRef)(s),(0,e0.useInsertionEffect)(()=>{u.current=s}),h=(0,e0.useRef)(null),(0,e0.useCallback)(t=>{t&&f.onMount?.(t),a&&(t?a.mount(t):a.unmount());let e=u.current;if("function"==typeof e)if(t){let i=e(t);"function"==typeof i&&(h.current=i)}else h.current?(h.current(),h.current=null):e(t);else e&&(e.current=t)},[a])),f,d,e,r)]})}a.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;let l=(0,e0.forwardRef)(a);return l[iy]=t,l}t.s(["useIsomorphicLayoutEffect",0,ix],74008);class ik{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iT(t,e,i){let s=t.getProps();return eg(s,e,void 0!==i?i:s.custom,t)}function iC(t,e){if(t?.inherit&&e){let{inherit:i,...s}=t;return{...e,...s}}return t}function iA(t,e){let i=t?.[e]??t?.default??t;return i!==t?iC(i,t):i}let iP=t=>Array.isArray(t);function iE(t,e){let i=t.getValue("willChange");if(J(i)&&i.add)return i.add(e);if(!i&&tP.WillChange){let i=new tP.WillChange("auto");t.addValue("willChange",i),i.add(e)}}let iR=(t,e)=>i=>e(t(i)),iM=(...t)=>t.reduce(iR);function iV(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function iO(t,e){return i=>i>0?e:t}let iI=(t,e,i)=>{let s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},iL=[w,v,P];function ij(t){let e=iL.find(e=>e.test(t));if(ts(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let i=e.parse(t);return e===P&&(i=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,r=0,o=0;if(e/=100){let s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=iV(a,s,t+1/3),r=iV(a,s,t),o=iV(a,s,t-1/3)}else n=r=o=i;return{red:Math.round(255*n),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(i)),i}let iD=(t,e)=>{let i=ij(t),s=ij(e);if(!i||!s)return iO(t,e);let n={...i};return t=>(n.red=iI(i.red,s.red,t),n.green=iI(i.green,s.green,t),n.blue=iI(i.blue,s.blue,t),n.alpha=ej(i.alpha,s.alpha,t),v.transform(n))},i$=new Set(["none","hidden"]);function iq(t,e){return i=>ej(t,e,i)}function iF(t){return"number"==typeof t?iq:"string"==typeof t?tl(t)?iO:E.test(t)?iD:iN:Array.isArray(t)?iB:"object"==typeof t?E.test(t)?iD:iU:iO}function iB(t,e){let i=[...t],s=i.length,n=t.map((t,i)=>iF(t)(t,e[i]));return t=>{for(let e=0;e<s;e++)i[e]=n[e](t);return i}}function iU(t,e){let i={...t,...e},s={};for(let n in i)void 0!==t[n]&&void 0!==e[n]&&(s[n]=iF(t[n])(t[n],e[n]));return t=>{for(let e in s)i[e]=s[e](t);return i}}let iN=(t,e)=>{let i=$.createTransformer(e),s=I(t),n=I(e);if(!(s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length))return ts(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),iO(t,e);if(i$.has(t)&&!n.values.length||i$.has(e)&&!s.values.length)return i$.has(t)?i=>i<=0?t:e:i=>i>=1?e:t;return iM(iB(function(t,e){let i=[],s={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){let r=e.types[n],o=t.indexes[r][s[r]],a=t.values[o]??0;i[n]=a,s[r]++}return i}(s,n),n.values),i)};function i_(t,e,i){return"number"==typeof t&&"number"==typeof e&&"number"==typeof i?ej(t,e,i):iF(t)(t,e)}let iQ=t=>{let e=({timestamp:e})=>t(e);return{start:(t=!0)=>tM.update(e,t),stop:()=>tV(e),now:()=>tO.isProcessing?tO.timestamp:ee.now()}};function iW(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}function iz(t,e,i){var s,n;let r=Math.max(e-5,0);return s=i-t(r),(n=e-r)?1e3/n*s:0}let iH=.01,iX=2,iY=.005,iJ=.5;function iK(t,e){return t*Math.sqrt(1-e*e)}let iG=["duration","bounce"],iZ=["stiffness","damping","mass"];function i0(t,e){return e.some(e=>void 0!==t[e])}function i1(t=.3,e=.3){let i,s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:n,restDelta:r}=s,o=s.keyframes[0],a=s.keyframes[s.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:c,mass:d,duration:p,velocity:f,isResolvedFromDuration:m}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!i0(t,iZ)&&i0(t,iG))if(t.visualDuration){let i=2*Math.PI/(1.2*t.visualDuration),s=i*i,n=2*l(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:1,stiffness:s,damping:n}}else{let i=function({duration:t=800,bounce:e=.3,velocity:i=0,mass:s=1}){let n,r;ts(t<=tQ(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=l(.05,1,o),t=l(.01,10,t/1e3),o<1?(n=e=>{let s=e*o,n=s*t;return .001-(s-i)/iK(e,o)*Math.exp(-n)},r=e=>{let s=e*o*t,r=Math.pow(o,2)*Math.pow(e,2)*t,a=Math.exp(-s),l=iK(Math.pow(e,2),o);return(s*i+i-r)*a*(-n(e)+.001>0?-1:1)/l}):(n=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));
3let a=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(n,r,5/t);if(t=tQ(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}(t);(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...s,velocity:-((s.velocity||0)/1e3)}),g=f||0,y=c/(2*Math.sqrt(h*d)),v=a-o,w=Math.sqrt(h/d)/1e3,b=5>Math.abs(v);if(n||(n=b?iH:iX),r||(r=b?iY:iJ),y<1){let t=iK(w,y);i=e=>a-Math.exp(-y*w*e)*((g+y*w*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}else if(1===y)i=t=>a-Math.exp(-w*t)*(v+(g+w*v)*t);else{let t=w*Math.sqrt(y*y-1);i=e=>{let i=Math.exp(-y*w*e),s=Math.min(t*e,300);return a-i*((g+y*w*v)*Math.sinh(s)+t*v*Math.cosh(s))/t}}let x={calculatedDuration:m&&p||null,next:t=>{let e=i(t);if(m)u.done=t>=p;else{let s=0===t?g:0;y<1&&(s=0===t?tQ(g):iz(i,t,e));let o=Math.abs(a-e)<=r;u.done=Math.abs(s)<=n&&o}return u.value=u.done?a:e,u},toString:()=>{let t=Math.min(iW(x),2e4),e=t3(e=>x.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return x}function i2({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:h}){let c,d,p=t[0],f={done:!1,value:p},m=i*e,g=p+m,y=void 0===o?g:o(g);y!==g&&(m=y-p);let v=t=>-m*Math.exp(-t/s),w=t=>y+v(t),b=t=>{let e=v(t),i=w(t);f.done=Math.abs(e)<=u,f.value=f.done?y:i},x=t=>{let e;if(e=f.value,void 0!==a&&e<a||void 0!==l&&e>l){var i;c=t,d=i1({keyframes:[f.value,(i=f.value,void 0===a?l:void 0===l||Math.abs(a-i)<Math.abs(l-i)?a:l)],velocity:iz(w,t,f.value),damping:n,stiffness:r,restDelta:u,restSpeed:h})}};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return(d||void 0!==c||(e=!0,b(t),x(t)),void 0!==c&&t>=c)?d.next(t-c):(e||b(t),f)}}}i1.applyToOptions=t=>{let e=function(t,e=100,i){let s=i({...t,keyframes:[0,e]}),n=Math.min(iW(s),2e4);return{type:"keyframes",ease:t=>s.next(n*t).value/e,duration:n/1e3}}(t,100,i1);return t.ease=e.ease,t.duration=tQ(e.duration),t.type="keyframes",t};let i3=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function i5(t,e,i,s){return t===e&&i===s?tA:n=>0===n||1===n?n:i3(function(t,e,i,s,n){let r,o,a=0;do(r=i3(o=e+(i-e)/2,s,n)-t)>0?i=o:e=o;while(Math.abs(r)>1e-7&&++a<12)return o}(n,0,1,t,i),e,s)}let i4=i5(.42,0,1,1),i6=i5(0,0,.58,1),i8=i5(.42,0,.58,1),i9=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,i7=t=>e=>1-t(1-e),st=i5(.33,1.53,.69,.99),se=i7(st),si=i9(se),ss=t=>(t*=2)<1?.5*se(t):.5*(2-Math.pow(2,-10*(t-1))),sn=t=>1-Math.sin(Math.acos(t)),sr=i7(sn),so=i9(sn),sa={linear:tA,easeIn:i4,easeInOut:i8,easeOut:i6,circIn:sn,circInOut:so,circOut:sr,backIn:se,backInOut:si,backOut:st,anticipate:ss},sl=t=>{if(t0(t)){tn(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,i,s,n]=t;return i5(e,i,s,n)}return"string"==typeof t?(tn(void 0!==sa[t],`Invalid easing type '${t}'`,"invalid-easing-type"),sa[t]):t},su=(t,e,i)=>{let s=e-t;return 0===s?1:(i-t)/s};function sh({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){var n;let r,o=Array.isArray(s)&&"number"!=typeof s[0]?s.map(sl):sl(s),a={done:!1,value:e[0]},u=function(t,e,{clamp:i=!0,ease:s,mixer:n}={}){let r=t.length;if(tn(r===e.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];let o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=function(t,e,i){let s=[],n=i||tP.mix||i_,r=t.length-1;for(let i=0;i<r;i++){let r=n(t[i],t[i+1]);e&&(r=iM(Array.isArray(e)?e[i]||tA:e,r)),s.push(r)}return s}(e,s,n),u=a.length,h=i=>{if(o&&i<t[0])return e[0];let s=0;if(u>1)for(;s<t.length-2&&!(i<t[s+1]);s++);let n=su(t[s],t[s+1],i);return a[s](n)};return i?e=>h(l(t[0],t[r-1],e)):h}((n=i&&i.length===e.length?i:(!function(t,e){let i=t[t.length-1];for(let s=1;s<=e;s++){let n=su(0,e,s);t.push(ej(i,1,n))}}(r=[0],e.length-1),r),n.map(e=>e*t)),e,{ease:Array.isArray(o)?o:e.map(()=>o||i8).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(a.value=u(e),a.done=e>=t,a)}}let sc={decay:i2,inertia:i2,tween:sh,keyframes:sh,spring:i1};function sd(t){"string"==typeof t.type&&(t.type=sc[t.type])}let sp=t=>t/100;class sf extends tG{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==ee.now()&&this.tick(ee.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},tZ.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){let{options:t}=this;sd(t);let{type:e=sh,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:r=0}=t,{keyframes:o}=t,a=e||sh;a!==sh&&"number"!=typeof o[0]&&(this.mixKeyframes=iM(sp,i_(o[0],o[1])),o=[0,100]);let l=a({...t,keyframes:o});"mirror"===n&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=iW(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l}updateTime(t){let e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);let{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);let y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let w=this.currentTime,b=i;if(c){let t=Math.min(this.currentTime,s)/o,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,c+1))%2&&("reverse"===d?(i=1-i,p&&(i-=p/o)):"mirror"===d&&(b=r)),w=l(0,1,i)*o}let x=v?{done:!1,value:h[0]}:b.next(w);n&&(x.value=n(x.value));let{done:S}=x;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return k&&f!==i2&&(x.value=tK(h,this.options,g,this.speed)),m&&m(x.value),k&&this.finish(),x}
3then(t,e){return this.finished.then(t,e)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return this.currentTime/1e3}set time(t){t=tQ(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ee.now());let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:t=iQ,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();let i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ee.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,tZ.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}let sm={anticipate:ss,backInOut:si,circInOut:so};class sg extends t8{constructor(t){!function(t){"string"==typeof t.ease&&t.ease in sm&&(t.ease=sm[t.ease])}(t),sd(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:e,onUpdate:i,onComplete:s,element:n,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);let o=new sf({...r,autoplay:!1}),a=Math.max(10,ee.now()-this.startTime),u=l(0,10,a-10);e.setWithVelocity(o.sample(Math.max(0,a-u)).value,o.sample(a).value,u),o.stop()}}let sy=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&($.test(t)||"0"===t)&&!t.startsWith("url("));function sv(t){t.duration=0,t.type="keyframes"}let sw=new Set(["opacity","clipPath","filter","transform"]),sb=tX(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class sx extends tG{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ee.now();const c={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:r,name:a,motionValue:l,element:u,...h},d=u?.KeyframeResolver||tB;this.keyframeResolver=new d(o,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,s){this.keyframeResolver=void 0;let{name:n,type:r,velocity:o,delay:a,isHandoff:l,onUpdate:u}=i;this.resolvedAt=ee.now(),!function(t,e,i,s){let n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],o=sy(n,e),a=sy(r,e);return ts(o===a,`You are trying to animate ${e} from "${n}" to "${r}". "${o?r:n}" is not an animatable value.`,"value-not-animatable"),!!o&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||t6(i))&&s)}(t,n,r,o)&&((tP.instantAnimations||!a)&&u?.(tK(t,i,e)),t[0]=t[t.length-1],sv(i),i.repeat=0);let h={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},c=!l&&function(t){let{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;
3let{onUpdate:a,transformTemplate:l}=e.owner.getProps();return sb()&&i&&sw.has(i)&&("transform"!==i||!l)&&!a&&!s&&"mirror"!==n&&0!==r&&"inertia"!==o}(h),d=h.motionValue?.owner?.current,p=c?new sg({...h,element:d}):new sf(h);p.finished.then(()=>{this.notifyFinished()}).catch(tA),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),t$=!0,tF(),tq(),t$=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let sS={type:"spring",stiffness:500,damping:25,restSpeed:10},sk={type:"keyframes",duration:.8},sT={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sC=t=>null!==t,sA=(t,e,i,s={},n,r)=>o=>{let l=iA(s,t)||{},u=l.delay||s.delay||0,{elapsed:h=0}=s;h-=tQ(u);let c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:n};!function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:n,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length}(l)&&Object.assign(c,((t,{keyframes:e})=>e.length>2?sk:a.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:sS:sT)(t,c)),c.duration&&(c.duration=tQ(c.duration)),c.repeatDelay&&(c.repeatDelay=tQ(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if(!1!==c.type&&(0!==c.duration||c.repeatDelay)||(sv(c),0===c.delay&&(d=!0)),(tP.instantAnimations||tP.skipAnimations||n?.shouldSkipAnimations)&&(d=!0,sv(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){let t=function(t,{repeat:e,repeatType:i="loop"}){let s=t.filter(sC),n=e&&"loop"!==i&&e%2==1?0:s.length-1;return s[n]}(c.keyframes,l);if(void 0!==t)return void tM.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new sf(c):new sx(c)};function sP(t,e,{delay:i=0,transitionOverride:s,type:n}={}){let{transition:r,transitionEnd:o,...a}=e,l=t.getDefaultTransition();r=r?iC(r,l):l;let u=r?.reduceMotion;s&&(r=s);let h=[],c=n&&t.animationState&&t.animationState.getState()[n];for(let e in a){let s=t.getValue(e,t.latestValues[e]??null),n=a[e];if(void 0===n||c&&function({protectedKeys:t,needsAnimating:e},i){let s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}(c,e))continue;let o={delay:i,...iA(r||{},e)},l=s.get();if(void 0!==l&&!s.isAnimating&&!Array.isArray(n)&&n===l&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let i=t.props[iv];if(i){let t=window.MotionHandoffAnimation(i,e,tM);null!==t&&(o.startTime=t,d=!0)}}iE(t,e);let p=u??t.shouldReduceMotion;s.start(sA(e,s,n,p&&K.has(e)?{type:!1}:o,t,d));let f=s.animation;f&&h.push(f)}if(o){let e=()=>tM.update(()=>{o&&function(t,e){let{transitionEnd:i={},transition:s={},...n}=iT(t,e)||{};for(let e in n={...n,...i}){var r;let i=iP(r=n[e])?r[r.length-1]||0:r;t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,es(i))}}(t,o)});h.length?Promise.all(h).then(e):e()}return h}function sE(t,e,i,s=0,n=1){let r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*s;return"function"==typeof i?i(r,o):1===n?r*s:a-r*s}function sR(t,e,i={}){let s=iT(t,e,"exit"===i.type?t.presenceContext?.custom:void 0),{transition:n=t.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(n=i.transitionOverride);let r=s?()=>Promise.all(sP(t,s,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{let{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=n;
3return function(t,e,i=0,s=0,n=0,r=1,o){let a=[];for(let l of t.variantChildren)l.notify("AnimationStart",e),a.push(sR(l,e,{...o,delay:i+("function"==typeof s?0:s)+sE(t.variantChildren,l,s,n,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,s,r,o,a,i)}:()=>Promise.resolve(),{when:a}=n;if(!a)return Promise.all([r(),o(i.delay)]);{let[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}}let sM=eu.length;function sV(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let s=0;s<i;s++)if(e[s]!==t[s])return!1;return!0}let sO=[...el].reverse(),sI=el.length;function sL(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sj(){return{animate:sL(!0),whileInView:sL(),whileHover:sL(),whileTap:sL(),whileDrag:sL(),whileFocus:sL(),exit:sL()}}let sD=0;function s$(t){return[t("x"),t("y")]}let sq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),sF=new Set(["INPUT","SELECT","TEXTAREA"]);function sB(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}let sU={x:!1,y:!1};function sN(t){return t.max-t.min}function s_(t,e,i,s=.5){t.origin=s,t.originPoint=ej(e.min,e.max,t.origin),t.scale=sN(i)/sN(e),t.translate=ej(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function sQ(t,e,i,s){s_(t.x,e.x,i.x,s?s.originX:void 0),s_(t.y,e.y,i.y,s?s.originY:void 0)}function sW(t,e,i){t.min=i.min+e.min,t.max=t.min+sN(e)}function sz(t,e,i){t.min=e.min-i.min,t.max=t.min+sN(e)}function sH(t,e,i){sz(t.x,e.x,i.x),sz(t.y,e.y,i.y)}function sX(t){return"object"==typeof t&&null!==t}function sY(t){return sX(t)&&"ownerSVGElement"in t}function sJ(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);let n=i?.[t]??s.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}let sK=new WeakMap,sG=(t,e,i)=>(s,n)=>n&&n[0]?n[0][t+"Size"]:sY(s)&&"getBBox"in s?s.getBBox()[e]:s[i],sZ=sG("inline","width","offsetWidth"),s0=sG("block","height","offsetHeight");function s1({target:t,borderBoxSize:e}){sK.get(t)?.forEach(i=>{i(t,{get width(){return sZ(t,e)},get height(){return s0(t,e)}})})}function s2(t){t.forEach(s1)}let s3=new Set;function s5(t,e){let i;return"function"==typeof t?(s3.add(t),n||(n=()=>{let t={get width(){return window.innerWidth},get height(){return window.innerHeight}};s3.forEach(e=>e(t))},window.addEventListener("resize",n)),()=>{s3.delete(t),s3.size||"function"!=typeof n||(window.removeEventListener("resize",n),n=void 0)}):(!s&&"u">typeof ResizeObserver&&(s=new ResizeObserver(s2)),(i=sJ(t)).forEach(t=>{let i=sK.get(t);i||(i=new Set,sK.set(t,i)),i.add(e),s?.observe(t)}),()=>{i.forEach(t=>{let i=sK.get(t);i?.delete(e),i?.size||s?.unobserve(t)})})}let s4=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function s6(t){return{point:{x:t.pageX,y:t.pageY}}}function s8(t,e,i,s){return sB(t,e,t=>s4(t)&&i(t,s6(t)),s)}let s9=({current:t})=>t?t.ownerDocument.defaultView:null,s7=(t,e)=>Math.abs(t-e),nt=new Set(["auto","scroll"]);class ne{constructor(t,e,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:n=!1,distanceThreshold:r=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=nn(this.lastMoveEventInfo,this.history),s=null!==this.startEvent,n=(t=i.offset,e={x:0,y:0},Math.sqrt(s7(t.x,e.x)**2+s7(t.y,e.y)**2)>=this.distanceThreshold);if(!s&&!n)return;let{point:r}=i,{timestamp:o}=tO;this.history.push({...r,timestamp:o});let{onStart:a,onMove:l}=this.handlers;s||(a&&a(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=ni(e,this.transformPagePoint),tM.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&n&&n(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=nn("pointercancel"===t.type?this.lastMoveEventInfo:ni(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),s&&s(t,r)},!s4(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const a=ni(s6(t),this.transformPagePoint),{point:l}=a,{timestamp:u}=tO;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=e;h&&h(t,nn(a,this.history)),this.removeListeners=iM(s8(this.contextWindow,"pointermove",this.handlePointerMove),s8(this.contextWindow,"pointerup",this.handlePointerUp),s8(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(t){let e=t.parentElement;for(;e;){let t=getComputedStyle(e);(nt.has(t.overflowX)||nt.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let e=this.scrollPositions.get(t);if(!e)return;let i=t===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},n={x:s.x-e.x,y:s.y-e.y};(0!==n.x||0!==n.y)&&(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=n.x,this.lastMoveEventInfo.point.y+=n.y):this.history.length>0&&(this.history[0].x-=n.x,this.history[0].y-=n.y),this.scrollPositions.set(t,s),tM.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tV(this.updatePoint)}}function ni(t,e){return e?{point:e(t.point)}:t}function ns(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:ns(t,nr(e)),offset:ns(t,e[0]),velocity:function(t){if(t.length<2)return{x:0,y:0};
3let e=t.length-1,i=null,s=nr(t);for(;e>=0&&(i=t[e],!(s.timestamp-i.timestamp>tQ(.1)));)e--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*tQ(.1)&&(i=t[1]);let n=(s.timestamp-i.timestamp)/1e3;if(0===n)return{x:0,y:0};let r={x:(s.x-i.x)/n,y:(s.y-i.y)/n};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(e)}}function nr(t){return t[t.length-1]}function no(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function na(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}function nl(t,e,i){return{min:nu(t,e),max:nu(t,i)}}function nu(t,e){return"number"==typeof t?t:t[e]||0}let nh=new WeakMap;class nc{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Y(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){let{presenceContext:s}=this.visualElement;if(s&&!1===s.isPresent)return;let n=t=>{e&&this.snapToCursor(s6(t).point),this.stopAnimation()},r=(t,e)=>{let{drag:i,dragPropagation:s,onDragStart:n}=this.getProps();if(i&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(t){if("x"===t||"y"===t)if(sU[t])return null;else return sU[t]=!0,()=>{sU[t]=!1};return sU.x||sU.y?null:(sU.x=sU.y=!0,()=>{sU.x=sU.y=!1})}(i),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),s$(t=>{let e=this.getAxisMotionValue(t).get()||0;if(S.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let s=i.layout.layoutBox[t];s&&(e=sN(s)*(parseFloat(e)/100))}}this.originPoint[t]=e}),n&&tM.update(()=>n(t,e),!1,!0),iE(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},o=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;let{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:r}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:o}=e;if(s&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&n&&n(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&tM.update(()=>r(t,e),!1,!0)},a=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new ne(t,{onSessionStart:n,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:s9(this.visualElement),element:this.visualElement.current})}stop(t,e){let i=t||this.latestPointerEvent,s=e||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!s||!i)return;let{velocity:r}=s;this.startAnimation(r);let{onDragEnd:o}=this.getProps();o&&tM.postRender(()=>o(i,s))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){let{drag:s}=this.getProps();if(!i||!np(t,s,this.currentDirection))return;let n=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?ej(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?ej(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){let{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&ib(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=function(t,{top:e,left:i,bottom:s,right:n}){return{x:no(t.x,i,n),y:no(t.y,e,s)}}(i.layoutBox,t):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:nl(t,"left","right"),y:nl(t,"top","bottom")}}(e),s!==this.constraints&&!ib(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&s$(t=>{var e,s;let n;!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=(e=i.layoutBox[t],s=this.constraints[t],n={},void 0!==s.min&&(n.min=s.min-e.min),void 0!==s.max&&(n.max=s.max-e.min),n))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!ib(e))return!1;let s=e.current;tn(null!==s,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;
3let r=function(t,e,i){let s=eG(t,i),{scroll:n}=e;return n&&(eY(s.x,n.offset.x),eY(s.y,n.offset.y)),s}(s,n.root,this.visualElement.getTransformPagePoint()),o=(t=n.layout.layoutBox,{x:na(t.x,r.x),y:na(t.y,r.y)});if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=eU(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(s$(o=>{if(!np(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});let u={type:"inertia",velocity:i?t[o]:0,bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(o,u)})).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return iE(this.visualElement,t),i.start(sA(t,i,0,e,this.visualElement,!1))}stopAnimation(){s$(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){s$(e=>{let{drag:i}=this.getProps();if(!np(e,i,this.currentDirection))return;let{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){let{min:i,max:r}=s.layout.layoutBox[e],o=n.get()||0;n.set(t[e]-ej(i,r,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!ib(e)||!i||!this.constraints)return;this.stopAnimation();let s={x:0,y:0};s$(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){var i,n;let r,o,a,u=e.get();s[t]=(i={min:u,max:u},n=this.constraints[t],r=.5,o=sN(i),(a=sN(n))>o?r=su(n.min,n.max-o,i.min):o>a&&(r=su(i.min,i.max-a,n.min)),l(0,1,r))}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),s$(e=>{if(!np(e,t,null))return;let i=this.getAxisMotionValue(e),{min:n,max:r}=this.constraints[e];i.set(ej(n,r,s[e]))}),this.visualElement.render()}addListeners(){let t;if(!this.visualElement.current)return;nh.set(this.visualElement,this);let e=this.visualElement.current,i=s8(e,"pointerdown",t=>{let{drag:i,dragListener:s=!0}=this.getProps(),n=t.target,r=n!==e&&(sF.has(n.tagName)||!0===n.isContentEditable);i&&s&&!r&&this.start(t)}),s=()=>{var i,s,n;let r,o,{dragConstraints:a}=this.getProps();ib(a)&&a.current&&(this.constraints=this.resolveRefConstraints(),t||(i=e,s=a.current,r=s5(i,nd(n=()=>this.scalePositionWithinConstraints())),o=s5(s,nd(n)),t=()=>{r(),o()}))},{projection:n}=this.visualElement,r=n.addEventListener("measure",s);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),tM.read(s);let o=sB(window,"resize",()=>this.scalePositionWithinConstraints()),a=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(s$(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),i(),r(),a&&a(),t&&t()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:r=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:r,dragMomentum:o}}}function nd(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function np(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}let nf=t=>(e,i)=>{t&&tM.update(()=>t(e,i),!1,!0)},nm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var ng=e0;function ny(t=!0){let e=(0,e0.useContext)(ia);if(null===e)return[!0,null];let{isPresent:i,onExitComplete:s,register:n}=e,r=(0,e0.useId)();(0,e0.useEffect)(()=>{if(t)return n(r)},[t]);let o=(0,e0.useCallback)(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,o]:[!0]}t.s(["usePresence",0,ny],64978);let nv=!1;class nw extends ng.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),nv&&n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),nm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:s,isPresent:n}=this.props,{projection:r}=i;return r&&(r.isPresent=n,t.layoutDependency!==e&&r.setOptions({...r.options,layoutDependency:e}),nv=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==n?r.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?r.promote():r.relegate()||tM.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),t7.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;nv=!0,s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nb(t){let[e,i]=ny(),s=(0,ng.useContext)(e5);return(0,e3.jsx)(nw,{...t,layoutGroup:s,switchLayoutGroup:(0,ng.useContext)(iw),isPresent:e,safeToRemove:i})}let nx=["TopLeft","TopRight","BottomLeft","BottomRight"],nS=nx.length,nk=t=>"string"==typeof t?parseFloat(t):t,nT=t=>"number"==typeof t||k.test(t);function nC(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let nA=nE(0,.5,sr),nP=nE(.5,.95,tA);
3function nE(t,e,i){return s=>s<t?0:s>e?1:i(su(t,e,s))}function nR(t,e){t.min=e.min,t.max=e.max}function nM(t,e){nR(t.x,e.x),nR(t.y,e.y)}function nV(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function nO(t,e,i,s,n){return t-=e,t=s+1/i*(t-s),void 0!==n&&(t=s+1/n*(t-s)),t}function nI(t,e,[i,s,n],r,o){!function(t,e=0,i=1,s=.5,n,r=t,o=t){if(S.test(e)&&(e=parseFloat(e),e=ej(o.min,o.max,e/100)-o.min),"number"!=typeof e)return;let a=ej(r.min,r.max,s);t===r&&(a-=e),t.min=nO(t.min,e,i,a,n),t.max=nO(t.max,e,i,a,n)}(t,e[i],e[s],e[n],e.scale,r,o)}let nL=["x","scaleX","originX"],nj=["y","scaleY","originY"];function nD(t,e,i,s){nI(t.x,e,nL,i?i.x:void 0,s?s.x:void 0),nI(t.y,e,nj,i?i.y:void 0,s?s.y:void 0)}function n$(t){return 0===t.translate&&1===t.scale}function nq(t){return n$(t.x)&&n$(t.y)}function nF(t,e){return t.min===e.min&&t.max===e.max}function nB(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function nU(t,e){return nB(t.x,e.x)&&nB(t.y,e.y)}function nN(t){return sN(t.x)/sN(t.y)}function n_(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class nQ{constructor(){this.members=[]}add(t){tW(this.members,t);for(let e=this.members.length-1;e>=0;e--){let i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;let s=i.instance;s&&!1===s.isConnected&&!1!==i.isPresent&&!i.snapshot&&tz(this.members,i)}t.scheduleRender()}remove(t){if(tz(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e,i=this.members.findIndex(e=>t===e);if(0===i)return!1;for(let t=i;t>=0;t--){let i=this.members[t],s=i.instance;if(!1!==i.isPresent&&(!s||!1!==s.isConnected)){e=i;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender();let s=i.options.layoutDependency,n=t.options.layoutDependency;if(void 0===s||void 0===n||s!==n){let s=i.instance;!(s&&!1===s.isConnected&&!i.snapshot)&&(t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}let{crossfade:r}=t.options;!1===r&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nW=(t,e)=>t.depth-e.depth;class nz{constructor(){this.children=[],this.isDirty=!1}add(t){tW(this.children,t),this.isDirty=!0}remove(t){tz(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(nW),this.isDirty=!1,this.children.forEach(t)}}let nH=["","X","Y","Z"],nX=0;function nY(t,e,i,s){let{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function nJ({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:n}){return class{constructor(t={},i=e?.()){this.id=nX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nZ),this.nodes.forEach(n6),this.nodes.forEach(n8),this.nodes.forEach(n0)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new nz)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tH),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){let i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=sY(e)&&!(sY(e)&&"svg"===e.tagName),this.instance=e;let{layoutId:i,layout:s,visualElement:n}=this.options;if(n&&!n.current&&n.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let i,s=0,n=()=>this.root.updateBlockedByResize=!1;tM.read(()=>{s=window.innerWidth}),t(e,()=>{let t=window.innerWidth;if(t!==s){let e,r;s=t,this.root.updateBlockedByResize=!0,i&&i(),e=ee.now(),r=({timestamp:t})=>{let i=t-e;i>=250&&(tV(r),n(i-250))},tM.setup(r,!0),i=()=>tV(r),nm.hasAnimatedSinceResize&&(nm.hasAnimatedSinceResize=!1,this.nodes.forEac
3h(n4))}})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&n&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||n.getDefaultTransition()||rs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!nU(this.targetLayout,s),u=!e&&i;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...iA(r,"layout"),onPlay:o,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,u)}else e||n4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tV(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(n9),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let s=i.props[iv];if(window.MotionHasOptimisedAnimation(s,"transform")){let{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",tM,!(t||i))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&t(n)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;let s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(n2);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(n3);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(n5),this.nodes.forEach(nK),this.nodes.forEach(nG)):this.nodes.forEach(n3),this.clearAllSnapshots();let t=ee.now();tO.delta=l(0,1e3/60,t-tO.timestamp),tO.timestamp=t,tO.isProcessing=!0,tI.update.process(tO),tI.preRender.process(tO),tI.render.process(tO),tO.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,t7.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(n1),this.sharedNodes.forEach(n7)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tM.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tM.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||sN(this.snapshot.measuredBox.x)||sN(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();let t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){let e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!n)return;let t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!nq(this.projectionDelta),i=this.getTransformTemplate(),s=i?i(this.latestValues,""):void 0,r=s!==this.prevTransformTemplateValue;t&&this.instance&&(e||eQ(this.latestValues)||r)&&(n(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){var e;let i=this.measurePageBox(),s=this.removeElementScroll(i);return t&&(s=this.removeTransform(s)),ro((e=s).x),ro(e.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:t}=this.options;if(!t)return Y();let e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rl))){let{scroll:t}=this.root;t&&(eY(e.x,t.offset.x),eY(e.y,t.offset.y))}return e}removeElementScroll(t){let e=Y();if(nM(e,t),this.scroll?.wasRoot)return e;for(let i=0;i<this.path.length;i++){let s=this.path[i],{scroll:n,options:r}=s;s!==this.root&&n&&r.layoutScroll&&(n.wasRoot&&nM(e,t),eY(e.x,n.offset.x),eY(e.y,n.offset.y))}return e}applyTransform(t,e=!1){let i=Y();nM(i,t);for(let t=0;t<this.path.length;t++){let s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&eK(i,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),eQ(s.latestValues)&&eK(i,s.latestValues)}return eQ(this.latestValues)&&eK(i,this.latestValues),i}removeTransform(t){let e=Y();nM(e,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];if(!i.instance||!eQ(i.latestValues))continue;e_(i.latestValues)&&i.updateSnapshot();let s=Y();nM(s,i.measurePageBox()),nD(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,s)}return eQ(this.latestValues)&&nD(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tO.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){let e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);let i=!!this.resumingFrom||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:s,layoutId:n}=this.options;if(!this.layout||!(s||n))return;this.resolvedRelativeTargetAt=tO.timestamp;let r=this.getClosestProjectingParent();if(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var o,a,l;this.forceRelativeParentToResolveTarget(),o=this.target,a=this.relativeTarget,l=this.relativeParent.target,sW(o.x,a.x,l.x),sW(o.y,a.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nM(this.target,this.layout.layoutBox),eX(this.target,this.targetDelta)):nM(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,r&&!!r.resumingFrom==!!this.resumingFrom&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||e_(this.parent.latestValues)||eW(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,i){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),sH(this.relativeTargetOrigin,e,i),nM(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let t=this.getLead(),e=!!this.resumingFrom||this!==t,i=!0;
3if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===tO.timestamp&&(i=!1),i)return;let{layout:s,layoutId:n}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(s||n))return;nM(this.layoutCorrected,this.layout.layoutBox);let r=this.treeScale.x,o=this.treeScale.y;!function(t,e,i,s=!1){let n,r,o=i.length;if(o){e.x=e.y=1;for(let a=0;a<o;a++){r=(n=i[a]).projectionDelta;let{visualElement:o}=n.options;(!o||!o.props.style||"contents"!==o.props.style.display)&&(s&&n.options.layoutScroll&&n.scroll&&n!==n.root&&eK(t,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,eX(t,r)),s&&eQ(n.latestValues)&&eK(t,n.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,e),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=Y());let{target:a}=t;if(!a){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nV(this.prevProjectionDelta.x,this.projectionDelta.x),nV(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),sQ(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&n_(this.projectionDelta.x,this.prevProjectionDelta.x)&&n_(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=H(),this.projectionDelta=H(),this.projectionDeltaWithTransform=H()}setAnimationOrigin(t,e=!1){let i,s=this.snapshot,n=s?s.latestValues:{},r={...this.latestValues},o=H();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=Y(),l=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),h=!u||u.members.length<=1,c=!!(l&&!h&&!0===this.options.crossfade&&!this.path.some(ri));this.animationProgress=0,this.mixTargetDelta=e=>{let s=e/1e3;if(rt(o.x,t.x,s),rt(o.y,t.y,s),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,d,p,f,m,g;sH(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,f=this.relativeTargetOrigin,m=a,g=s,re(p.x,f.x,m.x,g),re(p.y,f.y,m.y,g),i&&(u=this.relativeTarget,d=i,nF(u.x,d.x)&&nF(u.y,d.y))&&(this.isProjectionDirty=!1),i||(i=Y()),nM(i,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,s,n,r){n?(t.opacity=ej(0,i.opacity??1,nA(s)),t.opacityExit=ej(e.opacity??1,0,nP(s))):r&&(t.opacity=ej(e.opacity??1,i.opacity??1,s));for(let n=0;n<nS;n++){let r=`border${nx[n]}Radius`,o=nC(e,r),a=nC(i,r);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||nT(o)===nT(a)?(t[r]=Math.max(ej(nk(o),nk(a),s),0),(S.test(a)||S.test(o))&&(t[r]+="%")):t[r]=a)}(e.rotate||i.rotate)&&(t.rotate=ej(e.rotate||0,i.rotate||0,s))}(r,n,this.latestValues,s,c,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=s},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(tV(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tM.update(()=>{var e,i,s;let n;nm.hasAnimatedSinceResize=!0,tZ.layout++,this.motionValue||(this.motionValue=es(0)),this.currentAnimation=(e=this.motionValue,i=[0,1e3],s={...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{tZ.layout--},onComplete:()=>{tZ.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}},(n=J(e)?e:es(e)).start(sA("",n,i,s)),n.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:s,latestValues:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&ra(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||Y();let e=sN(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let s=sN(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}nM(e,i),eK(e,n),sQ(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new nQ),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){let{layoutId:t}=this.options;
3return t&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let s={};i.z&&nY("z",t,s,this.animationValues);for(let e=0;e<nH.length;e++)nY(`rotate${nH[e]}`,t,s,this.animationValues),nY(`skew${nH[e]}`,t,s,this.animationValues);for(let e in t.render(),s)t.setStaticValue(e,s[e]),this.animationValues&&(this.animationValues[e]=s[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible){t.visibility="hidden";return}let i=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=io(e?.pointerEvents)||"",t.transform=i?i(this.latestValues,""):"none";return}let s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=io(e?.pointerEvents)||""),this.hasProjected&&!eQ(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1);return}t.visibility="";let n=s.animationValues||s.latestValues;this.applyTransformsToTarget();let r=function(t,e,i){let s="",n=t.x.translate/e.x,r=t.y.translate/e.y,o=i?.z||0;if((n||r||o)&&(s=`translate3d(${n}px, ${r}px, ${o}px) `),(1!==e.x||1!==e.y)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),i){let{transformPerspective:t,rotate:e,rotateX:n,rotateY:r,skewX:o,skewY:a}=i;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),n&&(s+=`rotateX(${n}deg) `),r&&(s+=`rotateY(${r}deg) `),o&&(s+=`skewX(${o}deg) `),a&&(s+=`skewY(${a}deg) `)}let a=t.x.scale*e.x,l=t.y.scale*e.y;return(1!==a||1!==l)&&(s+=`scale(${a}, ${l})`),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,n);i&&(r=i(n,r)),t.transform=r;let{x:o,y:a}=this.projectionDelta;for(let e in t.transformOrigin=`${100*o.origin}% ${100*a.origin}% 0`,s.animationValues?t.opacity=s===this?n.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:n.opacityExit:t.opacity=s===this?void 0!==n.opacity?n.opacity:"":void 0!==n.opacityExit?n.opacityExit:0,eD){if(void 0===n[e])continue;let{correct:i,applyTo:o,isCSSVariable:a}=eD[e],l="none"===r?n[e]:i(n[e],s);if(o){let e=o.length;for(let i=0;i<e;i++)t[o[i]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=s===this?io(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(n2),this.root.sharedNodes.clear()}}}function nK(t){t.updateLayout()}function nG(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:i,measuredBox:s}=t.layout,{animationType:n}=t.options,r=e.source!==t.layout.source;"size"===n?s$(t=>{let s=r?e.measuredBox[t]:e.layoutBox[t],n=sN(s);s.min=i[t].min,s.max=s.min+n}):ra(n,e.layoutBox,i)&&s$(s=>{let n=r?e.measuredBox[s]:e.layoutBox[s],o=sN(i[s]);n.max=n.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+o)});let o=H();sQ(o,i,e.layoutBox);let a=H();r?sQ(a,t.applyTransform(s,!0),e.measuredBox):sQ(a,i,e.layoutBox);let l=!nq(o),u=!1;if(!t.resumeFrom){let s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){let{snapshot:n,layout:r}=s;if(n&&r){let o=Y();sH(o,e.layoutBox,n.layoutBox);let a=Y();sH(a,i,r.layoutBox),nU(o,a)||(u=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function nZ(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
3isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function n0(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function n1(t){t.clearSnapshot()}function n2(t){t.clearMeasurements()}function n3(t){t.isLayoutDirty=!1}function n5(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function n4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function n6(t){t.resolveTargetDelta()}function n8(t){t.calcProjection()}function n9(t){t.resetSkewAndRotation()}function n7(t){t.removeLeadSnapshot()}function rt(t,e,i){t.translate=ej(e.translate,0,i),t.scale=ej(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function re(t,e,i,s){t.min=ej(e.min,i.min,s),t.max=ej(e.max,i.max,s)}function ri(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let rs={duration:.45,ease:[.4,0,.1,1]},rn=t=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),rr=rn("applewebkit/")&&!rn("chrome/")?Math.round:tA;function ro(t){t.min=rr(t.min),t.max=rr(t.max)}function ra(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(nN(e)-nN(i)))}function rl(t){return t!==t.root&&t.scroll?.wasRoot}let ru=nJ({attachResizeListener:(t,e)=>sB(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rh={current:void 0},rc=nJ({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rh.current){let t=new ru({});t.mount(window),t.setOptions({layoutScroll:!0}),rh.current=t}return rh.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function rd(t,e){let i=sJ(t),s=new AbortController;return[i,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function rp(t,e,i){let{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===i);let n=s["onHover"+i];n&&tM.postRender(()=>n(e,s6(e)))}function rf(t){return sX(t)&&"offsetHeight"in t}t.s(["isHTMLElement",0,rf],72846);let rm=(t,e)=>!!e&&(t===e||rm(t,e.parentElement)),rg=new WeakSet;function ry(t){return e=>{"Enter"===e.key&&t(e)}}function rv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rw(t){return s4(t)&&!(sU.x||sU.y)}let rb=new WeakSet;function rx(t,e,i){let{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===i);let n=s["onTap"+("End"===i?"":i)];n&&tM.postRender(()=>n(e,s6(e)))}let rS=new WeakMap,rk=new WeakMap,rT=t=>{let e=rS.get(t.target);e&&e(t)},rC=t=>{t.forEach(rT)},rA={some:0,all:1},rP=function(t,e){if("u"<typeof Proxy)return iS;let i=new Map,s=(i,s)=>iS(i,s,t,e);return new Proxy((t,e)=>s(t,e),{get:(n,r)=>"create"===r?s:(i.has(r)||i.set(r,iS(r,void 0,t,e)),i.get(r))})}({animation:{Feature:class extends ik{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e))s=Promise.all(e.map(e=>sR(t,e,i)));else if("string"==typeof e)s=sR(t,e,i);else{let n="function"==typeof e?iT(t,e,i.custom):e;s=Promise.all(sP(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=sj(),s=!0,n=e=>(i,s)=>{let n=iT(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(n){let{transition:t,transitionEnd:e,...s}=n;i={...i,...s,...e}}return i};function r(r){let{props:o}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){let i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}let i={};for(let t=0;t<sM;t++){let s=eu[t],n=e.props[s];(ea(n)||!1===n)&&(i[s]=n)}return i}(t.parent)||{},l=[],u=new Set,h={},c=1/0;for(let e=0;e<sI;e++){var d,p;let f=sO[e],m=i[f],g=void 0!==o[f]?o[f]:a[f],y=ea(g),v=f===r?m.isActive:null;!1===v&&(c=e);let w=g===a[f]&&g!==o[f]&&y;if(w&&s&&t.manuallyAnimateOnMount&&(w=!1),m.protectedKeys={...h},!m.isActive&&null===v||!g&&!m.prevProp||eo(g)||"boolean"==typeof g)continue;if("exit"===f&&m.isActive&&!0!==v){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}let b=(d=m.prevProp,"string"==typeof(p=g)?p!==d:!!Array.isArray(p)&&!sV(p,d)),x=b||f===r&&m.isActive&&!w&&y||e>c&&y,S=!1,k=Array.isArray(g)?g:[g],T=k.reduce(n(f),{});!1===v&&(T={});let{prevResolvedValues:C={}}=m,A={...C,...T},P=e=>{x=!0,u.has(e)&&(S=!0,u.delete(e)),m.needsAnimating[e]=!0;let i=t.getValue(e);
3i&&(i.liveStyle=!1)};for(let t in A){let e=T[t],i=C[t];if(!h.hasOwnProperty(t))(iP(e)&&iP(i)?sV(e,i):e===i)?void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0:null!=e?P(t):u.add(t)}m.prevProp=g,m.prevResolvedValues=T,m.isActive&&(h={...h,...T}),s&&t.blockInitialAnimation&&(x=!1);let E=w&&b,R=!E||S;x&&R&&l.push(...k.map(e=>{let i={type:f};if("string"==typeof e&&s&&!E&&t.manuallyAnimateOnMount&&t.parent){let{parent:s}=t,n=iT(s,e);if(s.enteringChildren&&n){let{delayChildren:e}=n.transition||{};i.delay=sE(s.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){let e={};if("boolean"!=typeof o.initial){let i=iT(t,Array.isArray(o.initial)?o.initial[0]:o.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{let s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=s??null}),l.push({animation:e})}let f=!!l.length;return s&&(!1===o.initial||o.initial===o.animate)&&!t.manuallyAnimateOnMount&&(f=!1),s=!1,f?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(i[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,s)),i[e].isActive=s;let n=r(e);for(let t in i)i[t].protectedKeys={};return n},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=sj()}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();eo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ik{constructor(){super(...arguments),this.id=sD++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;let s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){let{register:t,onExitComplete:e}=this.node.presenceContext||{};
3e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}},inView:{Feature:class extends ik{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var t;let e;this.unmount();let{viewport:i={}}=this.node.getProps(),{root:s,margin:n,amount:r="some",once:o}=i,a={root:s?s.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:rA[r]},l=t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,o&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),n=e?i:s;n&&n(t)};return t=this.node.current,e=function({root:t,...e}){let i=t||document;rk.has(i)||rk.set(i,{});let s=rk.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(rC,{root:t,...e})),s[n]}(a),rS.set(t,l),e.observe(t),()=>{rS.delete(t),e.unobserve(t)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ik{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=function(t,e,i={}){let[s,n,r]=rd(t,i),o=t=>{let s=t.currentTarget;if(!rw(t)||rb.has(t))return;rg.add(s),i.stopPropagation&&rb.add(t);let r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),rg.has(s)&&rg.delete(s),rw(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,s===window||s===document||i.useGlobalTarget||rm(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,n),window.addEventListener("pointercancel",l,n)};return s.forEach(t=>{((i.useGlobalTarget?window:t).addEventListener("pointerdown",o,n),rf(t))&&(t.addEventListener("focus",t=>((t,e)=>{let i=t.currentTarget;if(!i)return;let s=ry(()=>{if(rg.has(i))return;rv(i,"down");let t=ry(()=>{rv(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>rv(i,"cancel"),e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)})(t,n)),sq.has(t.tagName)||!0===t.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}(t,(t,e)=>(rx(this.node,e,"Start"),(t,{success:e})=>rx(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:i?.tap===!1})}unmount(){}}},focus:{Feature:class extends ik{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=iM(sB(this.node.current,"focus",()=>this.onFocus()),sB(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ik{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[s,n,r]=rd(t,i);return s.forEach(t=>{let i,s=!1,r=!1,o=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{s=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},l=t=>{if("touch"!==t.pointerType){if(s){r=!0;return}o(t)}};t.addEventListener("pointerenter",s=>{if("touch"===s.pointerType||sU.x||sU.y)return;r=!1;let o=e(t,s);"function"==typeof o&&(i=o,t.addEventListener("pointerleave",l,n))},n),t.addEventListener("pointerdown",()=>{s=!0,window.addEventListener("pointerup",a,n),window.addEventListener("pointercancel",a,n)},n)}),r}(t,(t,e)=>(rp(this.node,e,"Start"),t=>rp(this.node,t,"End"))))}unmount(){}}},pan:{Feature:class extends ik{constructor(){super(...arguments),this.removePointerDownListener=tA}onPointerDown(t){this.session=new ne(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:s9(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:nf(t),onStart:nf(e),onMove:nf(i),onEnd:(t,e)=>{delete this.session,s&&tM.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=s8(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ik{constructor(t){super(t),this.removeGroupControls=tA,this.removeListeners=tA,this.controls=new nc(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tA}update(){let{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:rc,MeasureLayout:nb},layout:{ProjectionNode:rc,MeasureLayout:nb}},(t,e)=>e.isSVG??e2(t)?new eB(e):new eZ(e,{allowProjection:t!==e0.Fragment}));t.s(["motion",0,rP],46932)},88653,t=>{"use strict";t.i(47167);var e=t.i(43476),i=t.i(71645),s=t.i(31178),n=t.i(47414),r=t.i(74008),o=t.i(21476),a=t.i(72846),l=i,u=t.i(37806);function h(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}class c extends l.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let t=e.offsetParent,
3i=(0,a.isHTMLElement)(t)&&t.offsetWidth||0,s=(0,a.isHTMLElement)(t)&&t.offsetHeight||0,n=this.props.sizeRef.current;n.height=e.offsetHeight||0,n.width=e.offsetWidth||0,n.top=e.offsetTop,n.left=e.offsetLeft,n.right=i-n.width-n.left,n.bottom=s-n.height-n.top}return null}componentDidUpdate(){}render(){return this.props.children}}function d({children:t,isPresent:s,anchorX:n,anchorY:r,root:o,pop:a}){let p=(0,l.useId)(),f=(0,l.useRef)(null),m=(0,l.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:g}=(0,l.useContext)(u.MotionConfigContext),y=function(...t){return i.useCallback(function(...t){return e=>{let i=!1,s=t.map(t=>{let s=h(t,e);return i||"function"!=typeof s||(i=!0),s});if(i)return()=>{for(let e=0;e<s.length;e++){let i=s[e];"function"==typeof i?i():h(t[e],null)}}}}(...t),t)}(f,t.props?.ref??t?.ref);return(0,l.useInsertionEffect)(()=>{let{width:t,height:e,top:i,left:l,right:u,bottom:h}=m.current;if(s||!1===a||!f.current||!t||!e)return;let c="left"===n?`left: ${l}`:`right: ${u}`,d="bottom"===r?`bottom: ${h}`:`top: ${i}`;f.current.dataset.motionPopId=p;let y=document.createElement("style");g&&(y.nonce=g);let v=o??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`
4          [data-motion-pop-id="${p}"] {
5            position: absolute !important;
6            width: ${t}px !important;
7            height: ${e}px !important;
8            ${c}px !important;
9            ${d}px !important;
10          }
11        `),()=>{v.contains(y)&&v.removeChild(y)}},[s]),(0,e.jsx)(c,{isPresent:s,childRef:f,sizeRef:m,pop:a,children:!1===a?t:l.cloneElement(t,{ref:y})})}let p=({children:t,initial:s,isPresent:r,onExitComplete:a,custom:l,presenceAffectsLayout:u,mode:h,anchorX:c,anchorY:p,root:m})=>{let g=(0,n.useConstant)(f),y=(0,i.useId)(),v=!0,w=(0,i.useMemo)(()=>(v=!1,{id:y,initial:s,isPresent:r,custom:l,onExitComplete:t=>{for(let e of(g.set(t,!0),g.values()))if(!e)return;a&&a()},register:t=>(g.set(t,!1),()=>g.delete(t))}),[r,g,a]);return u&&v&&(w={...w}),(0,i.useMemo)(()=>{g.forEach((t,e)=>g.set(e,!1))},[r]),i.useEffect(()=>{r||g.size||!a||a()},[r]),t=(0,e.jsx)(d,{pop:"popLayout"===h,isPresent:r,anchorX:c,anchorY:p,root:m,children:t}),(0,e.jsx)(o.PresenceContext.Provider,{value:w,children:t})};function f(){return new Map}var m=t.i(64978);let g=t=>t.key||"";function y(t){let e=[];return i.Children.forEach(t,t=>{(0,i.isValidElement)(t)&&e.push(t)}),e}t.s(["AnimatePresence",0,({children:t,custom:o,initial:a=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:h="sync",propagate:c=!1,anchorX:d="left",anchorY:f="top",root:v})=>{let[w,b]=(0,m.usePresence)(c),x=(0,i.useMemo)(()=>y(t),[t]),S=c&&!w?[]:x.map(g),k=(0,i.useRef)(!0),T=(0,i.useRef)(x),C=(0,n.useConstant)(()=>new Map),A=(0,i.useRef)(new Set),[P,E]=(0,i.useState)(x),[R,M]=(0,i.useState)(x);(0,r.useIsomorphicLayoutEffect)(()=>{k.current=!1,T.current=x;for(let t=0;t<R.length;t++){let e=g(R[t]);S.includes(e)?(C.delete(e),A.current.delete(e)):!0!==C.get(e)&&C.set(e,!1)}},[R,S.length,S.join("-")]);let V=[];if(x!==P){let t=[...x];for(let e=0;e<R.length;e++){let i=R[e],s=g(i);S.includes(s)||(t.splice(e,0,i),V.push(i))}return"wait"===h&&V.length&&(t=V),M(y(t)),E(x),null}let{forceRender:O}=(0,i.useContext)(s.LayoutGroupContext);return(0,e.jsx)(e.Fragment,{children:R.map(t=>{let i=g(t),s=(!c||!!w)&&(x===R||S.includes(i));return(0,e.jsx)(p,{isPresent:s,initial:(!k.current||!!a)&&void 0,custom:o,presenceAffectsLayout:u,mode:h,root:v,onExitComplete:s?void 0:()=>{if(A.current.has(i)||(A.current.add(i),!C.has(i)))return;C.set(i,!0);let t=!0;C.forEach(e=>{e||(t=!1)}),t&&(O?.(),M(T.current),c&&b?.(),l&&l())},anchorX:d,anchorY:f,children:t},i)})})}],88653)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.