@g4rcez/components 0.0.72 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +46 -46
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +3239 -3237
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/index.umd.js +46 -46
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/src/components/core/button.d.ts +2 -2
  9. package/dist/src/components/core/polymorph.d.ts +9 -8
  10. package/dist/src/components/core/polymorph.d.ts.map +1 -1
  11. package/dist/src/components/core/polymorph.js +4 -3
  12. package/dist/src/components/core/tag.d.ts +2 -2
  13. package/dist/src/components/floating/tooltip.d.ts +7 -5
  14. package/dist/src/components/floating/tooltip.d.ts.map +1 -1
  15. package/dist/src/components/floating/tooltip.js +16 -6
  16. package/dist/src/components/form/autocomplete.d.ts.map +1 -1
  17. package/dist/src/components/form/autocomplete.js +3 -3
  18. package/dist/src/components/form/multi-combobox.d.ts.map +1 -1
  19. package/dist/src/components/form/multi-combobox.js +3 -3
  20. package/dist/src/components/form/switch.js +2 -2
  21. package/dist/src/components/table/index.js +3 -3
  22. package/dist/src/lib/fns.d.ts +2 -0
  23. package/dist/src/lib/fns.d.ts.map +1 -1
  24. package/dist/src/lib/fns.js +2 -0
  25. package/dist/src/types.d.ts +2 -2
  26. package/dist/src/types.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/src/hooks/use-callback-ref.d.ts +0 -3
  29. package/dist/src/hooks/use-callback-ref.d.ts.map +0 -1
  30. package/dist/src/hooks/use-callback-ref.js +0 -8
  31. package/dist/src/hooks/use-mutable-state.d.ts +0 -2
  32. package/dist/src/hooks/use-mutable-state.d.ts.map +0 -1
  33. package/dist/src/hooks/use-mutable-state.js +0 -8
package/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
- (function(J,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],w):(J=typeof globalThis<"u"?globalThis:J||self,w(J.components={},J.React,J["react/jsx-runtime"],J.ReactDOM))})(this,function(J,w,x,xs){"use strict";var sB=Object.defineProperty;var iB=(J,w,x)=>w in J?sB(J,w,{enumerable:!0,configurable:!0,writable:!0,value:x}):J[w]=x;var ce=(J,w,x)=>iB(J,typeof w!="symbol"?w+"":w,x);function uh(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const P=uh(w),Ss=uh(xs);function dh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=dh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xx(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=dh(e))&&(r&&(r+=" "),r+=t);return r}var fh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jx(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var e1=Error,t1=EvalError,n1=RangeError,r1=ReferenceError,hh=SyntaxError,Ts=TypeError,o1=URIError,s1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;t[n]=o;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,n);if(i.value!==o||i.enumerable!==!0)return!1}return!0},ph=typeof Symbol<"u"&&Symbol,i1=s1,a1=function(){return typeof ph!="function"||typeof Symbol!="function"||typeof ph("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i1()},$l={__proto__:null,foo:{}},l1=Object,c1=function(){return{__proto__:$l}.foo===$l.foo&&!($l instanceof l1)},u1="Function.prototype.bind called on incompatible ",d1=Object.prototype.toString,f1=Math.max,h1="[object Function]",mh=function(t,n){for(var r=[],o=0;o<t.length;o+=1)r[o]=t[o];for(var s=0;s<n.length;s+=1)r[s+t.length]=n[s];return r},p1=function(t,n){for(var r=[],o=n,s=0;o<t.length;o+=1,s+=1)r[s]=t[o];return r},m1=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},g1=function(t){var n=this;if(typeof n!="function"||d1.apply(n)!==h1)throw new TypeError(u1+n);for(var r=p1(arguments,1),o,s=function(){if(this instanceof o){var u=n.apply(this,mh(r,arguments));return Object(u)===u?u:this}return n.apply(t,mh(r,arguments))},i=f1(0,n.length-r.length),a=[],l=0;l<i;l++)a[l]="$"+l;if(o=Function("binder","return function ("+m1(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var c=function(){};c.prototype=n.prototype,o.prototype=new c,c.prototype=null}return o},y1=g1,Rl=Function.prototype.bind||y1,v1=Function.prototype.call,b1=Object.prototype.hasOwnProperty,w1=Rl,x1=w1.call(v1,b1),ke,S1=e1,T1=t1,E1=n1,C1=r1,oo=hh,so=Ts,P1=o1,gh=Function,Bl=function(e){try{return gh('"use strict"; return ('+e+").constructor;")()}catch{}},xr=Object.getOwnPropertyDescriptor;if(xr)try{xr({},"")}catch{xr=null}var jl=function(){throw new so},k1=xr?function(){try{return arguments.callee,jl}catch{try{return xr(arguments,"callee").get}catch{return jl}}}():jl,io=a1(),I1=c1(),St=Object.getPrototypeOf||(I1?function(e){return e.__proto__}:null),ao={},A1=typeof Uint8Array>"u"||!St?ke:St(Uint8Array),Sr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":io&&St?St([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":ao,"%AsyncGenerator%":ao,"%AsyncGeneratorFunction%":ao,"%AsyncIteratorPrototype%":ao,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S1,"%eval%":eval,"%EvalError%":T1,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":gh,"%GeneratorFunction%":ao,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":io&&St?St(St([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!io||!St?ke:St(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":E1,"%ReferenceError%":C1,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!io||!St?ke:St(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":io&&St?St(""[Symbol.iterator]()):ke,"%Symbol%":io?Symbol:ke,"%SyntaxError%":oo,"%ThrowTypeError%":k1,"%TypedArray%":A1,"%TypeError%":so,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":P1,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet};if(St)try{null.error}catch(e){var O1=St(St(e));Sr["%Error.prototype%"]=O1}var _1=function e(t){var n;if(t==="%AsyncFunction%")n=Bl("async function () {}");else if(t==="%GeneratorFunction%")n=Bl("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Bl("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&St&&(n=St(o.prototype))}return Sr[t]=n,n},yh={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Es=Rl,Vi=x1,D1=Es.call(Function.call,Array.prototype.concat),M1=Es.call(Function.apply,Array.prototype.splice),vh=Es.call(Function.call,String.prototype.replace),$i=Es.call(Function.call,String.prototype.slice),N1=Es.call(Function.call,RegExp.prototype.exec),L1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F1=/\\(\\)?/g,V1=function(t){var n=$i(t,0,1),r=$i(t,-1);if(n==="%"&&r!=="%")throw new oo("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new oo("invalid intrinsic syntax, expected opening `%`");var o=[];return vh(t,L1,function(s,i,a,l){o[o.length]=a?vh(l,F1,"$1"):i||s}),o},$1=function(t,n){var r=t,o;if(Vi(yh,r)&&(o=yh[r],r="%"+o[0]+"%"),Vi(Sr,r)){var s=Sr[r];if(s===ao&&(s=_1(r)),typeof s>"u"&&!n)throw new so("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:s}}throw new oo("intrinsic "+t+" does not exist!")},lo=function(t,n){if(typeof t!="string"||t.length===0)throw new so("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new so('"allowMissing" argument must be a boolean');if(N1(/^%?[^%]*%?$/,t)===null)throw new oo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=V1(t),o=r.length>0?r[0]:"",s=$1("%"+o+"%",n),i=s.name,a=s.value,l=!1,c=s.alias;c&&(o=c[0],M1(r,D1([0,1],c)));for(var u=1,d=!0;u<r.length;u+=1){var f=r[u],h=$i(f,0,1),m=$i(f,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new oo("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),o+="."+f,i="%"+o+"%",Vi(Sr,i))a=Sr[i];else if(a!=null){if(!(f in a)){if(!n)throw new so("base intrinsic for "+t+" exists, but the property is not available.");return}if(xr&&u+1>=r.length){var p=xr(a,f);d=!!p,d&&"get"in p&&!("originalValue"in p.get)?a=p.get:a=a[f]}else d=Vi(a,f),a=a[f];d&&!l&&(Sr[i]=a)}}return a},bh={exports:{}},Wl,wh;function zl(){if(wh)return Wl;wh=1;var e=lo,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Wl=t,Wl}var R1=lo,Ri=R1("%Object.getOwnPropertyDescriptor%",!0);if(Ri)try{Ri([],"length")}catch{Ri=null}var xh=Ri,Sh=zl(),B1=hh,co=Ts,Th=xh,j1=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new co("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new co("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new co("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new co("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new co("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new co("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!Th&&Th(t,n);if(Sh)Sh(t,n,{configurable:i===null&&l?l.configurable:!i,enumerable:o===null&&l?l.enumerable:!o,value:r,writable:s===null&&l?l.writable:!s});else if(a||!o&&!s&&!i)t[n]=r;else throw new B1("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Hl=zl(),Eh=function(){return!!Hl};Eh.hasArrayLengthDefineBug=function(){if(!Hl)return null;try{return Hl([],"length",{value:1}).length!==1}catch{return!0}};var W1=Eh,z1=lo,Ch=j1,H1=W1(),Ph=xh,kh=Ts,U1=z1("%Math.floor%"),G1=function(t,n){if(typeof t!="function")throw new kh("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||U1(n)!==n)throw new kh("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in t&&Ph){var i=Ph(t,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(s=!1)}return(o||s||!r)&&(H1?Ch(t,"length",n,!0,!0):Ch(t,"length",n)),t};(function(e){var t=Rl,n=lo,r=G1,o=Ts,s=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),a=n("%Reflect.apply%",!0)||t.call(i,s),l=zl(),c=n("%Math.max%");e.exports=function(f){if(typeof f!="function")throw new o("a function is required");var h=a(t,i,arguments);return r(h,1+c(0,f.length-(arguments.length-1)),!0)};var u=function(){return a(t,s,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(bh);var Y1=bh.exports,Ih=lo,Ah=Y1,q1=Ah(Ih("String.prototype.indexOf")),K1=function(t,n){var r=Ih(t,!!n);return typeof r=="function"&&q1(t,".prototype.")>-1?Ah(r):r};const Z1=Jx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ul=typeof Map=="function"&&Map.prototype,Gl=Object.getOwnPropertyDescriptor&&Ul?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Bi=Ul&&Gl&&typeof Gl.get=="function"?Gl.get:null,Oh=Ul&&Map.prototype.forEach,Yl=typeof Set=="function"&&Set.prototype,ql=Object.getOwnPropertyDescriptor&&Yl?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ji=Yl&&ql&&typeof ql.get=="function"?ql.get:null,_h=Yl&&Set.prototype.forEach,X1=typeof WeakMap=="function"&&WeakMap.prototype,Cs=X1?WeakMap.prototype.has:null,Q1=typeof WeakSet=="function"&&WeakSet.prototype,Ps=Q1?WeakSet.prototype.has:null,J1=typeof WeakRef=="function"&&WeakRef.prototype,Dh=J1?WeakRef.prototype.deref:null,eS=Boolean.prototype.valueOf,tS=Object.prototype.toString,nS=Function.prototype.toString,rS=String.prototype.match,Kl=String.prototype.slice,Kn=String.prototype.replace,oS=String.prototype.toUpperCase,Mh=String.prototype.toLowerCase,Nh=RegExp.prototype.test,Lh=Array.prototype.concat,yn=Array.prototype.join,sS=Array.prototype.slice,Fh=Math.floor,Zl=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Xl=Object.getOwnPropertySymbols,Ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,uo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",_t=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===uo||!0)?Symbol.toStringTag:null,Vh=Object.prototype.propertyIsEnumerable,$h=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Rh(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Nh.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Fh(-e):Fh(e);if(r!==e){var o=String(r),s=Kl.call(t,o.length+1);return Kn.call(o,n,"$&_")+"."+Kn.call(Kn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Kn.call(t,n,"$&_")}var Jl=Z1,Bh=Jl.custom,jh=Hh(Bh)?Bh:null,iS=function e(t,n,r,o){var s=n||{};if(Zn(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Zn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=Zn(s,"customInspect")?s.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Zn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Zn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Gh(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?Rh(t,l):l}if(typeof t=="bigint"){var c=String(t)+"n";return a?Rh(t,c):c}var u=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return ec(t)?"[Array]":"[Object]";var d=ES(s,r);if(typeof o>"u")o=[];else if(Uh(o,t)>=0)return"[Circular]";function f(V,k,M){if(k&&(o=sS.call(o),o.push(k)),M){var L={depth:s.depth};return Zn(s,"quoteStyle")&&(L.quoteStyle=s.quoteStyle),e(V,L,r+1,o)}return e(V,s,r+1,o)}if(typeof t=="function"&&!zh(t)){var h=mS(t),m=Wi(t,f);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+yn.call(m,", ")+" }":"")}if(Hh(t)){var p=uo?Kn.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ql.call(t);return typeof t=="object"&&!uo?ks(p):p}if(xS(t)){for(var y="<"+Mh.call(String(t.nodeName)),b=t.attributes||[],v=0;v<b.length;v++)y+=" "+b[v].name+"="+Wh(aS(b[v].value),"double",s);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+Mh.call(String(t.nodeName))+">",y}if(ec(t)){if(t.length===0)return"[]";var g=Wi(t,f);return d&&!TS(g)?"["+nc(g,d)+"]":"[ "+yn.call(g,", ")+" ]"}if(cS(t)){var T=Wi(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!Vh.call(t,"cause")?"{ ["+String(t)+"] "+yn.call(Lh.call("[cause]: "+f(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+yn.call(T,", ")+" }"}if(typeof t=="object"&&i){if(jh&&typeof t[jh]=="function"&&Jl)return Jl(t,{depth:u-r});if(i!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(gS(t)){var S=[];return Oh&&Oh.call(t,function(V,k){S.push(f(k,t,!0)+" => "+f(V,t))}),Yh("Map",Bi.call(t),S,d)}if(bS(t)){var E=[];return _h&&_h.call(t,function(V){E.push(f(V,t))}),Yh("Set",ji.call(t),E,d)}if(yS(t))return tc("WeakMap");if(wS(t))return tc("WeakSet");if(vS(t))return tc("WeakRef");if(dS(t))return ks(f(Number(t)));if(hS(t))return ks(f(Zl.call(t)));if(fS(t))return ks(eS.call(t));if(uS(t))return ks(f(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof fh<"u"&&t===fh)return"{ [object globalThis] }";if(!lS(t)&&!zh(t)){var C=Wi(t,f),I=$h?$h(t)===Object.prototype:t instanceof Object||t.constructor===Object,A=t instanceof Object?"":"null prototype",O=!I&&_t&&Object(t)===t&&_t in t?Kl.call(Xn(t),8,-1):A?"Object":"",F=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",_=F+(O||A?"["+yn.call(Lh.call([],O||[],A||[]),": ")+"] ":"");return C.length===0?_+"{}":d?_+"{"+nc(C,d)+"}":_+"{ "+yn.call(C,", ")+" }"}return String(t)};function Wh(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function aS(e){return Kn.call(String(e),/"/g,"&quot;")}function ec(e){return Xn(e)==="[object Array]"&&(!_t||!(typeof e=="object"&&_t in e))}function lS(e){return Xn(e)==="[object Date]"&&(!_t||!(typeof e=="object"&&_t in e))}function zh(e){return Xn(e)==="[object RegExp]"&&(!_t||!(typeof e=="object"&&_t in e))}function cS(e){return Xn(e)==="[object Error]"&&(!_t||!(typeof e=="object"&&_t in e))}function uS(e){return Xn(e)==="[object String]"&&(!_t||!(typeof e=="object"&&_t in e))}function dS(e){return Xn(e)==="[object Number]"&&(!_t||!(typeof e=="object"&&_t in e))}function fS(e){return Xn(e)==="[object Boolean]"&&(!_t||!(typeof e=="object"&&_t in e))}function Hh(e){if(uo)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Ql)return!1;try{return Ql.call(e),!0}catch{}return!1}function hS(e){if(!e||typeof e!="object"||!Zl)return!1;try{return Zl.call(e),!0}catch{}return!1}var pS=Object.prototype.hasOwnProperty||function(e){return e in this};function Zn(e,t){return pS.call(e,t)}function Xn(e){return tS.call(e)}function mS(e){if(e.name)return e.name;var t=rS.call(nS.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Uh(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function gS(e){if(!Bi||!e||typeof e!="object")return!1;try{Bi.call(e);try{ji.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function yS(e){if(!Cs||!e||typeof e!="object")return!1;try{Cs.call(e,Cs);try{Ps.call(e,Ps)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function vS(e){if(!Dh||!e||typeof e!="object")return!1;try{return Dh.call(e),!0}catch{}return!1}function bS(e){if(!ji||!e||typeof e!="object")return!1;try{ji.call(e);try{Bi.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function wS(e){if(!Ps||!e||typeof e!="object")return!1;try{Ps.call(e,Ps);try{Cs.call(e,Cs)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function xS(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Gh(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Gh(Kl.call(e,0,t.maxStringLength),t)+r}var o=Kn.call(Kn.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,SS);return Wh(o,"single",t)}function SS(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+oS.call(t.toString(16))}function ks(e){return"Object("+e+")"}function tc(e){return e+" { ? }"}function Yh(e,t,n,r){var o=r?nc(n,r):yn.call(n,", ");return e+" ("+t+") {"+o+"}"}function TS(e){for(var t=0;t<e.length;t++)if(Uh(e[t],`
2
- `)>=0)return!1;return!0}function ES(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=yn.call(Array(e.indent+1)," ");else return null;return{base:n,prev:yn.call(Array(t+1),n)}}function nc(e,t){if(e.length===0)return"";var n=`
1
+ (function(J,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],w):(J=typeof globalThis<"u"?globalThis:J||self,w(J.components={},J.React,J["react/jsx-runtime"],J.ReactDOM))})(this,function(J,w,x,xs){"use strict";var iB=Object.defineProperty;var aB=(J,w,x)=>w in J?iB(J,w,{enumerable:!0,configurable:!0,writable:!0,value:x}):J[w]=x;var ce=(J,w,x)=>aB(J,typeof w!="symbol"?w+"":w,x);function dh(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const P=dh(w),Ss=dh(xs);function fh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=fh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xx(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=fh(e))&&(r&&(r+=" "),r+=t);return r}var hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jx(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var e1=Error,t1=EvalError,n1=RangeError,r1=ReferenceError,ph=SyntaxError,Ts=TypeError,o1=URIError,s1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;t[n]=o;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,n);if(i.value!==o||i.enumerable!==!0)return!1}return!0},mh=typeof Symbol<"u"&&Symbol,i1=s1,a1=function(){return typeof mh!="function"||typeof Symbol!="function"||typeof mh("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i1()},Rl={__proto__:null,foo:{}},l1=Object,c1=function(){return{__proto__:Rl}.foo===Rl.foo&&!(Rl instanceof l1)},u1="Function.prototype.bind called on incompatible ",d1=Object.prototype.toString,f1=Math.max,h1="[object Function]",gh=function(t,n){for(var r=[],o=0;o<t.length;o+=1)r[o]=t[o];for(var s=0;s<n.length;s+=1)r[s+t.length]=n[s];return r},p1=function(t,n){for(var r=[],o=n,s=0;o<t.length;o+=1,s+=1)r[s]=t[o];return r},m1=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},g1=function(t){var n=this;if(typeof n!="function"||d1.apply(n)!==h1)throw new TypeError(u1+n);for(var r=p1(arguments,1),o,s=function(){if(this instanceof o){var u=n.apply(this,gh(r,arguments));return Object(u)===u?u:this}return n.apply(t,gh(r,arguments))},i=f1(0,n.length-r.length),a=[],l=0;l<i;l++)a[l]="$"+l;if(o=Function("binder","return function ("+m1(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var c=function(){};c.prototype=n.prototype,o.prototype=new c,c.prototype=null}return o},y1=g1,Bl=Function.prototype.bind||y1,v1=Function.prototype.call,b1=Object.prototype.hasOwnProperty,w1=Bl,x1=w1.call(v1,b1),ke,S1=e1,T1=t1,E1=n1,C1=r1,oo=ph,so=Ts,P1=o1,yh=Function,jl=function(e){try{return yh('"use strict"; return ('+e+").constructor;")()}catch{}},xr=Object.getOwnPropertyDescriptor;if(xr)try{xr({},"")}catch{xr=null}var Wl=function(){throw new so},k1=xr?function(){try{return arguments.callee,Wl}catch{try{return xr(arguments,"callee").get}catch{return Wl}}}():Wl,io=a1(),I1=c1(),St=Object.getPrototypeOf||(I1?function(e){return e.__proto__}:null),ao={},A1=typeof Uint8Array>"u"||!St?ke:St(Uint8Array),Sr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":io&&St?St([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":ao,"%AsyncGenerator%":ao,"%AsyncGeneratorFunction%":ao,"%AsyncIteratorPrototype%":ao,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S1,"%eval%":eval,"%EvalError%":T1,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":yh,"%GeneratorFunction%":ao,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":io&&St?St(St([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!io||!St?ke:St(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":E1,"%ReferenceError%":C1,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!io||!St?ke:St(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":io&&St?St(""[Symbol.iterator]()):ke,"%Symbol%":io?Symbol:ke,"%SyntaxError%":oo,"%ThrowTypeError%":k1,"%TypedArray%":A1,"%TypeError%":so,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":P1,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet};if(St)try{null.error}catch(e){var O1=St(St(e));Sr["%Error.prototype%"]=O1}var _1=function e(t){var n;if(t==="%AsyncFunction%")n=jl("async function () {}");else if(t==="%GeneratorFunction%")n=jl("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=jl("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&St&&(n=St(o.prototype))}return Sr[t]=n,n},vh={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Es=Bl,$i=x1,D1=Es.call(Function.call,Array.prototype.concat),M1=Es.call(Function.apply,Array.prototype.splice),bh=Es.call(Function.call,String.prototype.replace),Ri=Es.call(Function.call,String.prototype.slice),N1=Es.call(Function.call,RegExp.prototype.exec),L1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F1=/\\(\\)?/g,V1=function(t){var n=Ri(t,0,1),r=Ri(t,-1);if(n==="%"&&r!=="%")throw new oo("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new oo("invalid intrinsic syntax, expected opening `%`");var o=[];return bh(t,L1,function(s,i,a,l){o[o.length]=a?bh(l,F1,"$1"):i||s}),o},$1=function(t,n){var r=t,o;if($i(vh,r)&&(o=vh[r],r="%"+o[0]+"%"),$i(Sr,r)){var s=Sr[r];if(s===ao&&(s=_1(r)),typeof s>"u"&&!n)throw new so("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:s}}throw new oo("intrinsic "+t+" does not exist!")},lo=function(t,n){if(typeof t!="string"||t.length===0)throw new so("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new so('"allowMissing" argument must be a boolean');if(N1(/^%?[^%]*%?$/,t)===null)throw new oo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=V1(t),o=r.length>0?r[0]:"",s=$1("%"+o+"%",n),i=s.name,a=s.value,l=!1,c=s.alias;c&&(o=c[0],M1(r,D1([0,1],c)));for(var u=1,d=!0;u<r.length;u+=1){var f=r[u],h=Ri(f,0,1),m=Ri(f,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new oo("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),o+="."+f,i="%"+o+"%",$i(Sr,i))a=Sr[i];else if(a!=null){if(!(f in a)){if(!n)throw new so("base intrinsic for "+t+" exists, but the property is not available.");return}if(xr&&u+1>=r.length){var p=xr(a,f);d=!!p,d&&"get"in p&&!("originalValue"in p.get)?a=p.get:a=a[f]}else d=$i(a,f),a=a[f];d&&!l&&(Sr[i]=a)}}return a},wh={exports:{}},zl,xh;function Hl(){if(xh)return zl;xh=1;var e=lo,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return zl=t,zl}var R1=lo,Bi=R1("%Object.getOwnPropertyDescriptor%",!0);if(Bi)try{Bi([],"length")}catch{Bi=null}var Sh=Bi,Th=Hl(),B1=ph,co=Ts,Eh=Sh,j1=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new co("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new co("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new co("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new co("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new co("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new co("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!Eh&&Eh(t,n);if(Th)Th(t,n,{configurable:i===null&&l?l.configurable:!i,enumerable:o===null&&l?l.enumerable:!o,value:r,writable:s===null&&l?l.writable:!s});else if(a||!o&&!s&&!i)t[n]=r;else throw new B1("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ul=Hl(),Ch=function(){return!!Ul};Ch.hasArrayLengthDefineBug=function(){if(!Ul)return null;try{return Ul([],"length",{value:1}).length!==1}catch{return!0}};var W1=Ch,z1=lo,Ph=j1,H1=W1(),kh=Sh,Ih=Ts,U1=z1("%Math.floor%"),G1=function(t,n){if(typeof t!="function")throw new Ih("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||U1(n)!==n)throw new Ih("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in t&&kh){var i=kh(t,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(s=!1)}return(o||s||!r)&&(H1?Ph(t,"length",n,!0,!0):Ph(t,"length",n)),t};(function(e){var t=Bl,n=lo,r=G1,o=Ts,s=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),a=n("%Reflect.apply%",!0)||t.call(i,s),l=Hl(),c=n("%Math.max%");e.exports=function(f){if(typeof f!="function")throw new o("a function is required");var h=a(t,i,arguments);return r(h,1+c(0,f.length-(arguments.length-1)),!0)};var u=function(){return a(t,s,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(wh);var Y1=wh.exports,Ah=lo,Oh=Y1,q1=Oh(Ah("String.prototype.indexOf")),K1=function(t,n){var r=Ah(t,!!n);return typeof r=="function"&&q1(t,".prototype.")>-1?Oh(r):r};const Z1=Jx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Gl=typeof Map=="function"&&Map.prototype,Yl=Object.getOwnPropertyDescriptor&&Gl?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ji=Gl&&Yl&&typeof Yl.get=="function"?Yl.get:null,_h=Gl&&Map.prototype.forEach,ql=typeof Set=="function"&&Set.prototype,Kl=Object.getOwnPropertyDescriptor&&ql?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wi=ql&&Kl&&typeof Kl.get=="function"?Kl.get:null,Dh=ql&&Set.prototype.forEach,X1=typeof WeakMap=="function"&&WeakMap.prototype,Cs=X1?WeakMap.prototype.has:null,Q1=typeof WeakSet=="function"&&WeakSet.prototype,Ps=Q1?WeakSet.prototype.has:null,J1=typeof WeakRef=="function"&&WeakRef.prototype,Mh=J1?WeakRef.prototype.deref:null,eS=Boolean.prototype.valueOf,tS=Object.prototype.toString,nS=Function.prototype.toString,rS=String.prototype.match,Zl=String.prototype.slice,Kn=String.prototype.replace,oS=String.prototype.toUpperCase,Nh=String.prototype.toLowerCase,Lh=RegExp.prototype.test,Fh=Array.prototype.concat,yn=Array.prototype.join,sS=Array.prototype.slice,Vh=Math.floor,Xl=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ql=Object.getOwnPropertySymbols,Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,uo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",_t=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===uo||!0)?Symbol.toStringTag:null,$h=Object.prototype.propertyIsEnumerable,Rh=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Bh(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Lh.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Vh(-e):Vh(e);if(r!==e){var o=String(r),s=Zl.call(t,o.length+1);return Kn.call(o,n,"$&_")+"."+Kn.call(Kn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Kn.call(t,n,"$&_")}var ec=Z1,jh=ec.custom,Wh=Uh(jh)?jh:null,iS=function e(t,n,r,o){var s=n||{};if(Zn(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Zn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=Zn(s,"customInspect")?s.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Zn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Zn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Yh(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?Bh(t,l):l}if(typeof t=="bigint"){var c=String(t)+"n";return a?Bh(t,c):c}var u=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return tc(t)?"[Array]":"[Object]";var d=ES(s,r);if(typeof o>"u")o=[];else if(Gh(o,t)>=0)return"[Circular]";function f(V,k,M){if(k&&(o=sS.call(o),o.push(k)),M){var F={depth:s.depth};return Zn(s,"quoteStyle")&&(F.quoteStyle=s.quoteStyle),e(V,F,r+1,o)}return e(V,s,r+1,o)}if(typeof t=="function"&&!Hh(t)){var h=mS(t),m=zi(t,f);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+yn.call(m,", ")+" }":"")}if(Uh(t)){var p=uo?Kn.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jl.call(t);return typeof t=="object"&&!uo?ks(p):p}if(xS(t)){for(var v="<"+Nh.call(String(t.nodeName)),b=t.attributes||[],y=0;y<b.length;y++)v+=" "+b[y].name+"="+zh(aS(b[y].value),"double",s);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+Nh.call(String(t.nodeName))+">",v}if(tc(t)){if(t.length===0)return"[]";var g=zi(t,f);return d&&!TS(g)?"["+rc(g,d)+"]":"[ "+yn.call(g,", ")+" ]"}if(cS(t)){var T=zi(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!$h.call(t,"cause")?"{ ["+String(t)+"] "+yn.call(Fh.call("[cause]: "+f(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+yn.call(T,", ")+" }"}if(typeof t=="object"&&i){if(Wh&&typeof t[Wh]=="function"&&ec)return ec(t,{depth:u-r});if(i!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(gS(t)){var S=[];return _h&&_h.call(t,function(V,k){S.push(f(k,t,!0)+" => "+f(V,t))}),qh("Map",ji.call(t),S,d)}if(bS(t)){var E=[];return Dh&&Dh.call(t,function(V){E.push(f(V,t))}),qh("Set",Wi.call(t),E,d)}if(yS(t))return nc("WeakMap");if(wS(t))return nc("WeakSet");if(vS(t))return nc("WeakRef");if(dS(t))return ks(f(Number(t)));if(hS(t))return ks(f(Xl.call(t)));if(fS(t))return ks(eS.call(t));if(uS(t))return ks(f(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof hh<"u"&&t===hh)return"{ [object globalThis] }";if(!lS(t)&&!Hh(t)){var C=zi(t,f),I=Rh?Rh(t)===Object.prototype:t instanceof Object||t.constructor===Object,A=t instanceof Object?"":"null prototype",O=!I&&_t&&Object(t)===t&&_t in t?Zl.call(Xn(t),8,-1):A?"Object":"",L=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",_=L+(O||A?"["+yn.call(Fh.call([],O||[],A||[]),": ")+"] ":"");return C.length===0?_+"{}":d?_+"{"+rc(C,d)+"}":_+"{ "+yn.call(C,", ")+" }"}return String(t)};function zh(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function aS(e){return Kn.call(String(e),/"/g,"&quot;")}function tc(e){return Xn(e)==="[object Array]"&&(!_t||!(typeof e=="object"&&_t in e))}function lS(e){return Xn(e)==="[object Date]"&&(!_t||!(typeof e=="object"&&_t in e))}function Hh(e){return Xn(e)==="[object RegExp]"&&(!_t||!(typeof e=="object"&&_t in e))}function cS(e){return Xn(e)==="[object Error]"&&(!_t||!(typeof e=="object"&&_t in e))}function uS(e){return Xn(e)==="[object String]"&&(!_t||!(typeof e=="object"&&_t in e))}function dS(e){return Xn(e)==="[object Number]"&&(!_t||!(typeof e=="object"&&_t in e))}function fS(e){return Xn(e)==="[object Boolean]"&&(!_t||!(typeof e=="object"&&_t in e))}function Uh(e){if(uo)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Jl)return!1;try{return Jl.call(e),!0}catch{}return!1}function hS(e){if(!e||typeof e!="object"||!Xl)return!1;try{return Xl.call(e),!0}catch{}return!1}var pS=Object.prototype.hasOwnProperty||function(e){return e in this};function Zn(e,t){return pS.call(e,t)}function Xn(e){return tS.call(e)}function mS(e){if(e.name)return e.name;var t=rS.call(nS.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Gh(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function gS(e){if(!ji||!e||typeof e!="object")return!1;try{ji.call(e);try{Wi.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function yS(e){if(!Cs||!e||typeof e!="object")return!1;try{Cs.call(e,Cs);try{Ps.call(e,Ps)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function vS(e){if(!Mh||!e||typeof e!="object")return!1;try{return Mh.call(e),!0}catch{}return!1}function bS(e){if(!Wi||!e||typeof e!="object")return!1;try{Wi.call(e);try{ji.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function wS(e){if(!Ps||!e||typeof e!="object")return!1;try{Ps.call(e,Ps);try{Cs.call(e,Cs)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function xS(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Yh(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Yh(Zl.call(e,0,t.maxStringLength),t)+r}var o=Kn.call(Kn.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,SS);return zh(o,"single",t)}function SS(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+oS.call(t.toString(16))}function ks(e){return"Object("+e+")"}function nc(e){return e+" { ? }"}function qh(e,t,n,r){var o=r?rc(n,r):yn.call(n,", ");return e+" ("+t+") {"+o+"}"}function TS(e){for(var t=0;t<e.length;t++)if(Gh(e[t],`
2
+ `)>=0)return!1;return!0}function ES(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=yn.call(Array(e.indent+1)," ");else return null;return{base:n,prev:yn.call(Array(t+1),n)}}function rc(e,t){if(e.length===0)return"";var n=`
3
3
  `+t.prev+t.base;return n+yn.call(e,","+n)+`
4
- `+t.prev}function Wi(e,t){var n=ec(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=Zn(e,o)?t(e[o],e):""}var s=typeof Xl=="function"?Xl(e):[],i;if(uo){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)Zn(e,l)&&(n&&String(Number(l))===l&&l<e.length||uo&&i["$"+l]instanceof Symbol||(Nh.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if(typeof Xl=="function")for(var c=0;c<s.length;c++)Vh.call(e,s[c])&&r.push("["+t(s[c])+"]: "+t(e[s[c]],e));return r}var qh=lo,fo=K1,CS=iS,PS=Ts,zi=qh("%WeakMap%",!0),Hi=qh("%Map%",!0),kS=fo("WeakMap.prototype.get",!0),IS=fo("WeakMap.prototype.set",!0),AS=fo("WeakMap.prototype.has",!0),OS=fo("Map.prototype.get",!0),_S=fo("Map.prototype.set",!0),DS=fo("Map.prototype.has",!0),rc=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},MS=function(e,t){var n=rc(e,t);return n&&n.value},NS=function(e,t,n){var r=rc(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},LS=function(e,t){return!!rc(e,t)},FS=function(){var t,n,r,o={assert:function(s){if(!o.has(s))throw new PS("Side channel does not contain "+CS(s))},get:function(s){if(zi&&s&&(typeof s=="object"||typeof s=="function")){if(t)return kS(t,s)}else if(Hi){if(n)return OS(n,s)}else if(r)return MS(r,s)},has:function(s){if(zi&&s&&(typeof s=="object"||typeof s=="function")){if(t)return AS(t,s)}else if(Hi){if(n)return DS(n,s)}else if(r)return LS(r,s);return!1},set:function(s,i){zi&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new zi),IS(t,s,i)):Hi?(n||(n=new Hi),_S(n,s,i)):(r||(r={key:{},next:null}),NS(r,s,i))}};return o},Kh=e=>Array.isArray(e),oc=e=>e===void 0,sc=e=>e===null,VS=Function.bind.call(Function.call,Object.prototype.toString),$S=e=>!!e&&VS(e)==="[object Error]"||e instanceof Error,Zh=(e,t)=>e instanceof t,RS=e=>{const t=typeof e;return t==="undefined"||t===null||t==="number"||t==="string"||t==="boolean"||t==="bigint"},BS=e=>Object.prototype.toString.call(e)==="[object Date]"&&Zh(e,Date),Pt={array:Kh,date:BS,empty:e=>sc(e)||oc(e)?!0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e==="":Array.isArray(e)?e.length===0:Number.isNaN(e),function:e=>typeof e=="function",instance:Zh,isError:$S,keyof:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),nan:e=>Number.isNaN(e),nil:e=>sc(e)||oc(e),null:sc,number:e=>typeof e=="number"||!Number.isNaN(e),object:e=>!Kh(e)&&typeof e=="object",primitive:RS,string:e=>typeof e=="string",undefined:oc},jS=e=>Object.keys(e),Tr=(e,t,n)=>{if(!t)return;const o=(Array.isArray(t)?t:t.match(/([^[.\]])+/g)).reduce((s,i)=>s&&s[i],e);return o===void 0?n:o};const ic="-";function WS(e){const t=HS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(i){const a=i.split(ic);return a[0]===""&&a.length!==1&&a.shift(),Xh(a,t)||zS(i)}function s(i,a){const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:s}}function Xh(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Xh(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ic);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId}const Qh=/^\[(.+)\]$/;function zS(e){if(Qh.test(e)){const t=Qh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function HS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GS(Object.entries(e.classGroups),n).forEach(([s,i])=>{ac(i,r,s,t)}),r}function ac(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Jh(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(US(o)){ac(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ac(i,Jh(t,s),n,r)})})}function Jh(e,t){let n=e;return t.split(ic).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function US(e){return e.isThemeGetter}function GS(e,t){return t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e}function YS(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}}const ep="!";function qS(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length;function i(a){const l=[];let c=0,u=0,d;for(let y=0;y<a.length;y++){let b=a[y];if(c===0){if(b===o&&(r||a.slice(y,y+s)===t)){l.push(a.slice(u,y)),u=y+s;continue}if(b==="/"){d=y;continue}}b==="["?c++:b==="]"&&c--}const f=l.length===0?a:a.substring(u),h=f.startsWith(ep),m=h?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}}return n?function(l){return n({className:l,parseClassName:i})}:i}function KS(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function ZS(e){return{cache:YS(e.cacheSize),parseClassName:qS(e),...WS(e)}}const XS=/\s+/;function QS(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=new Set;return e.trim().split(XS).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(i);let d=!!u,f=r(d?c.substring(0,u):c);if(!f){if(!d)return{isTailwindClass:!1,originalClassName:i};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:i};d=!1}const h=KS(a).join(":");return{isTailwindClass:!0,modifierId:l?h+ep:h,classGroupId:f,originalClassName:i,hasPostfixModifier:d}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=i,u=a+l;return s.has(u)?!1:(s.add(u),o(l,c).forEach(d=>s.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function JS(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=tp(t))&&(r&&(r+=" "),r+=n);return r}function tp(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=tp(e[r]))&&(n&&(n+=" "),n+=t);return n}function eT(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return n=ZS(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=QS(l,n);return o(l,u),u}return function(){return s(JS.apply(null,arguments))}}function Ze(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const np=/^\[(?:([a-z-]+):)?(.+)\]$/i,tT=/^\d+\/\d+$/,nT=new Set(["px","full","screen"]),rT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,iT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $n(e){return Er(e)||nT.has(e)||tT.test(e)}function Qn(e){return ho(e,"length",mT)}function Er(e){return!!e&&!Number.isNaN(Number(e))}function Ui(e){return ho(e,"number",Er)}function Is(e){return!!e&&Number.isInteger(Number(e))}function lT(e){return e.endsWith("%")&&Er(e.slice(0,-1))}function Se(e){return np.test(e)}function Jn(e){return rT.test(e)}const cT=new Set(["length","size","percentage"]);function uT(e){return ho(e,cT,rp)}function dT(e){return ho(e,"position",rp)}const fT=new Set(["image","url"]);function hT(e){return ho(e,fT,yT)}function pT(e){return ho(e,"",gT)}function As(){return!0}function ho(e,t,n){const r=np.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function mT(e){return oT.test(e)&&!sT.test(e)}function rp(){return!1}function gT(e){return iT.test(e)}function yT(e){return aT.test(e)}function vT(){const e=Ze("colors"),t=Ze("spacing"),n=Ze("blur"),r=Ze("brightness"),o=Ze("borderColor"),s=Ze("borderRadius"),i=Ze("borderSpacing"),a=Ze("borderWidth"),l=Ze("contrast"),c=Ze("grayscale"),u=Ze("hueRotate"),d=Ze("invert"),f=Ze("gap"),h=Ze("gradientColorStops"),m=Ze("gradientColorStopPositions"),p=Ze("inset"),y=Ze("margin"),b=Ze("opacity"),v=Ze("padding"),g=Ze("saturate"),T=Ze("scale"),S=Ze("sepia"),E=Ze("skew"),C=Ze("space"),I=Ze("translate"),A=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",Se,t],_=()=>[Se,t],V=()=>["",$n,Qn],k=()=>["auto",Er,Se],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Se],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Er,Ui],Z=()=>[Er,Se];return{cacheSize:500,separator:":",theme:{colors:[As],spacing:[$n,Qn],blur:["none","",Jn,Se],brightness:B(),borderColor:[e],borderRadius:["none","","full",Jn,Se],borderSpacing:_(),borderWidth:V(),contrast:B(),grayscale:z(),hueRotate:Z(),invert:z(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[lT,Qn],inset:F(),margin:F(),opacity:B(),padding:_(),saturate:B(),scale:B(),sepia:z(),skew:Z(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[Jn]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),Se]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Is,Se]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Is,Se]}],"grid-cols":[{"grid-cols":[As]}],"col-start-end":[{col:["auto",{span:["full",Is,Se]},Se]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[As]}],"row-start-end":[{row:["auto",{span:[Is,Se]},Se]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,t]}],"min-w":[{"min-w":[Se,t,"min","max","fit"]}],"max-w":[{"max-w":[Se,t,"none","full","min","max","fit","prose",{screen:[Jn]},Jn]}],h:[{h:[Se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jn,Qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ui]}],"font-family":[{font:[As]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Se]}],"line-clamp":[{"line-clamp":["none",Er,Ui]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$n,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$n,Qn]}],"underline-offset":[{"underline-offset":["auto",$n,Se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),dT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:L()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[$n,Se]}],"outline-w":[{outline:[$n,Qn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[$n,Qn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jn,pT]}],"shadow-color":[{shadow:[As]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...N(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Jn,Se]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Se]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Is,Se]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$n,Qn,Ui]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const bT=eT(vT),lc=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n!==null&&(n.current=t)})},wT=e=>e.$$typeof===Symbol.for("react.forward_ref")||e.$$typeof===Symbol.for("react.fragment")?!0:e.$$typeof===Symbol.for("react.element"),xT=e=>Pt.function(e),Me=(...e)=>bT(Xx(e)),cc=(e,t)=>{const n=new Event("input",{bubbles:!0,composed:!0});return e==null||e.dispatchEvent(n),Object.assign({},n,{target:e,currentTarget:e})},Os=e=>{const t=()=>e.setAttribute("data-initialized","true");return e.addEventListener("focus",t),()=>e.removeEventListener("focus",t)},en=(e,t=2)=>e.toString(16).padStart(t,"0"),_s=()=>{const e=Date.now(),t=e/1e3&4095|28672,n=e%1e3,r=new Uint8Array(10);for(let o=0;o<r.length;o++)r[o]=Math.floor(Math.random()*256);return r[0]=r[0]&63|128,`${en(t,4)+en(n,3)}-${en(r[0])+en(r[1])}-${en(r[2])+en(r[3])}-${en(r[4])+en(r[5])}-${en(r[6])+en(r[7])+en(r[8])+en(r[9])}`},op=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),sp={basic:/[,[\]]+?/,extend:/[,[\].]+?/},uc=(e,t)=>{const n=op(t,sp.basic,e)||op(t,sp.extend,e);return n===void 0||n===e?void 0:n},Gi=()=>typeof window>"u",dc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ip=(e,t)=>{const n=[];for(let r=0;r<t;r++){const o=r*t,s=e.slice(o,o+t);s.length>0&&n.push(s)}return n};function ap(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ap(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ST(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ap(e))&&(r&&(r+=" "),r+=t);return r}const lp=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,cp=ST,po=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=s==null?void 0:s[c];if(u===null)return null;const f=lp(u)||lp(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...c,d,f]:c},[]);return cp(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},mo=w.forwardRef(function({as:t,children:n,...r},o){const s=t||"span";return x.jsx(s,{ref:o,...r,children:n})}),TT=po("relative overflow-hidden inline-flex duration-500 enabled:hover:bg-opacity-70 enabled:focus:bg-opacity-70 data-[loading=true]:opacity-30 data-[loading=true]:animate-pulse gap-1.5 items-center justify-center align-middle cursor-pointer whitespace-nowrap font-medium transition-colors ease-in disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring",{variants:{size:{icon:"p-1",big:"h-12 px-6 py-4",default:"h-10 px-4 py-2",min:"h-7 px-3 py-1 text-sm",small:"h-8 px-4 py-2 text-sm"},rounded:{rough:"rounded-sm",squared:"rounded-none",default:"rounded-button",circle:"rounded-full aspect-square"},theme:{raw:"",disabled:"bg-disabled opacity-70",loading:"animate-pulse bg-disabled",main:"bg-primary text-primary-foreground",info:"bg-button-info-bg text-button-info-text",warn:"bg-button-warn-bg text-button-warn-text",muted:"bg-button-muted-bg text-button-muted-text",danger:"bg-button-danger-bg text-button-danger-text",neutral:"bg-transparent border-2 border-card-border",primary:"bg-button-primary-bg text-button-primary-text",success:"bg-button-success-bg text-button-success-text",secondary:"bg-button-secondary-bg text-button-secondary-text","ghost-info":"bg-transparent hover:bg-info/20 border border-info text-info","ghost-warn":"bg-transparent hover:bg-warn/20 border border-warn text-warn","ghost-danger":"bg-transparent hover:bg-danger/20 border border-danger text-danger","ghost-primary":"bg-transparent hover:bg-primary/20 border border-primary text-primary","ghost-success":"bg-transparent hover:bg-success/20 border border-success text-success","ghost-secondary":"bg-transparent hover:bg-secondary/20 border border-secondary text-secondary"}},defaultVariants:{theme:"main",size:"default",rounded:"default"}}),go=w.forwardRef(function({className:t,icon:n,loading:r,theme:o,type:s="button",size:i,rounded:a,...l},c){const u=r||l.disabled;return x.jsxs(mo,{...l,ref:c,type:s,"data-theme":o,disabled:u,"data-loading":r,"data-component":"button","aria-disabled":u,as:l.as??"button","aria-busy":u||r,onClick:u?void 0:l.onClick,className:Me(TT({size:i,rounded:a,theme:o}),t),children:[n,l.children]})}),up=e=>{const t=w.useRef(e);return w.useEffect(()=>{t.current=e},[e]),t};function ET(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}const CT=({children:e,...t})=>{const n=up(t.onIntersection),r=w.useRef(null),[o,s]=w.useState(()=>r.current===null?!1:ET(r.current));return w.useLayoutEffect(()=>{const i=r.current;if(i===null)return;const a=new IntersectionObserver(l=>{var u;const c=l[0];return c.isIntersecting&&((u=n.current)==null||u.call(n)),s(d=>c.isIntersecting?!0:d)});return a.observe(i),()=>a.disconnect()},[]),x.jsx("div",{...t,ref:r,children:o?e:null})},PT=po("size-2.5 aspect-square rounded-full border-0",{variants:{theme:{info:"bg-info",warn:"bg-warn",muted:"bg-muted",main:"bg-primary",danger:"bg-danger",success:"bg-success",secondary:"bg-secondary"}}}),kT=po("inline-flex rounded-pill gap-1.5 border-2 border-transparent items-center justify-center align-middle whitespace-nowrap",{variants:{size:{icon:"p-1",big:"h-12 px-6 py-4",default:"h-8 px-4 py-2",small:"h-6 p-2 px-3 text-sm"},theme:{primary:"bg-tag-primary-bg text-tag-primary-text",danger:"bg-tag-danger-bg text-tag-danger-text",info:"bg-tag-info-bg text-tag-info-text",success:"bg-tag-success-bg text-tag-success-text",secondary:"bg-tag-secondary-bg text-tag-secondary-text",warn:"bg-tag-warn-bg text-tag-warn-text",muted:"bg-tag-muted-bg text-tag-muted-text",neutral:"bg-transparent border border-card-border",disabled:"bg-disabled duration-700 opacity-70",loading:"animate-pulse bg-disabled duration-700 opacity-70"}},defaultVariants:{theme:"primary",size:"default"}}),fc=w.forwardRef(function({className:t,indicator:n=void 0,icon:r,loading:o,theme:s,size:i,...a},l){return x.jsxs(mo,{...a,ref:l,"data-theme":s,"data-component":"tag",as:a.as??"span",className:Me(kT({size:i,theme:s}),t),children:[n?x.jsx("span",{className:PT({theme:n})}):null,r,a.children]})}),Ds=w.createContext({});function an(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yi=w.createContext(null),yo=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class IT extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function AT({children:e,isPresent:t,anchorX:n}){const r=w.useId(),o=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=w.useContext(yo);return w.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:d}=s.current;if(t||!o.current||!a||!l)return;const f=n==="left"?`left: ${u}`:`right: ${d}`;o.current.dataset.motionPopId=r;const h=document.createElement("style");return i&&(h.nonce=i),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
4
+ `+t.prev}function zi(e,t){var n=tc(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=Zn(e,o)?t(e[o],e):""}var s=typeof Ql=="function"?Ql(e):[],i;if(uo){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)Zn(e,l)&&(n&&String(Number(l))===l&&l<e.length||uo&&i["$"+l]instanceof Symbol||(Lh.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if(typeof Ql=="function")for(var c=0;c<s.length;c++)$h.call(e,s[c])&&r.push("["+t(s[c])+"]: "+t(e[s[c]],e));return r}var Kh=lo,fo=K1,CS=iS,PS=Ts,Hi=Kh("%WeakMap%",!0),Ui=Kh("%Map%",!0),kS=fo("WeakMap.prototype.get",!0),IS=fo("WeakMap.prototype.set",!0),AS=fo("WeakMap.prototype.has",!0),OS=fo("Map.prototype.get",!0),_S=fo("Map.prototype.set",!0),DS=fo("Map.prototype.has",!0),oc=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},MS=function(e,t){var n=oc(e,t);return n&&n.value},NS=function(e,t,n){var r=oc(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},LS=function(e,t){return!!oc(e,t)},FS=function(){var t,n,r,o={assert:function(s){if(!o.has(s))throw new PS("Side channel does not contain "+CS(s))},get:function(s){if(Hi&&s&&(typeof s=="object"||typeof s=="function")){if(t)return kS(t,s)}else if(Ui){if(n)return OS(n,s)}else if(r)return MS(r,s)},has:function(s){if(Hi&&s&&(typeof s=="object"||typeof s=="function")){if(t)return AS(t,s)}else if(Ui){if(n)return DS(n,s)}else if(r)return LS(r,s);return!1},set:function(s,i){Hi&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Hi),IS(t,s,i)):Ui?(n||(n=new Ui),_S(n,s,i)):(r||(r={key:{},next:null}),NS(r,s,i))}};return o},Zh=e=>Array.isArray(e),sc=e=>e===void 0,ic=e=>e===null,VS=Function.bind.call(Function.call,Object.prototype.toString),$S=e=>!!e&&VS(e)==="[object Error]"||e instanceof Error,Xh=(e,t)=>e instanceof t,RS=e=>{const t=typeof e;return t==="undefined"||t===null||t==="number"||t==="string"||t==="boolean"||t==="bigint"},BS=e=>Object.prototype.toString.call(e)==="[object Date]"&&Xh(e,Date),Pt={array:Zh,date:BS,empty:e=>ic(e)||sc(e)?!0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e==="":Array.isArray(e)?e.length===0:Number.isNaN(e),function:e=>typeof e=="function",instance:Xh,isError:$S,keyof:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),nan:e=>Number.isNaN(e),nil:e=>ic(e)||sc(e),null:ic,number:e=>typeof e=="number"||!Number.isNaN(e),object:e=>!Zh(e)&&typeof e=="object",primitive:RS,string:e=>typeof e=="string",undefined:sc},jS=e=>Object.keys(e),Tr=(e,t,n)=>{if(!t)return;const o=(Array.isArray(t)?t:t.match(/([^[.\]])+/g)).reduce((s,i)=>s&&s[i],e);return o===void 0?n:o};const ac="-";function WS(e){const t=HS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(i){const a=i.split(ac);return a[0]===""&&a.length!==1&&a.shift(),Qh(a,t)||zS(i)}function s(i,a){const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:s}}function Qh(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Qh(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ac);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId}const Jh=/^\[(.+)\]$/;function zS(e){if(Jh.test(e)){const t=Jh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function HS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GS(Object.entries(e.classGroups),n).forEach(([s,i])=>{lc(i,r,s,t)}),r}function lc(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ep(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(US(o)){lc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{lc(i,ep(t,s),n,r)})})}function ep(e,t){let n=e;return t.split(ac).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function US(e){return e.isThemeGetter}function GS(e,t){return t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e}function YS(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}}const tp="!";function qS(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length;function i(a){const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let b=a[v];if(c===0){if(b===o&&(r||a.slice(v,v+s)===t)){l.push(a.slice(u,v)),u=v+s;continue}if(b==="/"){d=v;continue}}b==="["?c++:b==="]"&&c--}const f=l.length===0?a:a.substring(u),h=f.startsWith(tp),m=h?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}}return n?function(l){return n({className:l,parseClassName:i})}:i}function KS(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function ZS(e){return{cache:YS(e.cacheSize),parseClassName:qS(e),...WS(e)}}const XS=/\s+/;function QS(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=new Set;return e.trim().split(XS).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(i);let d=!!u,f=r(d?c.substring(0,u):c);if(!f){if(!d)return{isTailwindClass:!1,originalClassName:i};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:i};d=!1}const h=KS(a).join(":");return{isTailwindClass:!0,modifierId:l?h+tp:h,classGroupId:f,originalClassName:i,hasPostfixModifier:d}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=i,u=a+l;return s.has(u)?!1:(s.add(u),o(l,c).forEach(d=>s.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function JS(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=np(t))&&(r&&(r+=" "),r+=n);return r}function np(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=np(e[r]))&&(n&&(n+=" "),n+=t);return n}function eT(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return n=ZS(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=QS(l,n);return o(l,u),u}return function(){return s(JS.apply(null,arguments))}}function Ze(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const rp=/^\[(?:([a-z-]+):)?(.+)\]$/i,tT=/^\d+\/\d+$/,nT=new Set(["px","full","screen"]),rT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,iT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $n(e){return Er(e)||nT.has(e)||tT.test(e)}function Qn(e){return ho(e,"length",mT)}function Er(e){return!!e&&!Number.isNaN(Number(e))}function Gi(e){return ho(e,"number",Er)}function Is(e){return!!e&&Number.isInteger(Number(e))}function lT(e){return e.endsWith("%")&&Er(e.slice(0,-1))}function Se(e){return rp.test(e)}function Jn(e){return rT.test(e)}const cT=new Set(["length","size","percentage"]);function uT(e){return ho(e,cT,op)}function dT(e){return ho(e,"position",op)}const fT=new Set(["image","url"]);function hT(e){return ho(e,fT,yT)}function pT(e){return ho(e,"",gT)}function As(){return!0}function ho(e,t,n){const r=rp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function mT(e){return oT.test(e)&&!sT.test(e)}function op(){return!1}function gT(e){return iT.test(e)}function yT(e){return aT.test(e)}function vT(){const e=Ze("colors"),t=Ze("spacing"),n=Ze("blur"),r=Ze("brightness"),o=Ze("borderColor"),s=Ze("borderRadius"),i=Ze("borderSpacing"),a=Ze("borderWidth"),l=Ze("contrast"),c=Ze("grayscale"),u=Ze("hueRotate"),d=Ze("invert"),f=Ze("gap"),h=Ze("gradientColorStops"),m=Ze("gradientColorStopPositions"),p=Ze("inset"),v=Ze("margin"),b=Ze("opacity"),y=Ze("padding"),g=Ze("saturate"),T=Ze("scale"),S=Ze("sepia"),E=Ze("skew"),C=Ze("space"),I=Ze("translate"),A=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Se,t],_=()=>[Se,t],V=()=>["",$n,Qn],k=()=>["auto",Er,Se],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Se],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Er,Gi],Z=()=>[Er,Se];return{cacheSize:500,separator:":",theme:{colors:[As],spacing:[$n,Qn],blur:["none","",Jn,Se],brightness:B(),borderColor:[e],borderRadius:["none","","full",Jn,Se],borderSpacing:_(),borderWidth:V(),contrast:B(),grayscale:z(),hueRotate:Z(),invert:z(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[lT,Qn],inset:L(),margin:L(),opacity:B(),padding:_(),saturate:B(),scale:B(),sepia:z(),skew:Z(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[Jn]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),Se]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Is,Se]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Is,Se]}],"grid-cols":[{"grid-cols":[As]}],"col-start-end":[{col:["auto",{span:["full",Is,Se]},Se]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[As]}],"row-start-end":[{row:["auto",{span:[Is,Se]},Se]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,t]}],"min-w":[{"min-w":[Se,t,"min","max","fit"]}],"max-w":[{"max-w":[Se,t,"none","full","min","max","fit","prose",{screen:[Jn]},Jn]}],h:[{h:[Se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jn,Qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gi]}],"font-family":[{font:[As]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Se]}],"line-clamp":[{"line-clamp":["none",Er,Gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$n,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$n,Qn]}],"underline-offset":[{"underline-offset":["auto",$n,Se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),dT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[$n,Se]}],"outline-w":[{outline:[$n,Qn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[$n,Qn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jn,pT]}],"shadow-color":[{shadow:[As]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...N(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Jn,Se]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Se]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Is,Se]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$n,Qn,Gi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const bT=eT(vT),cc=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n!==null&&(n.current=t)})},wT=e=>e.$$typeof===Symbol.for("react.forward_ref")||e.$$typeof===Symbol.for("react.fragment")?!0:e.$$typeof===Symbol.for("react.element"),xT=e=>Pt.function(e),Me=(...e)=>bT(Xx(e)),uc=(e,t)=>{const n=new Event("input",{bubbles:!0,composed:!0});return e==null||e.dispatchEvent(n),Object.assign({},n,{target:e,currentTarget:e})},Os=e=>{const t=()=>e.setAttribute("data-initialized","true");return e.addEventListener("focus",t),()=>e.removeEventListener("focus",t)},en=(e,t=2)=>e.toString(16).padStart(t,"0"),_s=()=>{const e=Date.now(),t=e/1e3&4095|28672,n=e%1e3,r=new Uint8Array(10);for(let o=0;o<r.length;o++)r[o]=Math.floor(Math.random()*256);return r[0]=r[0]&63|128,`${en(t,4)+en(n,3)}-${en(r[0])+en(r[1])}-${en(r[2])+en(r[3])}-${en(r[4])+en(r[5])}-${en(r[6])+en(r[7])+en(r[8])+en(r[9])}`},sp=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),ip={basic:/[,[\]]+?/,extend:/[,[\].]+?/},dc=(e,t)=>{const n=sp(t,ip.basic,e)||sp(t,ip.extend,e);return n===void 0||n===e?void 0:n},Yi=()=>typeof window>"u",fc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ap=(e,t)=>{const n=[];for(let r=0;r<t;r++){const o=r*t,s=e.slice(o,o+t);s.length>0&&n.push(s)}return n},ST=e=>!e,hc=()=>{};function lp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=lp(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function TT(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=lp(e))&&(r&&(r+=" "),r+=t);return r}const cp=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,up=TT,po=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return up(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=s==null?void 0:s[c];if(u===null)return null;const f=cp(u)||cp(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(m=>{let[p,v]=m;return Array.isArray(v)?v.includes({...s,...a}[p]):{...s,...a}[p]===v})?[...c,d,f]:c},[]);return up(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},ET="span",mo=w.forwardRef(function(t,n){const r=t.as||ET;return x.jsx(r,{ref:n,...t,as:void 0})}),CT=po("relative overflow-hidden inline-flex duration-500 enabled:hover:bg-opacity-70 enabled:focus:bg-opacity-70 data-[loading=true]:opacity-30 data-[loading=true]:animate-pulse gap-1.5 items-center justify-center align-middle cursor-pointer whitespace-nowrap font-medium transition-colors ease-in disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring",{variants:{size:{icon:"p-1",big:"h-12 px-6 py-4",default:"h-10 px-4 py-2",min:"h-7 px-3 py-1 text-sm",small:"h-8 px-4 py-2 text-sm"},rounded:{rough:"rounded-sm",squared:"rounded-none",default:"rounded-button",circle:"rounded-full aspect-square"},theme:{raw:"",disabled:"bg-disabled opacity-70",loading:"animate-pulse bg-disabled",main:"bg-primary text-primary-foreground",info:"bg-button-info-bg text-button-info-text",warn:"bg-button-warn-bg text-button-warn-text",muted:"bg-button-muted-bg text-button-muted-text",danger:"bg-button-danger-bg text-button-danger-text",neutral:"bg-transparent border-2 border-card-border",primary:"bg-button-primary-bg text-button-primary-text",success:"bg-button-success-bg text-button-success-text",secondary:"bg-button-secondary-bg text-button-secondary-text","ghost-info":"bg-transparent hover:bg-info/20 border border-info text-info","ghost-warn":"bg-transparent hover:bg-warn/20 border border-warn text-warn","ghost-danger":"bg-transparent hover:bg-danger/20 border border-danger text-danger","ghost-primary":"bg-transparent hover:bg-primary/20 border border-primary text-primary","ghost-success":"bg-transparent hover:bg-success/20 border border-success text-success","ghost-secondary":"bg-transparent hover:bg-secondary/20 border border-secondary text-secondary"}},defaultVariants:{theme:"main",size:"default",rounded:"default"}}),go=w.forwardRef(function({className:t,icon:n,loading:r,theme:o,type:s="button",size:i,rounded:a,...l},c){const u=r||l.disabled;return x.jsxs(mo,{...l,ref:c,type:s,"data-theme":o,disabled:u,"data-loading":r,"data-component":"button","aria-disabled":u,as:l.as??"button","aria-busy":u||r,onClick:u?void 0:l.onClick,className:Me(CT({size:i,rounded:a,theme:o}),t),children:[n,l.children]})}),Ds=e=>{const t=w.useRef(e);return w.useEffect(()=>{t.current=e},[e]),t};function PT(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}const kT=({children:e,...t})=>{const n=Ds(t.onIntersection),r=w.useRef(null),[o,s]=w.useState(()=>r.current===null?!1:PT(r.current));return w.useLayoutEffect(()=>{const i=r.current;if(i===null)return;const a=new IntersectionObserver(l=>{var u;const c=l[0];return c.isIntersecting&&((u=n.current)==null||u.call(n)),s(d=>c.isIntersecting?!0:d)});return a.observe(i),()=>a.disconnect()},[]),x.jsx("div",{...t,ref:r,children:o?e:null})},IT=po("size-2.5 aspect-square rounded-full border-0",{variants:{theme:{info:"bg-info",warn:"bg-warn",muted:"bg-muted",main:"bg-primary",danger:"bg-danger",success:"bg-success",secondary:"bg-secondary"}}}),AT=po("inline-flex rounded-pill gap-1.5 border-2 border-transparent items-center justify-center align-middle whitespace-nowrap",{variants:{size:{icon:"p-1",big:"h-12 px-6 py-4",default:"h-8 px-4 py-2",small:"h-6 p-2 px-3 text-sm"},theme:{primary:"bg-tag-primary-bg text-tag-primary-text",danger:"bg-tag-danger-bg text-tag-danger-text",info:"bg-tag-info-bg text-tag-info-text",success:"bg-tag-success-bg text-tag-success-text",secondary:"bg-tag-secondary-bg text-tag-secondary-text",warn:"bg-tag-warn-bg text-tag-warn-text",muted:"bg-tag-muted-bg text-tag-muted-text",neutral:"bg-transparent border border-card-border",disabled:"bg-disabled duration-700 opacity-70",loading:"animate-pulse bg-disabled duration-700 opacity-70"}},defaultVariants:{theme:"primary",size:"default"}}),pc=w.forwardRef(function({className:t,indicator:n=void 0,icon:r,loading:o,theme:s,size:i,...a},l){return x.jsxs(mo,{...a,ref:l,"data-theme":s,"data-component":"tag",as:a.as??"span",className:Me(AT({size:i,theme:s}),t),children:[n?x.jsx("span",{className:IT({theme:n})}):null,r,a.children]})}),Ms=w.createContext({});function an(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const qi=w.createContext(null),yo=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class OT extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function _T({children:e,isPresent:t,anchorX:n}){const r=w.useId(),o=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=w.useContext(yo);return w.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:d}=s.current;if(t||!o.current||!a||!l)return;const f=n==="left"?`left: ${u}`:`right: ${d}`;o.current.dataset.motionPopId=r;const h=document.createElement("style");return i&&(h.nonce=i),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
5
5
  [data-motion-pop-id="${r}"] {
6
6
  position: absolute !important;
7
7
  width: ${a}px !important;
@@ -9,37 +9,37 @@
9
9
  ${f}px !important;
10
10
  top: ${c}px !important;
11
11
  }
12
- `),()=>{document.head.removeChild(h)}},[t]),x.jsx(IT,{isPresent:t,childRef:o,sizeRef:s,children:P.cloneElement(e,{ref:o})})}const OT=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a})=>{const l=an(_T),c=w.useId(),u=w.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=w.useMemo(()=>({id:c,initial:t,isPresent:n,custom:o,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return w.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),P.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(e=x.jsx(AT,{isPresent:n,anchorX:a,children:e})),x.jsx(Yi.Provider,{value:d,children:e})};function _T(){return new Map}function dp(e=!0){const t=w.useContext(Yi);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const qi=e=>e.key||"";function fp(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const hc=typeof window<"u",Ki=hc?w.useLayoutEffect:w.useEffect,er=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left"})=>{const[l,c]=dp(i),u=w.useMemo(()=>fp(e),[e]),d=i&&!l?[]:u.map(qi),f=w.useRef(!0),h=w.useRef(u),m=an(()=>new Map),[p,y]=w.useState(u),[b,v]=w.useState(u);Ki(()=>{f.current=!1,h.current=u;for(let S=0;S<b.length;S++){const E=qi(b[S]);d.includes(E)?m.delete(E):m.get(E)!==!0&&m.set(E,!1)}},[b,d.length,d.join("-")]);const g=[];if(u!==p){let S=[...u];for(let E=0;E<b.length;E++){const C=b[E],I=qi(C);d.includes(I)||(S.splice(E,0,C),g.push(C))}return s==="wait"&&g.length&&(S=g),v(fp(S)),y(u),null}process.env.NODE_ENV!=="production"&&s==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=w.useContext(Ds);return x.jsx(x.Fragment,{children:b.map(S=>{const E=qi(S),C=i&&!l?!1:u===b||d.includes(E),I=()=>{if(m.has(E))m.set(E,!0);else return;let A=!0;m.forEach(O=>{O||(A=!1)}),A&&(T==null||T(),v(h.current),i&&(c==null||c()),r&&r())};return x.jsx(OT,{isPresent:C,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,onExitComplete:C?void 0:I,anchorX:a,children:S},E)})})},DT=w.createContext(null);function MT(){const e=w.useRef(!1);return Ki(()=>(e.current=!0,()=>{e.current=!1}),[]),e}const zt=e=>e;let vo=zt,tn=zt;process.env.NODE_ENV!=="production"&&(vo=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},tn=(e,t)=>{if(!e)throw new Error(t)});const NT={skipAnimations:!1,useManualTiming:!1},Zi=["read","resolveKeyframes","update","preRender","render","postRender"],hp={value:null,addProjectionMetrics:null};function LT(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const p=h&&o?n:r;return f&&i.add(d),p.has(d)||p.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&hp.value&&hp.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const FT=40;function pp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Zi.reduce((b,v)=>(b[v]=LT(s,t?v:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,h=()=>{const b=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(b-o.timestamp,FT),1),o.timestamp=b,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},m=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Zi.reduce((b,v)=>{const g=i[v];return b[v]=(T,S=!1,E=!1)=>(n||m(),g.schedule(T,S,E)),b},{}),cancel:b=>{for(let v=0;v<Zi.length;v++)i[Zi[v]].cancel(b)},state:o,steps:i}}const{schedule:Ue,cancel:Rn,state:kt,steps:pc}=pp(typeof requestAnimationFrame<"u"?requestAnimationFrame:zt,!0);function VT(){const e=MT(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ue.postRender(r),[r]),t]}const $T=e=>!e.isLayoutDirty&&e.willUpdate(!1);function mp(){const e=new Set,t=new WeakMap,n=()=>e.forEach($T);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const gp=e=>e===!0,RT=e=>gp(e===!0)||e==="id",BT=({children:e,id:t,inherit:n=!0})=>{const r=w.useContext(Ds),o=w.useContext(DT),[s,i]=VT(),a=w.useRef(null),l=r.id||o;a.current===null&&(RT(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:gp(n)&&r.group||mp()});const c=w.useMemo(()=>({...a.current,forceRender:s}),[i]);return x.jsx(Ds.Provider,{value:c,children:e})},yp=w.createContext({strict:!1}),vp={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"]},bo={};for(const e in vp)bo[e]={isEnabled:t=>vp[e].some(n=>!!t[n])};function jT(e){for(const t in e)bo[t]={...bo[t],...e[t]}}const WT=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","ignoreStrict","viewport"]);function Xi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||WT.has(e)}let bp=e=>!Xi(e);function wp(e){e&&(bp=t=>t.startsWith("on")?!Xi(t):e(t))}try{wp(require("@emotion/is-prop-valid").default)}catch{}function zT(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(bp(o)||n===!0&&Xi(o)||!t&&!Xi(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function HT({children:e,isValidProp:t,...n}){t&&wp(t),n={...w.useContext(yo),...n},n.isStatic=an(()=>n.isStatic);const r=w.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return x.jsx(yo.Provider,{value:r,children:e})}const xp=new Set;function Qi(e,t,n){e||xp.has(t)||(console.warn(t),xp.add(t))}function UT(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Qi(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Ji=w.createContext({});function ea(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ms(e){return typeof e=="string"||Array.isArray(e)}const mc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gc=["initial",...mc];function ta(e){return ea(e.animate)||gc.some(t=>Ms(e[t]))}function Sp(e){return!!(ta(e)||e.variants)}function GT(e,t){if(ta(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ms(n)?n:void 0,animate:Ms(r)?r:void 0}}return e.inherit!==!1?t:{}}function YT(e){const{initial:t,animate:n}=GT(e,w.useContext(Ji));return w.useMemo(()=>({initial:t,animate:n}),[Tp(t),Tp(n)])}function Tp(e){return Array.isArray(e)?e.join(" "):e}const qT=Symbol.for("motionComponentSymbol");function wo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KT(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):wo(n)&&(n.current=r))},[t])}const yc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ep="data-"+yc("framerAppearId"),{schedule:vc,cancel:uB}=pp(queueMicrotask,!1),Cp=w.createContext({});function ZT(e,t,n,r,o){var s,i;const{visualElement:a}=w.useContext(Ji),l=w.useContext(yp),c=w.useContext(Yi),u=w.useContext(yo).reducedMotion,d=w.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,h=w.useContext(Cp);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&XT(d.current,n,o,h);const m=w.useRef(!1);w.useInsertionEffect(()=>{f&&m.current&&f.update(n,c)});const p=n[Ep],y=w.useRef(!!p&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,p))&&((i=window.MotionHasOptimisedAnimation)===null||i===void 0?void 0:i.call(window,p)));return Ki(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),vc.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),w.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,p)}),y.current=!1))}),f}function XT(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Pp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&wo(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Pp(e){if(e)return e.options.allowProjection!==!1?e.projection:Pp(e.parent)}function QT({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;e&&jT(e);function a(c,u){let d;const f={...w.useContext(yo),...c,layoutId:JT(c)},{isStatic:h}=f,m=YT(c),p=r(c,h);if(!h&&hc){eE(f,e);const y=tE(f);d=y.MeasureLayout,m.visualElement=ZT(o,p,f,t,y.ProjectionNode)}return x.jsxs(Ji.Provider,{value:m,children:[d&&m.visualElement?x.jsx(d,{visualElement:m.visualElement,...f}):null,n(o,c,KT(p,m.visualElement,u),p,h,m.visualElement)]})}a.displayName=`motion.${typeof o=="string"?o:`create(${(i=(s=o.displayName)!==null&&s!==void 0?s:o.name)!==null&&i!==void 0?i:""})`}`;const l=w.forwardRef(a);return l[qT]=o,l}function JT({layoutId:e}){const t=w.useContext(Ds).id;return t&&e!==void 0?t+"-"+e:e}function eE(e,t){const n=w.useContext(yp).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?vo(!1,r):tn(!1,r)}}function tE(e){const{drag:t,layout:n}=bo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const kp=e=>t=>typeof t=="string"&&t.startsWith(e),bc=kp("--"),nE=kp("var(--"),wc=e=>nE(e)?rE.test(e.split("/*")[0].trim()):!1,rE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ns={};function oE(e){for(const t in e)Ns[t]=e[t],bc(t)&&(Ns[t].isCSSVariable=!0)}const xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cr=new Set(xo);function Ip(e,{layout:t,layoutId:n}){return Cr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ns[e]||e==="opacity")}const vt=e=>!!(e&&e.getVelocity),Ap=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Bn=(e,t,n)=>n>t?t:n<e?e:n,So={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ls={...So,transform:e=>Bn(0,1,e)},na={...So,default:1},Fs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tr=Fs("deg"),vn=Fs("%"),me=Fs("px"),sE=Fs("vh"),iE=Fs("vw"),Op={...vn,parse:e=>vn.parse(e)/100,transform:e=>vn.transform(e*100)},aE={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,backgroundPositionX:me,backgroundPositionY:me},lE={rotate:tr,rotateX:tr,rotateY:tr,rotateZ:tr,scale:na,scaleX:na,scaleY:na,scaleZ:na,skew:tr,skewX:tr,skewY:tr,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:Ls,originX:Op,originY:Op,originZ:me},_p={...So,transform:Math.round},xc={...aE,...lE,zIndex:_p,size:me,fillOpacity:Ls,strokeOpacity:Ls,numOctaves:_p},cE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},uE=xo.length;function dE(e,t,n){let r="",o=!0;for(let s=0;s<uE;s++){const i=xo[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ap(a,xc[i]);if(!l){o=!1;const u=cE[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Sc(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(Cr.has(l)){i=!0;continue}else if(bc(l)){o[l]=c;continue}else{const u=Ap(c,xc[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=dE(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Tc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Dp(e,t,n){for(const r in t)!vt(t[r])&&!Ip(r,n)&&(e[r]=t[r])}function fE({transformTemplate:e},t){return w.useMemo(()=>{const n=Tc();return Sc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function hE(e,t){const n=e.style||{},r={};return Dp(r,n,e),Object.assign(r,fE(e,t)),r}function pE(e,t){const n={},r=hE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const mE=["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 Ec(e){return typeof e!="string"||e.includes("-")?!1:!!(mE.indexOf(e)>-1||/[A-Z]/u.test(e))}const gE={offset:"stroke-dashoffset",array:"stroke-dasharray"},yE={offset:"strokeDashoffset",array:"strokeDasharray"};function vE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?gE:yE;e[s.offset]=me.transform(-r);const i=me.transform(t),a=me.transform(n);e[s.array]=`${i} ${a}`}function Mp(e,t,n){return typeof e=="string"?e:me.transform(t+n*e)}function bE(e,t,n){const r=Mp(t,e.x,e.width),o=Mp(n,e.y,e.height);return`${r} ${o}`}function Cc(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Sc(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:m}=e;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(o!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=bE(m,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&vE(f,i,a,l,!1)}const Np=()=>({...Tc(),attrs:{}}),Pc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wE(e,t,n,r){const o=w.useMemo(()=>{const s=Np();return Cc(s,t,Pc(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Dp(s,e.style,e),o.style={...s,...o.style}}return o}function xE(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(Ec(n)?wE:pE)(r,s,i,n),c=zT(r,typeof n=="string",e),u=n!==w.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=w.useMemo(()=>vt(d)?d.get():d,[d]);return w.createElement(n,{...u,children:f})}}function Lp(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function kc(e,t,n,r){if(typeof t=="function"){const[o,s]=Lp(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Lp(r);t=t(n!==void 0?n:e.custom,o,s)}return t}const Ic=e=>Array.isArray(e),SE=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),TE=e=>Ic(e)?e[e.length-1]||0:e;function ra(e){const t=vt(e)?e.get():e;return SE(t)?t.toValue():t}function EE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:CE(r,o,s,e),renderState:t()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const Fp=e=>(t,n)=>{const r=w.useContext(Ji),o=w.useContext(Yi),s=()=>EE(e,t,r,o);return n?s():an(s)};function CE(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=ra(s[f]);let{initial:i,animate:a}=e;const l=ta(e),c=Sp(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!ea(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=kc(e,f[h]);if(m){const{transitionEnd:p,transition:y,...b}=m;for(const v in b){let g=b[v];if(Array.isArray(g)){const T=u?g.length-1:0;g=g[T]}g!==null&&(o[v]=g)}for(const v in p)o[v]=p[v]}}}return o}function Ac(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(vt(o[i])||t.style&&vt(t.style[i])||Ip(i,e)||((r=n==null?void 0:n.getValue(i))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[i]=o[i]);return s}const PE={useVisualState:Fp({scrapeMotionValuesFromProps:Ac,createRenderState:Tc})};function Vp(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $p(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Rp=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"]);function Bp(e,t,n,r){$p(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Rp.has(o)?o:yc(o),t.attrs[o])}function jp(e,t,n){const r=Ac(e,t,n);for(const o in e)if(vt(e[o])||vt(t[o])){const s=xo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const Wp=["x","y","width","height","cx","cy","r"],kE={useVisualState:Fp({scrapeMotionValuesFromProps:jp,createRenderState:Np,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in o)if(Cr.has(a)){s=!0;break}}if(!s)return;let i=!t;if(t)for(let a=0;a<Wp.length;a++){const l=Wp[a];e[l]!==t[l]&&(i=!0)}i&&Ue.read(()=>{Vp(n,r),Ue.render(()=>{Cc(r,o,Pc(n.tagName),e.transformTemplate),Bp(n,r)})})}})};function IE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...Ec(r)?kE:PE,preloadedFeatures:e,useRender:xE(o),createVisualElement:t,Component:r};return QT(i)}}function Vs(e,t,n){const r=e.getProps();return kc(r,t,n!==void 0?n:r.custom,e)}function Oc(e,t){return e?e[t]||e.default||e:void 0}const zp=new Set(["width","height","top","left","right","bottom",...xo]);let oa;function AE(){oa=void 0}const bn={now:()=>(oa===void 0&&bn.set(kt.isProcessing||NT.useManualTiming?kt.timestamp:performance.now()),oa),set:e=>{oa=e,queueMicrotask(AE)}};function _c(e,t){e.indexOf(t)===-1&&e.push(t)}function sa(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function OE([...e],t,n){const r=t<0?e.length+t:t;if(r>=0&&r<e.length){const o=n<0?e.length+n:n,[s]=e.splice(t,1);e.splice(o,0,s)}return e}class Dc{constructor(){this.subscriptions=[]}add(t){return _c(this.subscriptions,t),()=>sa(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Hp(e,t){return t?e*(1e3/t):0}const Up=30,_E=e=>!isNaN(parseFloat(e)),$s={current:void 0};class DE{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const s=bn.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_E(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Qi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Dc);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return $s.current&&$s.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Up)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Up);return Hp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function To(e,t){return new DE(e,t)}function ME(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,To(n))}function NE(e,t){const n=Vs(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=TE(s[i]);ME(e,i,a)}}function LE(e){return!!(vt(e)&&e.add)}function Mc(e,t){const n=e.getValue("willChange");if(LE(n))return n.add(t)}function Gp(e){return e.props[Ep]}function Nc(e){let t;return()=>(t===void 0&&(t=e()),t)}const FE=Nc(()=>window.ScrollTimeline!==void 0);class VE{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(FE()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,s)=>{o&&o(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Yp extends VE{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const ln=e=>e*1e3,wn=e=>e/1e3;function ia(e){return typeof e=="function"}function qp(e,t){e.timeline=t,e.onfinish=null}const Lc=e=>Array.isArray(e)&&typeof e[0]=="number",$E={linearEasing:void 0};function RE(e,t){const n=Nc(e);return()=>{var r;return(r=$E[t])!==null&&r!==void 0?r:n()}}const aa=RE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Kp=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(Pr(0,o-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Zp(e){return!!(typeof e=="function"&&aa()||!e||typeof e=="string"&&(e in Fc||aa())||Lc(e)||Array.isArray(e)&&e.every(Zp))}const Rs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Fc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rs([0,.65,.55,1]),circOut:Rs([.55,0,1,.45]),backIn:Rs([.31,.01,.66,-.59]),backOut:Rs([.33,1.53,.69,.99])};function Xp(e,t){if(e)return typeof e=="function"&&aa()?Kp(e,t):Lc(e)?Rs(e):Array.isArray(e)?e.map(n=>Xp(n,t)||Fc.easeOut):Fc[e]}const Qp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,BE=1e-7,jE=12;function WE(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Qp(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>BE&&++a<jE);return i}function Bs(e,t,n,r){if(e===t&&n===r)return zt;const o=s=>WE(s,0,1,e,n);return s=>s===0||s===1?s:Qp(o(s),t,r)}const Jp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,em=e=>t=>1-e(1-t),tm=Bs(.33,1.53,.69,.99),Vc=em(tm),nm=Jp(Vc),rm=e=>(e*=2)<1?.5*Vc(e):.5*(2-Math.pow(2,-10*(e-1))),$c=e=>1-Math.sin(Math.acos(e)),om=em($c),sm=Jp($c),im=e=>/^0[^.\s]+$/u.test(e);function zE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||im(e):!0}const js=e=>Math.round(e*1e5)/1e5,Rc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HE(e){return e==null}const UE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bc=(e,t)=>n=>!!(typeof n=="string"&&UE.test(n)&&n.startsWith(e)||t&&!HE(n)&&Object.prototype.hasOwnProperty.call(n,t)),am=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Rc);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},GE=e=>Bn(0,255,e),jc={...So,transform:e=>Math.round(GE(e))},kr={test:Bc("rgb","red"),parse:am("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+jc.transform(e)+", "+jc.transform(t)+", "+jc.transform(n)+", "+js(Ls.transform(r))+")"};function YE(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Wc={test:Bc("#"),parse:YE,transform:kr.transform},Eo={test:Bc("hsl","hue"),parse:am("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vn.transform(js(t))+", "+vn.transform(js(n))+", "+js(Ls.transform(r))+")"},Dt={test:e=>kr.test(e)||Wc.test(e)||Eo.test(e),parse:e=>kr.test(e)?kr.parse(e):Eo.test(e)?Eo.parse(e):Wc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kr.transform(e):Eo.transform(e)},qE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function KE(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Rc))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qE))===null||n===void 0?void 0:n.length)||0)>0}const lm="number",cm="color",ZE="var",XE="var(",um="${}",QE=/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 Ws(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(QE,l=>(Dt.test(l)?(r.color.push(s),o.push(cm),n.push(Dt.parse(l))):l.startsWith(XE)?(r.var.push(s),o.push(ZE),n.push(l)):(r.number.push(s),o.push(lm),n.push(parseFloat(l))),++s,um)).split(um);return{values:n,split:a,indexes:r,types:o}}function dm(e){return Ws(e).values}function fm(e){const{split:t,types:n}=Ws(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===lm?s+=js(o[i]):a===cm?s+=Dt.transform(o[i]):s+=o[i]}return s}}const JE=e=>typeof e=="number"?0:e;function eC(e){const t=dm(e);return fm(e)(t.map(JE))}const nr={test:KE,parse:dm,createTransformer:fm,getAnimatableNone:eC},tC=new Set(["brightness","contrast","saturate","opacity"]);function nC(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Rc)||[];if(!r)return e;const o=n.replace(r,"");let s=tC.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const rC=/\b([a-z-]*)\(.*?\)/gu,zc={...nr,getAnimatableNone:e=>{const t=e.match(rC);return t?t.map(nC).join(" "):e}},oC={...xc,color:Dt,backgroundColor:Dt,outlineColor:Dt,fill:Dt,stroke:Dt,borderColor:Dt,borderTopColor:Dt,borderRightColor:Dt,borderBottomColor:Dt,borderLeftColor:Dt,filter:zc,WebkitFilter:zc},Hc=e=>oC[e];function hm(e,t){let n=Hc(e);return n!==zc&&(n=nr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sC=new Set(["auto","none","0"]);function iC(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!sC.has(s)&&Ws(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=hm(n,o)}const pm=e=>e===So||e===me,mm=(e,t)=>parseFloat(e.split(", ")[t]),gm=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return mm(o[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?mm(s[1],e):0}},aC=new Set(["x","y","z"]),lC=xo.filter(e=>!aC.has(e));function cC(e){const t=[];return lC.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:gm(4,13),y:gm(5,14)};Co.translateX=Co.x,Co.translateY=Co.y;const Ir=new Set;let Uc=!1,Gc=!1;function ym(){if(Gc){const e=Array.from(Ir).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=cC(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Gc=!1,Uc=!1,Ir.forEach(e=>e.complete()),Ir.clear()}function vm(){Ir.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gc=!0)})}function uC(){vm(),ym()}class Yc{constructor(t,n,r,o,s,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ir.add(this),Uc||(Uc=!0,Ue.read(vm),Ue.resolveKeyframes(ym))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const i=o==null?void 0:o.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),o&&i===void 0&&o.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ir.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ir.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const bm=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),dC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fC(e){const t=dC.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const hC=4;function wm(e,t,n=1){tn(n<=hC,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=fC(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return bm(i)?parseFloat(i):i}return wc(o)?wm(o,t,n+1):o}const xm=e=>t=>t.test(e),Sm=[So,me,vn,tr,iE,sE,{test:e=>e==="auto",parse:e=>e}],Tm=e=>Sm.find(xm(e));class Em extends Yc{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),wc(c))){const u=wm(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!zp.has(r)||t.length!==2)return;const[o,s]=t,i=Tm(o),a=Tm(s);if(i!==a)if(pm(i)&&pm(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)zE(t[o])&&r.push(o);r.length&&iC(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=Co[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Cm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nr.test(e)||e==="0")&&!e.startsWith("url("));function pC(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function mC(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Cm(o,t),a=Cm(s,t);return vo(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:pC(e)||(n==="spring"||ia(n))&&r}const gC=e=>e!==null;function la(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(gC),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}const yC=40;class Pm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bn.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&uC(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bn.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:s,delay:i,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!mC(t,r,o,s))if(i)this.options.duration=0;else{l&&l(la(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ca=2e4;function qc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ca;)t+=n,r=e.next(t);return t>=ca?1/0:t}const Xe=(e,t,n)=>e+(t-e)*n;function Kc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function vC({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Kc(l,a,e+1/3),s=Kc(l,a,e),i=Kc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function ua(e,t){return n=>n>0?t:e}const Zc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},bC=[Wc,kr,Eo],wC=e=>bC.find(t=>t.test(e));function km(e){const t=wC(e);if(vo(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Eo&&(n=vC(n)),n}const Im=(e,t)=>{const n=km(e),r=km(t);if(!n||!r)return ua(e,t);const o={...n};return s=>(o.red=Zc(n.red,r.red,s),o.green=Zc(n.green,r.green,s),o.blue=Zc(n.blue,r.blue,s),o.alpha=Xe(n.alpha,r.alpha,s),kr.transform(o))},xC=(e,t)=>n=>t(e(n)),zs=(...e)=>e.reduce(xC),Xc=new Set(["none","hidden"]);function SC(e,t){return Xc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function TC(e,t){return n=>Xe(e,t,n)}function Qc(e){return typeof e=="number"?TC:typeof e=="string"?wc(e)?ua:Dt.test(e)?Im:PC:Array.isArray(e)?Am:typeof e=="object"?Dt.test(e)?Im:EC:ua}function Am(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Qc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function EC(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Qc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function CC(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,o[i]++}return r}const PC=(e,t)=>{const n=nr.createTransformer(t),r=Ws(e),o=Ws(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Xc.has(e)&&!o.values.length||Xc.has(t)&&!r.values.length?SC(e,t):zs(Am(CC(r,o),o.values),n):(vo(!0,`Complex values '${e}' and '${t}' 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.`),ua(e,t))};function Om(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xe(e,t,n):Qc(e)(e,t)}const kC=5;function _m(e,t,n){const r=Math.max(t-kC,0);return Hp(n-e(r),t-r)}const nt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jc=.001;function IC({duration:e=nt.duration,bounce:t=nt.bounce,velocity:n=nt.velocity,mass:r=nt.mass}){let o,s;vo(e<=ln(nt.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=Bn(nt.minDamping,nt.maxDamping,i),e=Bn(nt.minDuration,nt.maxDuration,wn(e)),i<1?(o=c=>{const u=c*i,d=u*e,f=u-n,h=eu(c,i),m=Math.exp(-d);return Jc-f/h*m},s=c=>{const d=c*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),p=eu(Math.pow(c,2),i);return(-o(c)+Jc>0?-1:1)*((f-h)*m)/p}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Jc+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=OC(o,s,a);if(e=ln(e),isNaN(l))return{stiffness:nt.stiffness,damping:nt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const AC=12;function OC(e,t,n){let r=n;for(let o=1;o<AC;o++)r=r-e(r)/t(r);return r}function eu(e,t){return e*Math.sqrt(1-t*t)}const _C=["duration","bounce"],DC=["stiffness","damping","mass"];function Dm(e,t){return t.some(n=>e[n]!==void 0)}function MC(e){let t={velocity:nt.velocity,stiffness:nt.stiffness,damping:nt.damping,mass:nt.mass,isResolvedFromDuration:!1,...e};if(!Dm(e,DC)&&Dm(e,_C))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Bn(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:nt.mass,stiffness:o,damping:s}}else{const n=IC(e);t={...t,...n,mass:nt.mass},t.isResolvedFromDuration=!0}return t}function tu(e=nt.visualDuration,t=nt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=MC({...n,velocity:-wn(n.velocity||0)}),m=f||0,p=c/(2*Math.sqrt(l*u)),y=i-s,b=wn(Math.sqrt(l/u)),v=Math.abs(y)<5;r||(r=v?nt.restSpeed.granular:nt.restSpeed.default),o||(o=v?nt.restDelta.granular:nt.restDelta.default);let g;if(p<1){const S=eu(b,p);g=E=>{const C=Math.exp(-p*b*E);return i-C*((m+p*b*y)/S*Math.sin(S*E)+y*Math.cos(S*E))}}else if(p===1)g=S=>i-Math.exp(-b*S)*(y+(m+b*y)*S);else{const S=b*Math.sqrt(p*p-1);g=E=>{const C=Math.exp(-p*b*E),I=Math.min(S*E,300);return i-C*((m+p*b*y)*Math.sinh(I)+S*y*Math.cosh(I))/S}}const T={calculatedDuration:h&&d||null,next:S=>{const E=g(S);if(h)a.done=S>=d;else{let C=0;p<1&&(C=S===0?ln(m):_m(g,S,E));const I=Math.abs(C)<=r,A=Math.abs(i-E)<=o;a.done=I&&A}return a.value=a.done?i:E,a},toString:()=>{const S=Math.min(qc(T),ca),E=Kp(C=>T.next(S*C).value,S,30);return S+"ms "+E}};return T}function Mm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=I=>a!==void 0&&I<a||l!==void 0&&I>l,m=I=>a===void 0?l:l===void 0||Math.abs(a-I)<Math.abs(l-I)?a:l;let p=n*t;const y=d+p,b=i===void 0?y:i(y);b!==y&&(p=b-d);const v=I=>-p*Math.exp(-I/r),g=I=>b+v(I),T=I=>{const A=v(I),O=g(I);f.done=Math.abs(A)<=c,f.value=f.done?b:O};let S,E;const C=I=>{h(f.value)&&(S=I,E=tu({keyframes:[f.value,m(f.value)],velocity:_m(g,I,f.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:I=>{let A=!1;return!E&&S===void 0&&(A=!0,T(I),C(I)),S!==void 0&&I>=S?E.next(I-S):(!A&&T(I),f)}}}const NC=Bs(.42,0,1,1),LC=Bs(0,0,.58,1),Nm=Bs(.42,0,.58,1),Lm=e=>Array.isArray(e)&&typeof e[0]!="number",Fm={linear:zt,easeIn:NC,easeInOut:Nm,easeOut:LC,circIn:$c,circInOut:sm,circOut:om,backIn:Vc,backInOut:nm,backOut:tm,anticipate:rm},nu=e=>{if(Lc(e)){tn(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Bs(t,n,r,o)}else if(typeof e=="string")return tn(Fm[e]!==void 0,`Invalid easing type '${e}'`),Fm[e];return e};function FC(e,t,n){const r=[],o=n||Om,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||zt:t;a=zs(l,a)}r.push(a)}return r}function Vm(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(tn(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=FC(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Pr(e[d],e[d+1],u);return a[d](f)};return n?u=>c(Bn(e[0],e[s-1],u)):c}function $m(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Pr(0,t,r);e.push(Xe(n,1,o))}}function Rm(e){const t=[0];return $m(t,e.length-1),t}function VC(e,t){return e.map(n=>n*t)}function $C(e,t){return e.map(()=>t||Nm).splice(0,e.length-1)}function Hs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Lm(r)?r.map(nu):nu(r),s={done:!1,value:t[0]},i=VC(n&&n.length===t.length?n:Rm(t),e),a=Vm(i,t,{ease:Array.isArray(o)?o:$C(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const RC=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>Rn(t),now:()=>kt.isProcessing?kt.timestamp:bn.now()}},BC={decay:Mm,inertia:Mm,tween:Hs,keyframes:Hs,spring:tu},jC=e=>e/100;class ru extends Pm{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:o,keyframes:s}=this.options,i=(o==null?void 0:o.KeyframeResolver)||Yc,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new i(s,a,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=this.options,a=ia(n)?n:BC[n]||Hs;let l,c;process.env.NODE_ENV!=="production"&&a!==Hs&&tn(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==Hs&&typeof t[0]!="number"&&(l=zs(jC,Om(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=qc(u));const{calculatedDuration:d}=u,f=d+o,h=f*(r+1)-o;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:o,generator:s,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:h,repeatType:m,repeatDelay:p,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let g=this.currentTime,T=s;if(h){const I=Math.min(this.currentTime,u)/d;let A=Math.floor(I),O=I%1;!O&&I>=1&&(O=1),O===1&&A--,A=Math.min(A,h+1),!!(A%2)&&(m==="reverse"?(O=1-O,p&&(O-=p/d)):m==="mirror"&&(T=i)),g=Bn(0,1,O)*d}const S=v?{done:!1,value:l[0]}:T.next(g);a&&(S.value=a(S.value));let{done:E}=S;!v&&c!==null&&(E=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return C&&o!==void 0&&(S.value=la(l,this.options,o)),y&&y(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?wn(t.calculatedDuration):0}get time(){return wn(this.currentTime)}set time(t){t=ln(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=wn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=RC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const WC=new Set(["opacity","clipPath","filter","transform"]);function zC(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Xp(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"})}const HC=Nc(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),da=10,UC=2e4;function GC(e){return ia(e.type)||e.type==="spring"||!Zp(e.ease)}function YC(e,t){const n=new ru({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<UC;)r=n.sample(s),o.push(r.value),s+=da;return{times:void 0,keyframes:o,duration:s-da,ease:"linear"}}const Bm={anticipate:rm,backInOut:nm,circInOut:sm};function qC(e){return e in Bm}class jm extends Pm{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:s}=this.options;this.resolver=new Em(s,(i,a)=>this.onKeyframesResolved(i,a),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:s,type:i,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&aa()&&qC(s)&&(s=Bm[s]),GC(this.options)){const{onComplete:d,onUpdate:f,motionValue:h,element:m,...p}=this.options,y=YC(t,p);t=y.keyframes,t.length===1&&(t[1]=t[0]),r=y.duration,o=y.times,s=y.ease,i="keyframes"}const u=zC(a.owner.current,l,t,{...this.options,duration:r,times:o,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(qp(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(la(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:i,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return wn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return wn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ln(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return zt;const{animation:r}=n;qp(r,t)}return zt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:s,ease:i,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...h}=this.options,m=new ru({...h,keyframes:r,duration:o,type:s,ease:i,times:a,isGenerator:!0}),p=ln(this.time);c.setWithVelocity(m.sample(p-da).value,m.sample(p).value,da)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:s,damping:i,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return HC()&&r&&WC.has(r)&&!l&&!c&&!o&&s!=="mirror"&&i!==0&&a!=="inertia"}}const KC={type:"spring",stiffness:500,damping:25,restSpeed:10},ZC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),XC={type:"keyframes",duration:.8},QC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},JC=(e,{keyframes:t})=>t.length>2?XC:Cr.has(e)?e.startsWith("scale")?ZC(t[1]):KC:QC;function eP({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const ou=(e,t,n,r={},o,s)=>i=>{const a=Oc(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ln(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};eP(a)||(u={...u,...JC(e,u)}),u.duration&&(u.duration=ln(u.duration)),u.repeatDelay&&(u.repeatDelay=ln(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const f=la(u.keyframes,a);if(f!==void 0)return Ue.update(()=>{u.onUpdate(f),u.onComplete()}),new Yp([])}return!s&&jm.supports(u)?new jm(u):new ru(u)};function tP({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function su(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),h=l[d];if(h===void 0||u&&tP(u,d))continue;const m={delay:n,...Oc(i||{},d)};let p=!1;if(window.MotionHandoffAnimation){const b=Gp(e);if(b){const v=window.MotionHandoffAnimation(b,d,Ue);v!==null&&(m.startTime=v,p=!0)}}Mc(e,d),f.start(ou(d,f,h,e.shouldReduceMotion&&zp.has(d)?{type:!1}:m,e,p));const y=f.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{Ue.update(()=>{a&&NE(e,a)})}),c}function iu(e,t,n={}){var r;const o=Vs(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(su(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return nP(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function nP(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(rP).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(iu(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function rP(e,t){return e.sortNodePosition(t)}function oP(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>iu(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=iu(e,t,n);else{const o=typeof t=="function"?Vs(e,t,n.custom):t;r=Promise.all(su(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Wm(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const sP=gc.length;function zm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sP;n++){const r=gc[n],o=e.props[r];(Ms(o)||o===!1)&&(t[r]=o)}return t}const iP=[...mc].reverse(),aP=mc.length;function lP(e){return t=>Promise.all(t.map(({animation:n,options:r})=>oP(e,n,r)))}function cP(e){let t=lP(e),n=Hm(),r=!0;const o=l=>(c,u)=>{var d;const f=Vs(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:m,...p}=f;c={...c,...p,...m}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=zm(e.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let y=0;y<aP;y++){const b=iP[y],v=n[b],g=c[b]!==void 0?c[b]:u[b],T=Ms(g),S=b===l?v.isActive:null;S===!1&&(m=y);let E=g===u[b]&&g!==c[b]&&T;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...h},!v.isActive&&S===null||!g&&!v.prevProp||ea(g)||typeof g=="boolean")continue;const C=uP(v.prevProp,g);let I=C||b===l&&v.isActive&&!E&&T||y>m&&T,A=!1;const O=Array.isArray(g)?g:[g];let F=O.reduce(o(b),{});S===!1&&(F={});const{prevResolvedValues:_={}}=v,V={..._,...F},k=N=>{I=!0,f.has(N)&&(A=!0,f.delete(N)),v.needsAnimating[N]=!0;const R=e.getValue(N);R&&(R.liveStyle=!1)};for(const N in V){const R=F[N],z=_[N];if(h.hasOwnProperty(N))continue;let D=!1;Ic(R)&&Ic(z)?D=!Wm(R,z):D=R!==z,D?R!=null?k(N):f.add(N):R!==void 0&&f.has(N)?k(N):v.protectedKeys[N]=!0}v.prevProp=g,v.prevResolvedValues=F,v.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(I=!1),I&&(!(E&&C)||A)&&d.push(...O.map(N=>({animation:N,options:{type:b}})))}if(f.size){const y={};if(typeof c.initial!="boolean"){const b=Vs(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(y.transition=b.transition)}f.forEach(b=>{const v=e.getBaseTarget(b),g=e.getValue(b);g&&(g.liveStyle=!0),y[b]=v??null}),d.push({animation:y})}let p=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Hm(),r=!0}}}function uP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wm(t,e):!1}function Ar(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hm(){return{animate:Ar(!0),whileInView:Ar(),whileHover:Ar(),whileTap:Ar(),whileDrag:Ar(),whileFocus:Ar(),exit:Ar()}}class rr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dP extends rr{constructor(t){super(t),t.animationState||(t.animationState=cP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ea(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let fP=0;class hP extends rr{constructor(){super(...arguments),this.id=fP++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const pP={animation:{Feature:dP},exit:{Feature:hP}},cn={x:!1,y:!1};function Um(){return cn.x||cn.y}function mP(e){return e==="x"||e==="y"?cn[e]?null:(cn[e]=!0,()=>{cn[e]=!1}):cn.x||cn.y?null:(cn.x=cn.y=!0,()=>{cn.x=cn.y=!1})}function Us(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const au=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Gs(e){return{point:{x:e.pageX,y:e.pageY}}}const gP=e=>t=>au(t)&&e(t,Gs(t));function Po(e,t,n,r){return Us(e,t,gP(n),r)}function Gm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function vP(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ym=1e-4,bP=1-Ym,wP=1+Ym,qm=.01,xP=0-qm,SP=0+qm;function $t(e){return e.max-e.min}function TP(e,t,n){return Math.abs(e-t)<=n}function Km(e,t,n,r=.5){e.origin=r,e.originPoint=Xe(t.min,t.max,e.origin),e.scale=$t(n)/$t(t),e.translate=Xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bP&&e.scale<=wP||isNaN(e.scale))&&(e.scale=1),(e.translate>=xP&&e.translate<=SP||isNaN(e.translate))&&(e.translate=0)}function Ys(e,t,n,r){Km(e.x,t.x,n.x,r?r.originX:void 0),Km(e.y,t.y,n.y,r?r.originY:void 0)}function Zm(e,t,n){e.min=n.min+t.min,e.max=e.min+$t(t)}function EP(e,t,n){Zm(e.x,t.x,n.x),Zm(e.y,t.y,n.y)}function Xm(e,t,n){e.min=t.min-n.min,e.max=e.min+$t(t)}function qs(e,t,n){Xm(e.x,t.x,n.x),Xm(e.y,t.y,n.y)}const Qm=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Qm(),y:Qm()}),Jm=()=>({min:0,max:0}),it=()=>({x:Jm(),y:Jm()});function nn(e){return[e("x"),e("y")]}function lu(e){return e===void 0||e===1}function cu({scale:e,scaleX:t,scaleY:n}){return!lu(e)||!lu(t)||!lu(n)}function Or(e){return cu(e)||eg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function eg(e){return tg(e.x)||tg(e.y)}function tg(e){return e&&e!=="0%"}function fa(e,t,n){const r=e-n,o=t*r;return n+o}function ng(e,t,n,r,o){return o!==void 0&&(e=fa(e,o,r)),fa(e,n,r)+t}function uu(e,t=0,n=1,r,o){e.min=ng(e.min,t,n,r,o),e.max=ng(e.max,t,n,r,o)}function rg(e,{x:t,y:n}){uu(e.x,t.translate,t.scale,t.originPoint),uu(e.y,n.translate,n.scale,n.originPoint)}const og=.999999999999,sg=1.0000000000001;function CP(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ao(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,rg(e,i)),r&&Or(s.latestValues)&&Ao(e,s.latestValues))}t.x<sg&&t.x>og&&(t.x=1),t.y<sg&&t.y>og&&(t.y=1)}function Io(e,t){e.min=e.min+t,e.max=e.max+t}function ig(e,t,n,r,o=.5){const s=Xe(e.min,e.max,o);uu(e,t,n,s,r)}function Ao(e,t){ig(e.x,t.x,t.scaleX,t.scale,t.originX),ig(e.y,t.y,t.scaleY,t.scale,t.originY)}function ag(e,t){return Gm(vP(e.getBoundingClientRect(),t))}function PP(e,t,n){const r=ag(e,n),{scroll:o}=t;return o&&(Io(r.x,o.offset.x),Io(r.y,o.offset.y)),r}function ha(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const lg=(e,t)=>Math.abs(e-t);function kP(e,t){const n=lg(e.x,t.x),r=lg(e.y,t.y);return Math.sqrt(n**2+r**2)}class cg{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=fu(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=kP(u.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:h}=u,{timestamp:m}=kt;this.history.push({...h,timestamp:m});const{onStart:p,onMove:y}=this.handlers;d||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=du(d,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{ha(u,"release"),this.end();const{onEnd:f,onSessionEnd:h,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=fu(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:du(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,p),h&&h(u,p)},!au(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r;const s=Gs(t),i=du(s,this.transformPagePoint),{point:a}=i,{timestamp:l}=kt;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,fu(i,this.history)),ha(t,"set"),this.removeListeners=zs(Po(t.currentTarget,"pointermove",this.handlePointerMove),Po(t.currentTarget,"pointerup",this.handlePointerUp),Po(t.currentTarget,"pointercancel",this.handlePointerUp),Po(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Rn(this.updatePoint)}}function du(e,t){return t?{point:t(e.point)}:e}function ug(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fu({point:e},t){return{point:e,delta:ug(e,dg(t)),offset:ug(e,IP(t)),velocity:AP(t,.1)}}function IP(e){return e[0]}function dg(e){return e[e.length-1]}function AP(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=dg(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ln(t)));)n--;if(!r)return{x:0,y:0};const s=wn(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function OP(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xe(n,e,r.max):Math.min(e,n)),e}function fg(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _P(e,{top:t,left:n,bottom:r,right:o}){return{x:fg(e.x,n,o),y:fg(e.y,t,r)}}function hg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DP(e,t){return{x:hg(e.x,t.x),y:hg(e.y,t.y)}}function MP(e,t){let n=.5;const r=$t(e),o=$t(t);return o>r?n=Pr(t.min,t.max-r,e.min):r>o&&(n=Pr(e.min,e.max-o,t.min)),Bn(0,1,n)}function NP(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const hu=.35;function LP(e=hu){return e===!1?e=0:e===!0&&(e=hu),{x:pg(e,"left","right"),y:pg(e,"top","bottom")}}function pg(e,t,n){return{min:mg(e,t),max:mg(e,n)}}function mg(e,t){return typeof e=="number"?e:e[t]||0}const FP=new WeakMap;class VP{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=it(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Gs(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:m}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mP(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nn(y=>{let b=this.getAxisMotionValue(y).get()||0;if(vn.test(b)){const{projection:v}=this.visualElement;if(v&&v.layout){const g=v.layout.layoutBox[y];g&&(b=$t(g)*(parseFloat(b)/100))}}this.originPoint[y]=b}),m&&Ue.postRender(()=>m(u,d)),Mc(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(h&&this.currentDirection===null){this.currentDirection=$P(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),p&&p(u,d)},a=(u,d)=>this.stop(u,d),l=()=>nn(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new cg(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&Ue.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!pa(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=OP(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&wo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=_P(o.layoutBox,n):this.constraints=!1,this.elastic=LP(r),s!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&nn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=NP(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!wo(t))return!1;const r=t.current;tn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=PP(r,o.root,this.visualElement.getTransformPagePoint());let i=DP(o.layout.layoutBox,s);if(n){const a=n(yP(i));this.hasMutatedConstraints=!!a,a&&(i=Gm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=nn(u=>{if(!pa(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Mc(this.visualElement,t),r.start(ou(t,r,0,n,this.visualElement,!1))}stopAnimation(){nn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){nn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){nn(n=>{const{drag:r}=this.getProps();if(!pa(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-Xe(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wo(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};nn(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=MP({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),nn(i=>{if(!pa(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(Xe(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;FP.set(this.visualElement,this);const t=this.visualElement.current,n=Po(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();wo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const i=Us(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(nn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=hu,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function pa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $P(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class RP extends rr{constructor(t){super(t),this.removeGroupControls=zt,this.removeListeners=zt,this.controls=new VP(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zt}unmount(){this.removeGroupControls(),this.removeListeners()}}const gg=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class BP extends rr{constructor(){super(...arguments),this.removePointerDownListener=zt}onPointerDown(t){this.session=new cg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:gg(t),onStart:gg(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&Ue.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Po(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ma={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ks={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(me.test(e))e=parseFloat(e);else return e;const n=yg(e,t.target.x),r=yg(e,t.target.y);return`${n}% ${r}%`}},jP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=nr.parse(e);if(o.length>5)return r;const s=nr.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=Xe(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class WP extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;oE(zP),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ma.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,i=r.projection;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||Ue.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),vc.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vg(e){const[t,n]=dp(),r=w.useContext(Ds);return x.jsx(WP,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Cp),isPresent:t,safeToRemove:n})}const zP={borderRadius:{...Ks,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ks,borderTopRightRadius:Ks,borderBottomLeftRadius:Ks,borderBottomRightRadius:Ks,boxShadow:jP};function bg(e,t,n){const r=vt(e)?e:To(e);return r.start(ou("",r,t,n)),r.animation}function wg(e){return e instanceof SVGElement&&e.tagName!=="svg"}const HP=(e,t)=>e.depth-t.depth;class UP{constructor(){this.children=[],this.isDirty=!1}add(t){_c(this.children,t),this.isDirty=!0}remove(t){sa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(HP),this.isDirty=!1,this.children.forEach(t)}}function GP(e,t){const n=bn.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Rn(r),e(s-t))};return Ue.read(r,!0),()=>Rn(r)}const xg=["TopLeft","TopRight","BottomLeft","BottomRight"],YP=xg.length,Sg=e=>typeof e=="string"?parseFloat(e):e,Tg=e=>typeof e=="number"||me.test(e);function qP(e,t,n,r,o,s){o?(e.opacity=Xe(0,n.opacity!==void 0?n.opacity:1,KP(r)),e.opacityExit=Xe(t.opacity!==void 0?t.opacity:1,0,ZP(r))):s&&(e.opacity=Xe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<YP;i++){const a=`border${xg[i]}Radius`;let l=Eg(t,a),c=Eg(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Tg(l)===Tg(c)?(e[a]=Math.max(Xe(Sg(l),Sg(c),r),0),(vn.test(c)||vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Xe(t.rotate||0,n.rotate||0,r))}function Eg(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const KP=Cg(0,.5,om),ZP=Cg(.5,.95,zt);function Cg(e,t,n){return r=>r<e?0:r>t?1:n(Pr(e,t,r))}function Pg(e,t){e.min=t.min,e.max=t.max}function rn(e,t){Pg(e.x,t.x),Pg(e.y,t.y)}function kg(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ig(e,t,n,r,o){return e-=t,e=fa(e,1/n,r),o!==void 0&&(e=fa(e,1/o,r)),e}function XP(e,t=0,n=1,r=.5,o,s=e,i=e){if(vn.test(t)&&(t=parseFloat(t),t=Xe(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Xe(s.min,s.max,r);e===s&&(a-=t),e.min=Ig(e.min,t,n,a,o),e.max=Ig(e.max,t,n,a,o)}function Ag(e,t,[n,r,o],s,i){XP(e,t[n],t[r],t[o],t.scale,s,i)}const QP=["x","scaleX","originX"],JP=["y","scaleY","originY"];function Og(e,t,n,r){Ag(e.x,t,QP,n?n.x:void 0,r?r.x:void 0),Ag(e.y,t,JP,n?n.y:void 0,r?r.y:void 0)}function _g(e){return e.translate===0&&e.scale===1}function Dg(e){return _g(e.x)&&_g(e.y)}function Mg(e,t){return e.min===t.min&&e.max===t.max}function ek(e,t){return Mg(e.x,t.x)&&Mg(e.y,t.y)}function Ng(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lg(e,t){return Ng(e.x,t.x)&&Ng(e.y,t.y)}function Fg(e){return $t(e.x)/$t(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class tk{constructor(){this.members=[]}add(t){_c(this.members,t),t.scheduleRender()}remove(t){if(sa(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nk(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const pu=["","X","Y","Z"],rk={visibility:"hidden"},$g=1e3;let ok=0;function mu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rg(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Gp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rg(r)}function Bg({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=ok++,this.animationId=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.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(ak),this.nodes.forEach(fk),this.nodes.forEach(hk),this.nodes.forEach(lk)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new UP)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Dc),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wg(i),this.instance=i;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=GP(f,250),ma.hasAnimatedSinceResize&&(ma.hasAnimatedSinceResize=!1,this.nodes.forEach(Wg))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||vk,{onLayoutAnimationStart:y,onLayoutAnimationComplete:b}=u.getProps(),v=!this.targetLayout||!Lg(this.targetLayout,m),g=!f&&h;if(this.options.layoutRoot||this.resumeFrom||g||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const T={...Oc(p,"layout"),onPlay:y,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else f||Wg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Rn(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(pk),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rg(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}this.isUpdating||this.nodes.forEach(uk),this.isUpdating=!1,this.nodes.forEach(dk),this.nodes.forEach(sk),this.nodes.forEach(ik),this.clearAllSnapshots();const a=bn.now();kt.delta=Bn(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,pc.update.process(kt),pc.preRender.process(kt),pc.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ck),this.sharedNodes.forEach(mk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$t(this.snapshot.measuredBox.x)&&!$t(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=it(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Dg(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&(a||Or(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),bk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var i;const{visualElement:a}=this.options;if(!a)return it();const l=a.measureViewportBox();if(!(((i=this.scroll)===null||i===void 0?void 0:i.wasRoot)||this.path.some(wk))){const{scroll:u}=this.root;u&&(Io(l.x,u.offset.x),Io(l.y,u.offset.y))}return l}removeElementScroll(i){var a;const l=it();if(rn(l,i),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&rn(l,i),Io(l.x,d.offset.x),Io(l.y,d.offset.y))}return l}applyTransform(i,a=!1){const l=it();rn(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ao(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Or(u.latestValues)&&Ao(l,u.latestValues)}return Or(this.latestValues)&&Ao(l,this.latestValues),l}removeTransform(i){const a=it();rn(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Or(c.latestValues))continue;cu(c.latestValues)&&c.updateSnapshot();const u=it(),d=c.measurePageBox();rn(u,d),Og(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Or(this.latestValues)&&Og(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}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!==kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),qs(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),EP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rn(this.target,this.layout.layoutBox),rg(this.target,this.targetDelta)):rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),qs(this.relativeTargetOrigin,this.target,h.target),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||cu(this.parent.latestValues)||eg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var i;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===kt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;rn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;CP(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=it());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(kg(this.prevProjectionDelta.x,this.projectionDelta.x),kg(this.prevProjectionDelta.y,this.projectionDelta.y)),Ys(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ko(),this.projectionDelta=ko(),this.projectionDeltaWithTransform=ko()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=ko();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=it(),h=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=h!==m,y=this.getStack(),b=!y||y.members.length<=1,v=!!(p&&!b&&this.options.crossfade===!0&&!this.path.some(yk));this.animationProgress=0;let g;this.mixTargetDelta=T=>{const S=T/1e3;zg(d.x,i.x,S),zg(d.y,i.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qs(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gk(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&ek(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=it()),rn(g,this.relativeTarget)),p&&(this.animationValues=u,qP(u,c,this.latestValues,S,v,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Rn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{ma.hasAnimatedSinceResize=!0,this.currentAnimation=bg(0,$g,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($g),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&qg(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||it();const d=$t(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const f=$t(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}rn(a,l),Ao(a,u),Ys(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new tk),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&mu("z",i,c,this.animationValues);for(let u=0;u<pu.length;u++)mu(`rotate${pu[u]}`,i,c,this.animationValues),mu(`skew${pu[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return rk;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=ra(i==null?void 0:i.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=ra(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Or(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=nk(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:h,y:m}=this.projectionDelta;c.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const p in Ns){if(f[p]===void 0)continue;const{correct:y,applyTo:b,isCSSVariable:v}=Ns[p],g=c.transform==="none"?f[p]:y(f[p],d);if(b){const T=b.length;for(let S=0;S<T;S++)c[b[S]]=g}else v?this.options.visualElement.renderState.vars[p]=g:c[p]=g}return this.options.layoutId&&(c.pointerEvents=d===this?ra(i==null?void 0:i.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function sk(e){e.updateLayout()}function ik(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=n.source!==e.layout.source;s==="size"?nn(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],h=$t(f);f.min=r[d].min,f.max=f.min+h}):qg(s,n.layoutBox,r)&&nn(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],h=$t(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=ko();Ys(a,r,n.layoutBox);const l=ko();i?Ys(l,e.applyTransform(o,!0),n.measuredBox):Ys(l,r,n.layoutBox);const c=!Dg(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=it();qs(m,n.layoutBox,f.layoutBox);const p=it();qs(p,r,h.layoutBox),Lg(m,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ak(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function lk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ck(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function uk(e){e.isLayoutDirty=!1}function dk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fk(e){e.resolveTargetDelta()}function hk(e){e.calcProjection()}function pk(e){e.resetSkewAndRotation()}function mk(e){e.removeLeadSnapshot()}function zg(e,t,n){e.translate=Xe(t.translate,0,n),e.scale=Xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hg(e,t,n,r){e.min=Xe(t.min,n.min,r),e.max=Xe(t.max,n.max,r)}function gk(e,t,n,r){Hg(e.x,t.x,n.x,r),Hg(e.y,t.y,n.y,r)}function yk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vk={duration:.45,ease:[.4,0,.1,1]},Ug=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gg=Ug("applewebkit/")&&!Ug("chrome/")?Math.round:zt;function Yg(e){e.min=Gg(e.min),e.max=Gg(e.max)}function bk(e){Yg(e.x),Yg(e.y)}function qg(e,t,n){return e==="position"||e==="preserve-aspect"&&!TP(Fg(t),Fg(n),.2)}function wk(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const xk=Bg({attachResizeListener:(e,t)=>Us(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gu={current:void 0},Kg=Bg({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gu.current){const e=new xk({});e.mount(window),e.setOptions({layoutScroll:!0}),gu.current=e}return gu.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Sk={pan:{Feature:BP},drag:{Feature:RP,ProjectionNode:Kg,MeasureLayout:vg}};function Zg(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);const s=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Xg(e,t){const n=Zg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Qg(e){return!(e.pointerType==="touch"||Um())}function Tk(e,t,n={}){const[r,o,s]=Xg(e,n),i=a=>{if(!Qg(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Qg(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}function Jg(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&Ue.postRender(()=>s(t,Gs(t)))}class Ek extends rr{mount(){const{current:t}=this.node;t&&(this.unmount=Tk(t,(n,r)=>(Jg(this.node,r,"Start"),o=>Jg(this.node,o,"End"))))}unmount(){}}class Ck extends rr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=zs(Us(this.node.current,"focus",()=>this.onFocus()),Us(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const ey=(e,t)=>t?e===t?!0:ey(e,t.parentElement):!1,Pk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kk(e){return Pk.has(e.tagName)||e.tabIndex!==-1}const Zs=new WeakSet;function ty(e){return t=>{t.key==="Enter"&&e(t)}}function yu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ik=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ty(()=>{if(Zs.has(n))return;yu(n,"down");const o=ty(()=>{yu(n,"up")}),s=()=>yu(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ny(e){return au(e)&&!Um()}function Ak(e,t,n={}){const[r,o,s]=Xg(e,n),i=a=>{const l=a.currentTarget;if(!l||!ny(a)||Zs.has(l))return;Zs.add(l),ha(a,"set");const c=t(l,a),u=(h,m)=>{l.removeEventListener("pointerup",d),l.removeEventListener("pointercancel",f),ha(h,"release"),!(!ny(h)||!Zs.has(l))&&(Zs.delete(l),typeof c=="function"&&c(h,{success:m}))},d=h=>{(h.isTrusted?Ok(h,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(h,!1):u(h,!(l instanceof Element)||ey(l,h.target))},f=h=>{u(h,!1)};l.addEventListener("pointerup",d,o),l.addEventListener("pointercancel",f,o),l.addEventListener("lostpointercapture",f,o)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!kk(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",i,o),l&&a.addEventListener("focus",c=>Ik(c,o),o)}),s}function Ok(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function ry(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&Ue.postRender(()=>s(t,Gs(t)))}class _k extends rr{mount(){const{current:t}=this.node;t&&(this.unmount=Ak(t,(n,r)=>(ry(this.node,r,"Start"),(o,{success:s})=>ry(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const vu=new WeakMap,bu=new WeakMap,Dk=e=>{const t=vu.get(e.target);t&&t(e)},Mk=e=>{e.forEach(Dk)};function Nk({root:e,...t}){const n=e||document;bu.has(n)||bu.set(n,{});const r=bu.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Mk,{root:e,...t})),r[o]}function Lk(e,t,n){const r=Nk(t);return vu.set(e,n),r.observe(e),()=>{vu.delete(e),r.unobserve(e)}}const Fk={some:0,all:1};class Vk extends rr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Fk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Lk(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some($k(t,n))&&this.startObserver()}unmount(){}}function $k({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Rk={inView:{Feature:Vk},tap:{Feature:_k},focus:{Feature:Ck},hover:{Feature:Ek}},Bk={layout:{ProjectionNode:Kg,MeasureLayout:vg}},wu={current:null},oy={current:!1};function jk(){if(oy.current=!0,!!hc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wu.current=e.matches;e.addListener(t),t()}else wu.current=!1}const Wk=[...Sm,Dt,nr],zk=e=>Wk.find(xm(e)),Xs=new WeakMap;function Hk(e,t,n){for(const r in t){const o=t[r],s=n[r];if(vt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Qi(o.version==="12.4.7",`Attempting to mix Motion versions ${o.version} with 12.4.7 may not work as expected.`);else if(vt(s))e.addValue(r,To(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,To(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iy{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yc,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{const h=bn.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=i;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=ta(n),this.isVariantNode=Sp(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const m=f[h];l[h]!==void 0&&vt(m)&&m.set(l[h],!1)}}mount(t){this.current=t,Xs.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((n,r)=>this.bindToMotionValue(r,n)),oy.current||jk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wu.current,process.env.NODE_ENV!=="production"&&Qi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Rn(this.notifyUpdate),Rn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Cr.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bo){const n=bo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):it()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<sy.length;r++){const o=sy[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Hk(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=To(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(bm(o)||im(o))?o=parseFloat(o):!zk(o)&&nr.test(n)&&(o=hm(t,n)),this.setBaseTarget(t,vt(o)?o.get():o)),vt(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const i=kc(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);i&&(o=i[t])}if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!vt(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Dc),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ay extends iy{constructor(){super(...arguments),this.KeyframeResolver=Em}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;vt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Uk(e){return window.getComputedStyle(e)}class ly extends ay{constructor(){super(...arguments),this.type="html",this.renderInstance=$p}readValueFromInstance(t,n){if(Cr.has(n)){const r=Hc(n);return r&&r.default||0}else{const r=Uk(t),o=(bc(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ag(t,n)}build(t,n,r){Sc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ac(t,n,r)}}class cy extends ay{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Vp(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Cr.has(n)){const r=Hc(n);return r&&r.default||0}return n=Rp.has(n)?n:yc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return jp(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ue.postRender(this.updateDimensions)}build(t,n,r){Cc(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){Bp(t,n,r,o)}mount(t){this.isSVGTag=Pc(t.tagName),super.mount(t)}}const Gk=(e,t)=>Ec(e)?new cy(t):new ly(t,{allowProjection:e!==w.Fragment}),Yk=IE({...pP,...Rk,...Sk,...Bk},Gk),at=UT(Yk);function _r(e){const t=an(()=>To(e)),{isStatic:n}=w.useContext(yo);if(n){const[,r]=w.useState(e);w.useEffect(()=>t.on("change",r),[])}return t}function uy(e,t){const n=_r(t()),r=()=>n.set(t());return r(),Ki(()=>{const o=()=>Ue.preRender(r,!1,!0),s=e.map(i=>i.on("change",o));return()=>{s.forEach(i=>i()),Rn(r)}}),n}const qk=e=>e&&typeof e=="object"&&e.mix,Kk=e=>qk(e)?e.mix:void 0;function Zk(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],o=e[1+n],s=e[2+n],i=e[3+n],a=Vm(o,s,{mixer:Kk(s[0]),...i});return t?a(r):a}function Xk(e){$s.current=[],e();const t=uy($s.current,e);return $s.current=void 0,t}function Qk(e,t,n,r){if(typeof e=="function")return Xk(e);const o=typeof t=="function"?t:Zk(t,n,r);return Array.isArray(e)?dy(e,o):dy([e],([s])=>o(s))}function dy(e,t){const n=an(()=>[]);return uy(e,()=>{n.length=0;const r=e.length;for(let o=0;o<r;o++)n[o]=e[o].get();return t(n)})}function Jk(e){return w.useEffect(()=>()=>e(),[])}function eI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(qc(r),ca);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:wn(o)}}const tI=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function fy(e,t){return Lm(e)?e[tI(0,e.length,t)]:e}function xu(e){return typeof e=="object"&&!Array.isArray(e)}function hy(e,t,n,r){return typeof e=="string"&&xu(t)?Zg(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function nI(e,t,n){return e*(t+1)}function py(e,t,n,r){var o;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(o=r.get(t))!==null&&o!==void 0?o:e}function rI(e,t,n){for(let r=0;r<e.length;r++){const o=e[r];o.at>t&&o.at<n&&(sa(e,o),r--)}}function oI(e,t,n,r,o,s){rI(e,o,s);for(let i=0;i<t.length;i++)e.push({value:t[i],at:Xe(o,s,r[i]),easing:fy(n,i)})}function sI(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function iI(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const aI="easeInOut",lI=20;function cI(e,{defaultTransition:t={},...n}={},r,o){const s=t.duration||.3,i=new Map,a=new Map,l={},c=new Map;let u=0,d=0,f=0;for(let h=0;h<e.length;h++){const m=e[h];if(typeof m=="string"){c.set(m,d);continue}else if(!Array.isArray(m)){c.set(m.name,py(d,m.at,u,c));continue}let[p,y,b={}]=m;b.at!==void 0&&(d=py(d,b.at,u,c));let v=0;const g=(T,S,E,C=0,I=0)=>{const A=uI(T),{delay:O=0,times:F=Rm(A),type:_="keyframes",repeat:V,repeatType:k,repeatDelay:M=0,...L}=S;let{ease:N=t.ease||"easeOut",duration:R}=S;const z=typeof O=="function"?O(C,I):O,D=A.length,B=ia(_)?_:o==null?void 0:o[_];if(D<=2&&B){let G=100;if(D===2&&hI(A)){const H=A[1]-A[0];G=Math.abs(H)}const $={...L};R!==void 0&&($.duration=ln(R));const j=eI($,G,B);N=j.ease,R=j.duration}R??(R=s);const Z=d+z;F.length===1&&F[0]===0&&(F[1]=1);const oe=F.length-A.length;if(oe>0&&$m(F,oe),A.length===1&&A.unshift(null),V){tn(V<lI,"Repeat count too high, must be less than 20"),R=nI(R,V);const G=[...A],$=[...F];N=Array.isArray(N)?[...N]:[N];const j=[...N];for(let H=0;H<V;H++){A.push(...G);for(let Y=0;Y<G.length;Y++)F.push($[Y]+(H+1)),N.push(Y===0?"linear":fy(j,Y-1))}sI(F,V)}const te=Z+R;oI(E,A,N,F,Z,te),v=Math.max(z+R,v),f=Math.max(te,f)};if(vt(p)){const T=my(p,a);g(y,b,gy("default",T))}else{const T=hy(p,y,r,l),S=T.length;for(let E=0;E<S;E++){y=y,b=b;const C=T[E],I=my(C,a);for(const A in y)g(y[A],dI(b,A),gy(A,I),E,S)}}u=d,d+=v}return a.forEach((h,m)=>{for(const p in h){const y=h[p];y.sort(iI);const b=[],v=[],g=[];for(let S=0;S<y.length;S++){const{at:E,value:C,easing:I}=y[S];b.push(C),v.push(Pr(0,f,E)),g.push(I||"easeOut")}v[0]!==0&&(v.unshift(0),b.unshift(b[0]),g.unshift(aI)),v[v.length-1]!==1&&(v.push(1),b.push(null)),i.has(m)||i.set(m,{keyframes:{},transition:{}});const T=i.get(m);T.keyframes[p]=b,T.transition[p]={...t,duration:f,ease:g,times:v,...n}}}),i}function my(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function gy(e,t){return t[e]||(t[e]=[]),t[e]}function uI(e){return Array.isArray(e)?e:[e]}function dI(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const fI=e=>typeof e=="number",hI=e=>e.every(fI);function pI(e,t){return e in t}class mI extends iy{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(pI(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return it()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function gI(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=wg(e)?new cy(t):new ly(t);n.mount(e),Xs.set(e,n)}function yI(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new mI(t);n.mount(e),Xs.set(e,n)}function vI(e,t){return vt(e)||typeof e=="number"||typeof e=="string"&&!xu(t)}function yy(e,t,n,r){const o=[];if(vI(e,t))o.push(bg(e,xu(t)&&t.default||t,n&&(n.default||n)));else{const s=hy(e,t,r),i=s.length;tn(!!i,"No valid elements provided.");for(let a=0;a<i;a++){const l=s[a],c=l instanceof Element?gI:yI;Xs.has(l)||c(l);const u=Xs.get(l),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(a,i)),o.push(...su(u,{...t,transition:d},{}))}}return o}function bI(e,t,n){const r=[];return cI(e,t,n,{spring:tu}).forEach(({keyframes:s,transition:i},a)=>{r.push(...yy(a,s,i))}),r}function wI(e){return Array.isArray(e)&&e.some(Array.isArray)}function xI(e){function t(n,r,o){let s=[];wI(n)?s=bI(n,r,e):s=yy(n,r,o,e);const i=new Yp(s);return e&&e.animations.push(i),i}return t}function SI(){const e=an(()=>({current:null,animations:[]})),t=an(()=>xI(e));return Jk(()=>{e.animations.forEach(n=>n.stop())}),[e,t]}class TI{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const EI=()=>new TI;function CI(){return an(EI)}function PI(e,t){if(e==="first")return 0;{const n=t-1;return e==="last"?n:n/2}}function kI(e=.1,{startDelay:t=0,from:n=0,ease:r}={}){return(o,s)=>{const i=typeof n=="number"?n:PI(n,s),a=Math.abs(i-o);let l=e*a;if(r){const c=s*e;l=nu(r)(l/c)*c}return t+l}}const vy=w.createContext(null);function II(e,t,n,r){if(!r)return e;const o=e.findIndex(u=>u.value===t);if(o===-1)return e;const s=r>0?1:-1,i=e[o+s];if(!i)return e;const a=e[o],l=i.layout,c=Xe(l.min,l.max,.5);return s===1&&a.layout.max+n>c||s===-1&&a.layout.min+n<c?OE(e,o,o+s):e}function AI({children:e,as:t="ul",axis:n="y",onReorder:r,values:o,...s},i){const a=an(()=>at[t]),l=[],c=w.useRef(!1);tn(!!o,"Reorder.Group must be provided a values prop");const u={axis:n,registerItem:(d,f)=>{const h=l.findIndex(m=>d===m.value);h!==-1?l[h].layout=f[n]:l.push({value:d,layout:f[n]}),l.sort(_I)},updateOrder:(d,f,h)=>{if(c.current)return;const m=II(l,d,f,h);l!==m&&(c.current=!0,r(m.map(OI).filter(p=>o.indexOf(p)!==-1)))}};return w.useEffect(()=>{c.current=!1}),x.jsx(a,{...s,ref:i,ignoreStrict:!0,children:x.jsx(vy.Provider,{value:u,children:e})})}const by=w.forwardRef(AI);function OI(e){return e.value}function _I(e,t){return e.layout.min-t.layout.min}function wy(e,t=0){return vt(e)?e:_r(t)}function DI({children:e,style:t={},value:n,as:r="li",onDrag:o,layout:s=!0,...i},a){const l=an(()=>at[r]),c=w.useContext(vy),u={x:wy(t.x),y:wy(t.y)},d=Qk([u.x,u.y],([p,y])=>p||y?1:"unset");tn(!!c,"Reorder.Item must be a child of Reorder.Group");const{axis:f,registerItem:h,updateOrder:m}=c;return x.jsx(l,{drag:f,...i,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:d},layout:s,onDrag:(p,y)=>{const{velocity:b}=y;b[f]&&m(n,u[f].get(),b[f]),o&&o(p,y)},onLayoutMeasure:p=>h(n,p),ref:a,ignoreStrict:!0,children:e})}const xy=w.forwardRef(DI);/**
12
+ `),()=>{document.head.removeChild(h)}},[t]),x.jsx(OT,{isPresent:t,childRef:o,sizeRef:s,children:P.cloneElement(e,{ref:o})})}const DT=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a})=>{const l=an(MT),c=w.useId(),u=w.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=w.useMemo(()=>({id:c,initial:t,isPresent:n,custom:o,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return w.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),P.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(e=x.jsx(_T,{isPresent:n,anchorX:a,children:e})),x.jsx(qi.Provider,{value:d,children:e})};function MT(){return new Map}function dp(e=!0){const t=w.useContext(qi);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Ki=e=>e.key||"";function fp(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const mc=typeof window<"u",Zi=mc?w.useLayoutEffect:w.useEffect,er=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left"})=>{const[l,c]=dp(i),u=w.useMemo(()=>fp(e),[e]),d=i&&!l?[]:u.map(Ki),f=w.useRef(!0),h=w.useRef(u),m=an(()=>new Map),[p,v]=w.useState(u),[b,y]=w.useState(u);Zi(()=>{f.current=!1,h.current=u;for(let S=0;S<b.length;S++){const E=Ki(b[S]);d.includes(E)?m.delete(E):m.get(E)!==!0&&m.set(E,!1)}},[b,d.length,d.join("-")]);const g=[];if(u!==p){let S=[...u];for(let E=0;E<b.length;E++){const C=b[E],I=Ki(C);d.includes(I)||(S.splice(E,0,C),g.push(C))}return s==="wait"&&g.length&&(S=g),y(fp(S)),v(u),null}process.env.NODE_ENV!=="production"&&s==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=w.useContext(Ms);return x.jsx(x.Fragment,{children:b.map(S=>{const E=Ki(S),C=i&&!l?!1:u===b||d.includes(E),I=()=>{if(m.has(E))m.set(E,!0);else return;let A=!0;m.forEach(O=>{O||(A=!1)}),A&&(T==null||T(),y(h.current),i&&(c==null||c()),r&&r())};return x.jsx(DT,{isPresent:C,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,onExitComplete:C?void 0:I,anchorX:a,children:S},E)})})},NT=w.createContext(null);function LT(){const e=w.useRef(!1);return Zi(()=>(e.current=!0,()=>{e.current=!1}),[]),e}const zt=e=>e;let vo=zt,tn=zt;process.env.NODE_ENV!=="production"&&(vo=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},tn=(e,t)=>{if(!e)throw new Error(t)});const FT={skipAnimations:!1,useManualTiming:!1},Xi=["read","resolveKeyframes","update","preRender","render","postRender"],hp={value:null,addProjectionMetrics:null};function VT(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const p=h&&o?n:r;return f&&i.add(d),p.has(d)||p.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&hp.value&&hp.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const $T=40;function pp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Xi.reduce((b,y)=>(b[y]=VT(s,t?y:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,h=()=>{const b=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(b-o.timestamp,$T),1),o.timestamp=b,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},m=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Xi.reduce((b,y)=>{const g=i[y];return b[y]=(T,S=!1,E=!1)=>(n||m(),g.schedule(T,S,E)),b},{}),cancel:b=>{for(let y=0;y<Xi.length;y++)i[Xi[y]].cancel(b)},state:o,steps:i}}const{schedule:Ue,cancel:Rn,state:kt,steps:gc}=pp(typeof requestAnimationFrame<"u"?requestAnimationFrame:zt,!0);function RT(){const e=LT(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ue.postRender(r),[r]),t]}const BT=e=>!e.isLayoutDirty&&e.willUpdate(!1);function mp(){const e=new Set,t=new WeakMap,n=()=>e.forEach(BT);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const gp=e=>e===!0,jT=e=>gp(e===!0)||e==="id",WT=({children:e,id:t,inherit:n=!0})=>{const r=w.useContext(Ms),o=w.useContext(NT),[s,i]=RT(),a=w.useRef(null),l=r.id||o;a.current===null&&(jT(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:gp(n)&&r.group||mp()});const c=w.useMemo(()=>({...a.current,forceRender:s}),[i]);return x.jsx(Ms.Provider,{value:c,children:e})},yp=w.createContext({strict:!1}),vp={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"]},bo={};for(const e in vp)bo[e]={isEnabled:t=>vp[e].some(n=>!!t[n])};function zT(e){for(const t in e)bo[t]={...bo[t],...e[t]}}const HT=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","ignoreStrict","viewport"]);function Qi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HT.has(e)}let bp=e=>!Qi(e);function wp(e){e&&(bp=t=>t.startsWith("on")?!Qi(t):e(t))}try{wp(require("@emotion/is-prop-valid").default)}catch{}function UT(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(bp(o)||n===!0&&Qi(o)||!t&&!Qi(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function GT({children:e,isValidProp:t,...n}){t&&wp(t),n={...w.useContext(yo),...n},n.isStatic=an(()=>n.isStatic);const r=w.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return x.jsx(yo.Provider,{value:r,children:e})}const xp=new Set;function Ji(e,t,n){e||xp.has(t)||(console.warn(t),xp.add(t))}function YT(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ji(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const ea=w.createContext({});function ta(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ns(e){return typeof e=="string"||Array.isArray(e)}const yc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vc=["initial",...yc];function na(e){return ta(e.animate)||vc.some(t=>Ns(e[t]))}function Sp(e){return!!(na(e)||e.variants)}function qT(e,t){if(na(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ns(n)?n:void 0,animate:Ns(r)?r:void 0}}return e.inherit!==!1?t:{}}function KT(e){const{initial:t,animate:n}=qT(e,w.useContext(ea));return w.useMemo(()=>({initial:t,animate:n}),[Tp(t),Tp(n)])}function Tp(e){return Array.isArray(e)?e.join(" "):e}const ZT=Symbol.for("motionComponentSymbol");function wo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XT(e,t,n){return w.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):wo(n)&&(n.current=r))},[t])}const bc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ep="data-"+bc("framerAppearId"),{schedule:wc,cancel:dB}=pp(queueMicrotask,!1),Cp=w.createContext({});function QT(e,t,n,r,o){var s,i;const{visualElement:a}=w.useContext(ea),l=w.useContext(yp),c=w.useContext(qi),u=w.useContext(yo).reducedMotion,d=w.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,h=w.useContext(Cp);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&JT(d.current,n,o,h);const m=w.useRef(!1);w.useInsertionEffect(()=>{f&&m.current&&f.update(n,c)});const p=n[Ep],v=w.useRef(!!p&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,p))&&((i=window.MotionHasOptimisedAnimation)===null||i===void 0?void 0:i.call(window,p)));return Zi(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),wc.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),w.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,p)}),v.current=!1))}),f}function JT(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Pp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&wo(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Pp(e){if(e)return e.options.allowProjection!==!1?e.projection:Pp(e.parent)}function eE({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;e&&zT(e);function a(c,u){let d;const f={...w.useContext(yo),...c,layoutId:tE(c)},{isStatic:h}=f,m=KT(c),p=r(c,h);if(!h&&mc){nE(f,e);const v=rE(f);d=v.MeasureLayout,m.visualElement=QT(o,p,f,t,v.ProjectionNode)}return x.jsxs(ea.Provider,{value:m,children:[d&&m.visualElement?x.jsx(d,{visualElement:m.visualElement,...f}):null,n(o,c,XT(p,m.visualElement,u),p,h,m.visualElement)]})}a.displayName=`motion.${typeof o=="string"?o:`create(${(i=(s=o.displayName)!==null&&s!==void 0?s:o.name)!==null&&i!==void 0?i:""})`}`;const l=w.forwardRef(a);return l[ZT]=o,l}function tE({layoutId:e}){const t=w.useContext(Ms).id;return t&&e!==void 0?t+"-"+e:e}function nE(e,t){const n=w.useContext(yp).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?vo(!1,r):tn(!1,r)}}function rE(e){const{drag:t,layout:n}=bo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const kp=e=>t=>typeof t=="string"&&t.startsWith(e),xc=kp("--"),oE=kp("var(--"),Sc=e=>oE(e)?sE.test(e.split("/*")[0].trim()):!1,sE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ls={};function iE(e){for(const t in e)Ls[t]=e[t],xc(t)&&(Ls[t].isCSSVariable=!0)}const xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cr=new Set(xo);function Ip(e,{layout:t,layoutId:n}){return Cr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ls[e]||e==="opacity")}const vt=e=>!!(e&&e.getVelocity),Ap=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Bn=(e,t,n)=>n>t?t:n<e?e:n,So={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Fs={...So,transform:e=>Bn(0,1,e)},ra={...So,default:1},Vs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tr=Vs("deg"),vn=Vs("%"),me=Vs("px"),aE=Vs("vh"),lE=Vs("vw"),Op={...vn,parse:e=>vn.parse(e)/100,transform:e=>vn.transform(e*100)},cE={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,backgroundPositionX:me,backgroundPositionY:me},uE={rotate:tr,rotateX:tr,rotateY:tr,rotateZ:tr,scale:ra,scaleX:ra,scaleY:ra,scaleZ:ra,skew:tr,skewX:tr,skewY:tr,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:Fs,originX:Op,originY:Op,originZ:me},_p={...So,transform:Math.round},Tc={...cE,...uE,zIndex:_p,size:me,fillOpacity:Fs,strokeOpacity:Fs,numOctaves:_p},dE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fE=xo.length;function hE(e,t,n){let r="",o=!0;for(let s=0;s<fE;s++){const i=xo[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ap(a,Tc[i]);if(!l){o=!1;const u=dE[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Ec(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(Cr.has(l)){i=!0;continue}else if(xc(l)){o[l]=c;continue}else{const u=Ap(c,Tc[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=hE(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Cc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Dp(e,t,n){for(const r in t)!vt(t[r])&&!Ip(r,n)&&(e[r]=t[r])}function pE({transformTemplate:e},t){return w.useMemo(()=>{const n=Cc();return Ec(n,t,e),Object.assign({},n.vars,n.style)},[t])}function mE(e,t){const n=e.style||{},r={};return Dp(r,n,e),Object.assign(r,pE(e,t)),r}function gE(e,t){const n={},r=mE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const yE=["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 Pc(e){return typeof e!="string"||e.includes("-")?!1:!!(yE.indexOf(e)>-1||/[A-Z]/u.test(e))}const vE={offset:"stroke-dashoffset",array:"stroke-dasharray"},bE={offset:"strokeDashoffset",array:"strokeDasharray"};function wE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?vE:bE;e[s.offset]=me.transform(-r);const i=me.transform(t),a=me.transform(n);e[s.array]=`${i} ${a}`}function Mp(e,t,n){return typeof e=="string"?e:me.transform(t+n*e)}function xE(e,t,n){const r=Mp(t,e.x,e.width),o=Mp(n,e.y,e.height);return`${r} ${o}`}function kc(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Ec(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:m}=e;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(o!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=xE(m,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&wE(f,i,a,l,!1)}const Np=()=>({...Cc(),attrs:{}}),Ic=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SE(e,t,n,r){const o=w.useMemo(()=>{const s=Np();return kc(s,t,Ic(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Dp(s,e.style,e),o.style={...s,...o.style}}return o}function TE(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(Pc(n)?SE:gE)(r,s,i,n),c=UT(r,typeof n=="string",e),u=n!==w.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=w.useMemo(()=>vt(d)?d.get():d,[d]);return w.createElement(n,{...u,children:f})}}function Lp(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ac(e,t,n,r){if(typeof t=="function"){const[o,s]=Lp(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Lp(r);t=t(n!==void 0?n:e.custom,o,s)}return t}const Oc=e=>Array.isArray(e),EE=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),CE=e=>Oc(e)?e[e.length-1]||0:e;function oa(e){const t=vt(e)?e.get():e;return EE(t)?t.toValue():t}function PE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:kE(r,o,s,e),renderState:t()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const Fp=e=>(t,n)=>{const r=w.useContext(ea),o=w.useContext(qi),s=()=>PE(e,t,r,o);return n?s():an(s)};function kE(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=oa(s[f]);let{initial:i,animate:a}=e;const l=na(e),c=Sp(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!ta(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=Ac(e,f[h]);if(m){const{transitionEnd:p,transition:v,...b}=m;for(const y in b){let g=b[y];if(Array.isArray(g)){const T=u?g.length-1:0;g=g[T]}g!==null&&(o[y]=g)}for(const y in p)o[y]=p[y]}}}return o}function _c(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(vt(o[i])||t.style&&vt(t.style[i])||Ip(i,e)||((r=n==null?void 0:n.getValue(i))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[i]=o[i]);return s}const IE={useVisualState:Fp({scrapeMotionValuesFromProps:_c,createRenderState:Cc})};function Vp(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $p(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Rp=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"]);function Bp(e,t,n,r){$p(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Rp.has(o)?o:bc(o),t.attrs[o])}function jp(e,t,n){const r=_c(e,t,n);for(const o in e)if(vt(e[o])||vt(t[o])){const s=xo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const Wp=["x","y","width","height","cx","cy","r"],AE={useVisualState:Fp({scrapeMotionValuesFromProps:jp,createRenderState:Np,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in o)if(Cr.has(a)){s=!0;break}}if(!s)return;let i=!t;if(t)for(let a=0;a<Wp.length;a++){const l=Wp[a];e[l]!==t[l]&&(i=!0)}i&&Ue.read(()=>{Vp(n,r),Ue.render(()=>{kc(r,o,Ic(n.tagName),e.transformTemplate),Bp(n,r)})})}})};function OE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...Pc(r)?AE:IE,preloadedFeatures:e,useRender:TE(o),createVisualElement:t,Component:r};return eE(i)}}function $s(e,t,n){const r=e.getProps();return Ac(r,t,n!==void 0?n:r.custom,e)}function Dc(e,t){return e?e[t]||e.default||e:void 0}const zp=new Set(["width","height","top","left","right","bottom",...xo]);let sa;function _E(){sa=void 0}const bn={now:()=>(sa===void 0&&bn.set(kt.isProcessing||FT.useManualTiming?kt.timestamp:performance.now()),sa),set:e=>{sa=e,queueMicrotask(_E)}};function Mc(e,t){e.indexOf(t)===-1&&e.push(t)}function ia(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function DE([...e],t,n){const r=t<0?e.length+t:t;if(r>=0&&r<e.length){const o=n<0?e.length+n:n,[s]=e.splice(t,1);e.splice(o,0,s)}return e}class Nc{constructor(){this.subscriptions=[]}add(t){return Mc(this.subscriptions,t),()=>ia(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Hp(e,t){return t?e*(1e3/t):0}const Up=30,ME=e=>!isNaN(parseFloat(e)),Rs={current:void 0};class NE{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const s=bn.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ME(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ji(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Nc);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Rs.current&&Rs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Up)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Up);return Hp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function To(e,t){return new NE(e,t)}function LE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,To(n))}function FE(e,t){const n=$s(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=CE(s[i]);LE(e,i,a)}}function VE(e){return!!(vt(e)&&e.add)}function Lc(e,t){const n=e.getValue("willChange");if(VE(n))return n.add(t)}function Gp(e){return e.props[Ep]}function Fc(e){let t;return()=>(t===void 0&&(t=e()),t)}const $E=Fc(()=>window.ScrollTimeline!==void 0);class RE{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if($E()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,s)=>{o&&o(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Yp extends RE{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const ln=e=>e*1e3,wn=e=>e/1e3;function aa(e){return typeof e=="function"}function qp(e,t){e.timeline=t,e.onfinish=null}const Vc=e=>Array.isArray(e)&&typeof e[0]=="number",BE={linearEasing:void 0};function jE(e,t){const n=Fc(e);return()=>{var r;return(r=BE[t])!==null&&r!==void 0?r:n()}}const la=jE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Kp=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(Pr(0,o-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Zp(e){return!!(typeof e=="function"&&la()||!e||typeof e=="string"&&(e in $c||la())||Vc(e)||Array.isArray(e)&&e.every(Zp))}const Bs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$c={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bs([0,.65,.55,1]),circOut:Bs([.55,0,1,.45]),backIn:Bs([.31,.01,.66,-.59]),backOut:Bs([.33,1.53,.69,.99])};function Xp(e,t){if(e)return typeof e=="function"&&la()?Kp(e,t):Vc(e)?Bs(e):Array.isArray(e)?e.map(n=>Xp(n,t)||$c.easeOut):$c[e]}const Qp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,WE=1e-7,zE=12;function HE(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Qp(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>WE&&++a<zE);return i}function js(e,t,n,r){if(e===t&&n===r)return zt;const o=s=>HE(s,0,1,e,n);return s=>s===0||s===1?s:Qp(o(s),t,r)}const Jp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,em=e=>t=>1-e(1-t),tm=js(.33,1.53,.69,.99),Rc=em(tm),nm=Jp(Rc),rm=e=>(e*=2)<1?.5*Rc(e):.5*(2-Math.pow(2,-10*(e-1))),Bc=e=>1-Math.sin(Math.acos(e)),om=em(Bc),sm=Jp(Bc),im=e=>/^0[^.\s]+$/u.test(e);function UE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||im(e):!0}const Ws=e=>Math.round(e*1e5)/1e5,jc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GE(e){return e==null}const YE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wc=(e,t)=>n=>!!(typeof n=="string"&&YE.test(n)&&n.startsWith(e)||t&&!GE(n)&&Object.prototype.hasOwnProperty.call(n,t)),am=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(jc);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},qE=e=>Bn(0,255,e),zc={...So,transform:e=>Math.round(qE(e))},kr={test:Wc("rgb","red"),parse:am("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zc.transform(e)+", "+zc.transform(t)+", "+zc.transform(n)+", "+Ws(Fs.transform(r))+")"};function KE(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Hc={test:Wc("#"),parse:KE,transform:kr.transform},Eo={test:Wc("hsl","hue"),parse:am("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vn.transform(Ws(t))+", "+vn.transform(Ws(n))+", "+Ws(Fs.transform(r))+")"},Dt={test:e=>kr.test(e)||Hc.test(e)||Eo.test(e),parse:e=>kr.test(e)?kr.parse(e):Eo.test(e)?Eo.parse(e):Hc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kr.transform(e):Eo.transform(e)},ZE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function XE(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(jc))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(ZE))===null||n===void 0?void 0:n.length)||0)>0}const lm="number",cm="color",QE="var",JE="var(",um="${}",eC=/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 zs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(eC,l=>(Dt.test(l)?(r.color.push(s),o.push(cm),n.push(Dt.parse(l))):l.startsWith(JE)?(r.var.push(s),o.push(QE),n.push(l)):(r.number.push(s),o.push(lm),n.push(parseFloat(l))),++s,um)).split(um);return{values:n,split:a,indexes:r,types:o}}function dm(e){return zs(e).values}function fm(e){const{split:t,types:n}=zs(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===lm?s+=Ws(o[i]):a===cm?s+=Dt.transform(o[i]):s+=o[i]}return s}}const tC=e=>typeof e=="number"?0:e;function nC(e){const t=dm(e);return fm(e)(t.map(tC))}const nr={test:XE,parse:dm,createTransformer:fm,getAnimatableNone:nC},rC=new Set(["brightness","contrast","saturate","opacity"]);function oC(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(jc)||[];if(!r)return e;const o=n.replace(r,"");let s=rC.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const sC=/\b([a-z-]*)\(.*?\)/gu,Uc={...nr,getAnimatableNone:e=>{const t=e.match(sC);return t?t.map(oC).join(" "):e}},iC={...Tc,color:Dt,backgroundColor:Dt,outlineColor:Dt,fill:Dt,stroke:Dt,borderColor:Dt,borderTopColor:Dt,borderRightColor:Dt,borderBottomColor:Dt,borderLeftColor:Dt,filter:Uc,WebkitFilter:Uc},Gc=e=>iC[e];function hm(e,t){let n=Gc(e);return n!==Uc&&(n=nr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const aC=new Set(["auto","none","0"]);function lC(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!aC.has(s)&&zs(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=hm(n,o)}const pm=e=>e===So||e===me,mm=(e,t)=>parseFloat(e.split(", ")[t]),gm=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return mm(o[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?mm(s[1],e):0}},cC=new Set(["x","y","z"]),uC=xo.filter(e=>!cC.has(e));function dC(e){const t=[];return uC.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:gm(4,13),y:gm(5,14)};Co.translateX=Co.x,Co.translateY=Co.y;const Ir=new Set;let Yc=!1,qc=!1;function ym(){if(qc){const e=Array.from(Ir).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=dC(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}qc=!1,Yc=!1,Ir.forEach(e=>e.complete()),Ir.clear()}function vm(){Ir.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(qc=!0)})}function fC(){vm(),ym()}class Kc{constructor(t,n,r,o,s,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ir.add(this),Yc||(Yc=!0,Ue.read(vm),Ue.resolveKeyframes(ym))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const i=o==null?void 0:o.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),o&&i===void 0&&o.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ir.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ir.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const bm=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),hC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pC(e){const t=hC.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const mC=4;function wm(e,t,n=1){tn(n<=mC,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=pC(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return bm(i)?parseFloat(i):i}return Sc(o)?wm(o,t,n+1):o}const xm=e=>t=>t.test(e),Sm=[So,me,vn,tr,lE,aE,{test:e=>e==="auto",parse:e=>e}],Tm=e=>Sm.find(xm(e));class Em extends Kc{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Sc(c))){const u=wm(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!zp.has(r)||t.length!==2)return;const[o,s]=t,i=Tm(o),a=Tm(s);if(i!==a)if(pm(i)&&pm(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)UE(t[o])&&r.push(o);r.length&&lC(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=Co[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Cm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nr.test(e)||e==="0")&&!e.startsWith("url("));function gC(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function yC(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Cm(o,t),a=Cm(s,t);return vo(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:gC(e)||(n==="spring"||aa(n))&&r}const vC=e=>e!==null;function ca(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(vC),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}const bC=40;class Pm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bn.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>bC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&fC(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bn.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:s,delay:i,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!yC(t,r,o,s))if(i)this.options.duration=0;else{l&&l(ca(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ua=2e4;function Zc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ua;)t+=n,r=e.next(t);return t>=ua?1/0:t}const Xe=(e,t,n)=>e+(t-e)*n;function Xc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wC({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Xc(l,a,e+1/3),s=Xc(l,a,e),i=Xc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function da(e,t){return n=>n>0?t:e}const Qc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},xC=[Hc,kr,Eo],SC=e=>xC.find(t=>t.test(e));function km(e){const t=SC(e);if(vo(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Eo&&(n=wC(n)),n}const Im=(e,t)=>{const n=km(e),r=km(t);if(!n||!r)return da(e,t);const o={...n};return s=>(o.red=Qc(n.red,r.red,s),o.green=Qc(n.green,r.green,s),o.blue=Qc(n.blue,r.blue,s),o.alpha=Xe(n.alpha,r.alpha,s),kr.transform(o))},TC=(e,t)=>n=>t(e(n)),Hs=(...e)=>e.reduce(TC),Jc=new Set(["none","hidden"]);function EC(e,t){return Jc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function CC(e,t){return n=>Xe(e,t,n)}function eu(e){return typeof e=="number"?CC:typeof e=="string"?Sc(e)?da:Dt.test(e)?Im:IC:Array.isArray(e)?Am:typeof e=="object"?Dt.test(e)?Im:PC:da}function Am(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>eu(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function PC(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=eu(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function kC(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,o[i]++}return r}const IC=(e,t)=>{const n=nr.createTransformer(t),r=zs(e),o=zs(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Jc.has(e)&&!o.values.length||Jc.has(t)&&!r.values.length?EC(e,t):Hs(Am(kC(r,o),o.values),n):(vo(!0,`Complex values '${e}' and '${t}' 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.`),da(e,t))};function Om(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xe(e,t,n):eu(e)(e,t)}const AC=5;function _m(e,t,n){const r=Math.max(t-AC,0);return Hp(n-e(r),t-r)}const nt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},tu=.001;function OC({duration:e=nt.duration,bounce:t=nt.bounce,velocity:n=nt.velocity,mass:r=nt.mass}){let o,s;vo(e<=ln(nt.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=Bn(nt.minDamping,nt.maxDamping,i),e=Bn(nt.minDuration,nt.maxDuration,wn(e)),i<1?(o=c=>{const u=c*i,d=u*e,f=u-n,h=nu(c,i),m=Math.exp(-d);return tu-f/h*m},s=c=>{const d=c*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),p=nu(Math.pow(c,2),i);return(-o(c)+tu>0?-1:1)*((f-h)*m)/p}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-tu+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=DC(o,s,a);if(e=ln(e),isNaN(l))return{stiffness:nt.stiffness,damping:nt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const _C=12;function DC(e,t,n){let r=n;for(let o=1;o<_C;o++)r=r-e(r)/t(r);return r}function nu(e,t){return e*Math.sqrt(1-t*t)}const MC=["duration","bounce"],NC=["stiffness","damping","mass"];function Dm(e,t){return t.some(n=>e[n]!==void 0)}function LC(e){let t={velocity:nt.velocity,stiffness:nt.stiffness,damping:nt.damping,mass:nt.mass,isResolvedFromDuration:!1,...e};if(!Dm(e,NC)&&Dm(e,MC))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Bn(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:nt.mass,stiffness:o,damping:s}}else{const n=OC(e);t={...t,...n,mass:nt.mass},t.isResolvedFromDuration=!0}return t}function ru(e=nt.visualDuration,t=nt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=LC({...n,velocity:-wn(n.velocity||0)}),m=f||0,p=c/(2*Math.sqrt(l*u)),v=i-s,b=wn(Math.sqrt(l/u)),y=Math.abs(v)<5;r||(r=y?nt.restSpeed.granular:nt.restSpeed.default),o||(o=y?nt.restDelta.granular:nt.restDelta.default);let g;if(p<1){const S=nu(b,p);g=E=>{const C=Math.exp(-p*b*E);return i-C*((m+p*b*v)/S*Math.sin(S*E)+v*Math.cos(S*E))}}else if(p===1)g=S=>i-Math.exp(-b*S)*(v+(m+b*v)*S);else{const S=b*Math.sqrt(p*p-1);g=E=>{const C=Math.exp(-p*b*E),I=Math.min(S*E,300);return i-C*((m+p*b*v)*Math.sinh(I)+S*v*Math.cosh(I))/S}}const T={calculatedDuration:h&&d||null,next:S=>{const E=g(S);if(h)a.done=S>=d;else{let C=0;p<1&&(C=S===0?ln(m):_m(g,S,E));const I=Math.abs(C)<=r,A=Math.abs(i-E)<=o;a.done=I&&A}return a.value=a.done?i:E,a},toString:()=>{const S=Math.min(Zc(T),ua),E=Kp(C=>T.next(S*C).value,S,30);return S+"ms "+E}};return T}function Mm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=I=>a!==void 0&&I<a||l!==void 0&&I>l,m=I=>a===void 0?l:l===void 0||Math.abs(a-I)<Math.abs(l-I)?a:l;let p=n*t;const v=d+p,b=i===void 0?v:i(v);b!==v&&(p=b-d);const y=I=>-p*Math.exp(-I/r),g=I=>b+y(I),T=I=>{const A=y(I),O=g(I);f.done=Math.abs(A)<=c,f.value=f.done?b:O};let S,E;const C=I=>{h(f.value)&&(S=I,E=ru({keyframes:[f.value,m(f.value)],velocity:_m(g,I,f.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:I=>{let A=!1;return!E&&S===void 0&&(A=!0,T(I),C(I)),S!==void 0&&I>=S?E.next(I-S):(!A&&T(I),f)}}}const FC=js(.42,0,1,1),VC=js(0,0,.58,1),Nm=js(.42,0,.58,1),Lm=e=>Array.isArray(e)&&typeof e[0]!="number",Fm={linear:zt,easeIn:FC,easeInOut:Nm,easeOut:VC,circIn:Bc,circInOut:sm,circOut:om,backIn:Rc,backInOut:nm,backOut:tm,anticipate:rm},ou=e=>{if(Vc(e)){tn(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return js(t,n,r,o)}else if(typeof e=="string")return tn(Fm[e]!==void 0,`Invalid easing type '${e}'`),Fm[e];return e};function $C(e,t,n){const r=[],o=n||Om,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||zt:t;a=Hs(l,a)}r.push(a)}return r}function Vm(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(tn(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=$C(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Pr(e[d],e[d+1],u);return a[d](f)};return n?u=>c(Bn(e[0],e[s-1],u)):c}function $m(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Pr(0,t,r);e.push(Xe(n,1,o))}}function Rm(e){const t=[0];return $m(t,e.length-1),t}function RC(e,t){return e.map(n=>n*t)}function BC(e,t){return e.map(()=>t||Nm).splice(0,e.length-1)}function Us({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Lm(r)?r.map(ou):ou(r),s={done:!1,value:t[0]},i=RC(n&&n.length===t.length?n:Rm(t),e),a=Vm(i,t,{ease:Array.isArray(o)?o:BC(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const jC=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>Rn(t),now:()=>kt.isProcessing?kt.timestamp:bn.now()}},WC={decay:Mm,inertia:Mm,tween:Us,keyframes:Us,spring:ru},zC=e=>e/100;class su extends Pm{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:o,keyframes:s}=this.options,i=(o==null?void 0:o.KeyframeResolver)||Kc,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new i(s,a,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=this.options,a=aa(n)?n:WC[n]||Us;let l,c;process.env.NODE_ENV!=="production"&&a!==Us&&tn(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==Us&&typeof t[0]!="number"&&(l=Hs(zC,Om(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Zc(u));const{calculatedDuration:d}=u,f=d+o,h=f*(r+1)-o;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:o,generator:s,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:h,repeatType:m,repeatDelay:p,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-f*(this.speed>=0?1:-1),y=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let g=this.currentTime,T=s;if(h){const I=Math.min(this.currentTime,u)/d;let A=Math.floor(I),O=I%1;!O&&I>=1&&(O=1),O===1&&A--,A=Math.min(A,h+1),!!(A%2)&&(m==="reverse"?(O=1-O,p&&(O-=p/d)):m==="mirror"&&(T=i)),g=Bn(0,1,O)*d}const S=y?{done:!1,value:l[0]}:T.next(g);a&&(S.value=a(S.value));let{done:E}=S;!y&&c!==null&&(E=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return C&&o!==void 0&&(S.value=ca(l,this.options,o)),v&&v(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?wn(t.calculatedDuration):0}get time(){return wn(this.currentTime)}set time(t){t=ln(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=wn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=jC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const HC=new Set(["opacity","clipPath","filter","transform"]);function UC(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Xp(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"})}const GC=Fc(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fa=10,YC=2e4;function qC(e){return aa(e.type)||e.type==="spring"||!Zp(e.ease)}function KC(e,t){const n=new su({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<YC;)r=n.sample(s),o.push(r.value),s+=fa;return{times:void 0,keyframes:o,duration:s-fa,ease:"linear"}}const Bm={anticipate:rm,backInOut:nm,circInOut:sm};function ZC(e){return e in Bm}class jm extends Pm{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:s}=this.options;this.resolver=new Em(s,(i,a)=>this.onKeyframesResolved(i,a),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:s,type:i,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&la()&&ZC(s)&&(s=Bm[s]),qC(this.options)){const{onComplete:d,onUpdate:f,motionValue:h,element:m,...p}=this.options,v=KC(t,p);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,o=v.times,s=v.ease,i="keyframes"}const u=UC(a.owner.current,l,t,{...this.options,duration:r,times:o,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(qp(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(ca(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:i,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return wn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return wn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ln(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return zt;const{animation:r}=n;qp(r,t)}return zt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:s,ease:i,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...h}=this.options,m=new su({...h,keyframes:r,duration:o,type:s,ease:i,times:a,isGenerator:!0}),p=ln(this.time);c.setWithVelocity(m.sample(p-fa).value,m.sample(p).value,fa)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:s,damping:i,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return GC()&&r&&HC.has(r)&&!l&&!c&&!o&&s!=="mirror"&&i!==0&&a!=="inertia"}}const XC={type:"spring",stiffness:500,damping:25,restSpeed:10},QC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),JC={type:"keyframes",duration:.8},eP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tP=(e,{keyframes:t})=>t.length>2?JC:Cr.has(e)?e.startsWith("scale")?QC(t[1]):XC:eP;function nP({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const iu=(e,t,n,r={},o,s)=>i=>{const a=Dc(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ln(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};nP(a)||(u={...u,...tP(e,u)}),u.duration&&(u.duration=ln(u.duration)),u.repeatDelay&&(u.repeatDelay=ln(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const f=ca(u.keyframes,a);if(f!==void 0)return Ue.update(()=>{u.onUpdate(f),u.onComplete()}),new Yp([])}return!s&&jm.supports(u)?new jm(u):new su(u)};function rP({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function au(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),h=l[d];if(h===void 0||u&&rP(u,d))continue;const m={delay:n,...Dc(i||{},d)};let p=!1;if(window.MotionHandoffAnimation){const b=Gp(e);if(b){const y=window.MotionHandoffAnimation(b,d,Ue);y!==null&&(m.startTime=y,p=!0)}}Lc(e,d),f.start(iu(d,f,h,e.shouldReduceMotion&&zp.has(d)?{type:!1}:m,e,p));const v=f.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{Ue.update(()=>{a&&FE(e,a)})}),c}function lu(e,t,n={}){var r;const o=$s(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(au(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return oP(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function oP(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(sP).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(lu(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function sP(e,t){return e.sortNodePosition(t)}function iP(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>lu(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=lu(e,t,n);else{const o=typeof t=="function"?$s(e,t,n.custom):t;r=Promise.all(au(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Wm(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const aP=vc.length;function zm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aP;n++){const r=vc[n],o=e.props[r];(Ns(o)||o===!1)&&(t[r]=o)}return t}const lP=[...yc].reverse(),cP=yc.length;function uP(e){return t=>Promise.all(t.map(({animation:n,options:r})=>iP(e,n,r)))}function dP(e){let t=uP(e),n=Hm(),r=!0;const o=l=>(c,u)=>{var d;const f=$s(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:m,...p}=f;c={...c,...p,...m}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=zm(e.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let v=0;v<cP;v++){const b=lP[v],y=n[b],g=c[b]!==void 0?c[b]:u[b],T=Ns(g),S=b===l?y.isActive:null;S===!1&&(m=v);let E=g===u[b]&&g!==c[b]&&T;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),y.protectedKeys={...h},!y.isActive&&S===null||!g&&!y.prevProp||ta(g)||typeof g=="boolean")continue;const C=fP(y.prevProp,g);let I=C||b===l&&y.isActive&&!E&&T||v>m&&T,A=!1;const O=Array.isArray(g)?g:[g];let L=O.reduce(o(b),{});S===!1&&(L={});const{prevResolvedValues:_={}}=y,V={..._,...L},k=N=>{I=!0,f.has(N)&&(A=!0,f.delete(N)),y.needsAnimating[N]=!0;const R=e.getValue(N);R&&(R.liveStyle=!1)};for(const N in V){const R=L[N],z=_[N];if(h.hasOwnProperty(N))continue;let D=!1;Oc(R)&&Oc(z)?D=!Wm(R,z):D=R!==z,D?R!=null?k(N):f.add(N):R!==void 0&&f.has(N)?k(N):y.protectedKeys[N]=!0}y.prevProp=g,y.prevResolvedValues=L,y.isActive&&(h={...h,...L}),r&&e.blockInitialAnimation&&(I=!1),I&&(!(E&&C)||A)&&d.push(...O.map(N=>({animation:N,options:{type:b}})))}if(f.size){const v={};if(typeof c.initial!="boolean"){const b=$s(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(v.transition=b.transition)}f.forEach(b=>{const y=e.getBaseTarget(b),g=e.getValue(b);g&&(g.liveStyle=!0),v[b]=y??null}),d.push({animation:v})}let p=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Hm(),r=!0}}}function fP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wm(t,e):!1}function Ar(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hm(){return{animate:Ar(!0),whileInView:Ar(),whileHover:Ar(),whileTap:Ar(),whileDrag:Ar(),whileFocus:Ar(),exit:Ar()}}class rr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hP extends rr{constructor(t){super(t),t.animationState||(t.animationState=dP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ta(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let pP=0;class mP extends rr{constructor(){super(...arguments),this.id=pP++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gP={animation:{Feature:hP},exit:{Feature:mP}},cn={x:!1,y:!1};function Um(){return cn.x||cn.y}function yP(e){return e==="x"||e==="y"?cn[e]?null:(cn[e]=!0,()=>{cn[e]=!1}):cn.x||cn.y?null:(cn.x=cn.y=!0,()=>{cn.x=cn.y=!1})}function Gs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const cu=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ys(e){return{point:{x:e.pageX,y:e.pageY}}}const vP=e=>t=>cu(t)&&e(t,Ys(t));function Po(e,t,n,r){return Gs(e,t,vP(n),r)}function Gm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function wP(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ym=1e-4,xP=1-Ym,SP=1+Ym,qm=.01,TP=0-qm,EP=0+qm;function $t(e){return e.max-e.min}function CP(e,t,n){return Math.abs(e-t)<=n}function Km(e,t,n,r=.5){e.origin=r,e.originPoint=Xe(t.min,t.max,e.origin),e.scale=$t(n)/$t(t),e.translate=Xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xP&&e.scale<=SP||isNaN(e.scale))&&(e.scale=1),(e.translate>=TP&&e.translate<=EP||isNaN(e.translate))&&(e.translate=0)}function qs(e,t,n,r){Km(e.x,t.x,n.x,r?r.originX:void 0),Km(e.y,t.y,n.y,r?r.originY:void 0)}function Zm(e,t,n){e.min=n.min+t.min,e.max=e.min+$t(t)}function PP(e,t,n){Zm(e.x,t.x,n.x),Zm(e.y,t.y,n.y)}function Xm(e,t,n){e.min=t.min-n.min,e.max=e.min+$t(t)}function Ks(e,t,n){Xm(e.x,t.x,n.x),Xm(e.y,t.y,n.y)}const Qm=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Qm(),y:Qm()}),Jm=()=>({min:0,max:0}),it=()=>({x:Jm(),y:Jm()});function nn(e){return[e("x"),e("y")]}function uu(e){return e===void 0||e===1}function du({scale:e,scaleX:t,scaleY:n}){return!uu(e)||!uu(t)||!uu(n)}function Or(e){return du(e)||eg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function eg(e){return tg(e.x)||tg(e.y)}function tg(e){return e&&e!=="0%"}function ha(e,t,n){const r=e-n,o=t*r;return n+o}function ng(e,t,n,r,o){return o!==void 0&&(e=ha(e,o,r)),ha(e,n,r)+t}function fu(e,t=0,n=1,r,o){e.min=ng(e.min,t,n,r,o),e.max=ng(e.max,t,n,r,o)}function rg(e,{x:t,y:n}){fu(e.x,t.translate,t.scale,t.originPoint),fu(e.y,n.translate,n.scale,n.originPoint)}const og=.999999999999,sg=1.0000000000001;function kP(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ao(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,rg(e,i)),r&&Or(s.latestValues)&&Ao(e,s.latestValues))}t.x<sg&&t.x>og&&(t.x=1),t.y<sg&&t.y>og&&(t.y=1)}function Io(e,t){e.min=e.min+t,e.max=e.max+t}function ig(e,t,n,r,o=.5){const s=Xe(e.min,e.max,o);fu(e,t,n,s,r)}function Ao(e,t){ig(e.x,t.x,t.scaleX,t.scale,t.originX),ig(e.y,t.y,t.scaleY,t.scale,t.originY)}function ag(e,t){return Gm(wP(e.getBoundingClientRect(),t))}function IP(e,t,n){const r=ag(e,n),{scroll:o}=t;return o&&(Io(r.x,o.offset.x),Io(r.y,o.offset.y)),r}function pa(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const lg=(e,t)=>Math.abs(e-t);function AP(e,t){const n=lg(e.x,t.x),r=lg(e.y,t.y);return Math.sqrt(n**2+r**2)}class cg{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=pu(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=AP(u.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:h}=u,{timestamp:m}=kt;this.history.push({...h,timestamp:m});const{onStart:p,onMove:v}=this.handlers;d||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=hu(d,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{pa(u,"release"),this.end();const{onEnd:f,onSessionEnd:h,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=pu(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:hu(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,p),h&&h(u,p)},!cu(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r;const s=Ys(t),i=hu(s,this.transformPagePoint),{point:a}=i,{timestamp:l}=kt;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,pu(i,this.history)),pa(t,"set"),this.removeListeners=Hs(Po(t.currentTarget,"pointermove",this.handlePointerMove),Po(t.currentTarget,"pointerup",this.handlePointerUp),Po(t.currentTarget,"pointercancel",this.handlePointerUp),Po(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Rn(this.updatePoint)}}function hu(e,t){return t?{point:t(e.point)}:e}function ug(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pu({point:e},t){return{point:e,delta:ug(e,dg(t)),offset:ug(e,OP(t)),velocity:_P(t,.1)}}function OP(e){return e[0]}function dg(e){return e[e.length-1]}function _P(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=dg(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ln(t)));)n--;if(!r)return{x:0,y:0};const s=wn(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function DP(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xe(n,e,r.max):Math.min(e,n)),e}function fg(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MP(e,{top:t,left:n,bottom:r,right:o}){return{x:fg(e.x,n,o),y:fg(e.y,t,r)}}function hg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function NP(e,t){return{x:hg(e.x,t.x),y:hg(e.y,t.y)}}function LP(e,t){let n=.5;const r=$t(e),o=$t(t);return o>r?n=Pr(t.min,t.max-r,e.min):r>o&&(n=Pr(e.min,e.max-o,t.min)),Bn(0,1,n)}function FP(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const mu=.35;function VP(e=mu){return e===!1?e=0:e===!0&&(e=mu),{x:pg(e,"left","right"),y:pg(e,"top","bottom")}}function pg(e,t,n){return{min:mg(e,t),max:mg(e,n)}}function mg(e,t){return typeof e=="number"?e:e[t]||0}const $P=new WeakMap;class RP{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=it(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ys(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:m}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yP(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nn(v=>{let b=this.getAxisMotionValue(v).get()||0;if(vn.test(b)){const{projection:y}=this.visualElement;if(y&&y.layout){const g=y.layout.layoutBox[v];g&&(b=$t(g)*(parseFloat(b)/100))}}this.originPoint[v]=b}),m&&Ue.postRender(()=>m(u,d)),Lc(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:v}=d;if(h&&this.currentDirection===null){this.currentDirection=BP(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),p&&p(u,d)},a=(u,d)=>this.stop(u,d),l=()=>nn(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new cg(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&Ue.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!ma(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=DP(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&wo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=MP(o.layoutBox,n):this.constraints=!1,this.elastic=VP(r),s!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&nn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=FP(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!wo(t))return!1;const r=t.current;tn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=IP(r,o.root,this.visualElement.getTransformPagePoint());let i=NP(o.layout.layoutBox,s);if(n){const a=n(bP(i));this.hasMutatedConstraints=!!a,a&&(i=Gm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=nn(u=>{if(!ma(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Lc(this.visualElement,t),r.start(iu(t,r,0,n,this.visualElement,!1))}stopAnimation(){nn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){nn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){nn(n=>{const{drag:r}=this.getProps();if(!ma(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-Xe(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wo(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};nn(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=LP({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),nn(i=>{if(!ma(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(Xe(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;$P.set(this.visualElement,this);const t=this.visualElement.current,n=Po(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();wo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const i=Gs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(nn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=mu,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function ma(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function BP(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class jP extends rr{constructor(t){super(t),this.removeGroupControls=zt,this.removeListeners=zt,this.controls=new RP(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zt}unmount(){this.removeGroupControls(),this.removeListeners()}}const gg=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class WP extends rr{constructor(){super(...arguments),this.removePointerDownListener=zt}onPointerDown(t){this.session=new cg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:gg(t),onStart:gg(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&Ue.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Po(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ga={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zs={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(me.test(e))e=parseFloat(e);else return e;const n=yg(e,t.target.x),r=yg(e,t.target.y);return`${n}% ${r}%`}},zP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=nr.parse(e);if(o.length>5)return r;const s=nr.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=Xe(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class HP extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;iE(UP),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ga.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,i=r.projection;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||Ue.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),wc.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vg(e){const[t,n]=dp(),r=w.useContext(Ms);return x.jsx(HP,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Cp),isPresent:t,safeToRemove:n})}const UP={borderRadius:{...Zs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zs,borderTopRightRadius:Zs,borderBottomLeftRadius:Zs,borderBottomRightRadius:Zs,boxShadow:zP};function bg(e,t,n){const r=vt(e)?e:To(e);return r.start(iu("",r,t,n)),r.animation}function wg(e){return e instanceof SVGElement&&e.tagName!=="svg"}const GP=(e,t)=>e.depth-t.depth;class YP{constructor(){this.children=[],this.isDirty=!1}add(t){Mc(this.children,t),this.isDirty=!0}remove(t){ia(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GP),this.isDirty=!1,this.children.forEach(t)}}function qP(e,t){const n=bn.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Rn(r),e(s-t))};return Ue.read(r,!0),()=>Rn(r)}const xg=["TopLeft","TopRight","BottomLeft","BottomRight"],KP=xg.length,Sg=e=>typeof e=="string"?parseFloat(e):e,Tg=e=>typeof e=="number"||me.test(e);function ZP(e,t,n,r,o,s){o?(e.opacity=Xe(0,n.opacity!==void 0?n.opacity:1,XP(r)),e.opacityExit=Xe(t.opacity!==void 0?t.opacity:1,0,QP(r))):s&&(e.opacity=Xe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<KP;i++){const a=`border${xg[i]}Radius`;let l=Eg(t,a),c=Eg(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Tg(l)===Tg(c)?(e[a]=Math.max(Xe(Sg(l),Sg(c),r),0),(vn.test(c)||vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Xe(t.rotate||0,n.rotate||0,r))}function Eg(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const XP=Cg(0,.5,om),QP=Cg(.5,.95,zt);function Cg(e,t,n){return r=>r<e?0:r>t?1:n(Pr(e,t,r))}function Pg(e,t){e.min=t.min,e.max=t.max}function rn(e,t){Pg(e.x,t.x),Pg(e.y,t.y)}function kg(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ig(e,t,n,r,o){return e-=t,e=ha(e,1/n,r),o!==void 0&&(e=ha(e,1/o,r)),e}function JP(e,t=0,n=1,r=.5,o,s=e,i=e){if(vn.test(t)&&(t=parseFloat(t),t=Xe(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Xe(s.min,s.max,r);e===s&&(a-=t),e.min=Ig(e.min,t,n,a,o),e.max=Ig(e.max,t,n,a,o)}function Ag(e,t,[n,r,o],s,i){JP(e,t[n],t[r],t[o],t.scale,s,i)}const ek=["x","scaleX","originX"],tk=["y","scaleY","originY"];function Og(e,t,n,r){Ag(e.x,t,ek,n?n.x:void 0,r?r.x:void 0),Ag(e.y,t,tk,n?n.y:void 0,r?r.y:void 0)}function _g(e){return e.translate===0&&e.scale===1}function Dg(e){return _g(e.x)&&_g(e.y)}function Mg(e,t){return e.min===t.min&&e.max===t.max}function nk(e,t){return Mg(e.x,t.x)&&Mg(e.y,t.y)}function Ng(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lg(e,t){return Ng(e.x,t.x)&&Ng(e.y,t.y)}function Fg(e){return $t(e.x)/$t(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class rk{constructor(){this.members=[]}add(t){Mc(this.members,t),t.scheduleRender()}remove(t){if(ia(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ok(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const gu=["","X","Y","Z"],sk={visibility:"hidden"},$g=1e3;let ik=0;function yu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rg(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Gp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rg(r)}function Bg({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=ik++,this.animationId=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.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(ck),this.nodes.forEach(pk),this.nodes.forEach(mk),this.nodes.forEach(uk)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new YP)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Nc),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wg(i),this.instance=i;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=qP(f,250),ga.hasAnimatedSinceResize&&(ga.hasAnimatedSinceResize=!1,this.nodes.forEach(Wg))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||wk,{onLayoutAnimationStart:v,onLayoutAnimationComplete:b}=u.getProps(),y=!this.targetLayout||!Lg(this.targetLayout,m),g=!f&&h;if(this.options.layoutRoot||this.resumeFrom||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const T={...Dc(p,"layout"),onPlay:v,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else f||Wg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Rn(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(gk),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rg(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}this.isUpdating||this.nodes.forEach(fk),this.isUpdating=!1,this.nodes.forEach(hk),this.nodes.forEach(ak),this.nodes.forEach(lk),this.clearAllSnapshots();const a=bn.now();kt.delta=Bn(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,gc.update.process(kt),gc.preRender.process(kt),gc.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(dk),this.sharedNodes.forEach(yk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$t(this.snapshot.measuredBox.x)&&!$t(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=it(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Dg(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&(a||Or(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),xk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var i;const{visualElement:a}=this.options;if(!a)return it();const l=a.measureViewportBox();if(!(((i=this.scroll)===null||i===void 0?void 0:i.wasRoot)||this.path.some(Sk))){const{scroll:u}=this.root;u&&(Io(l.x,u.offset.x),Io(l.y,u.offset.y))}return l}removeElementScroll(i){var a;const l=it();if(rn(l,i),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&rn(l,i),Io(l.x,d.offset.x),Io(l.y,d.offset.y))}return l}applyTransform(i,a=!1){const l=it();rn(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ao(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Or(u.latestValues)&&Ao(l,u.latestValues)}return Or(this.latestValues)&&Ao(l,this.latestValues),l}removeTransform(i){const a=it();rn(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Or(c.latestValues))continue;du(c.latestValues)&&c.updateSnapshot();const u=it(),d=c.measurePageBox();rn(u,d),Og(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Or(this.latestValues)&&Og(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}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!==kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),Ks(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rn(this.target,this.layout.layoutBox),rg(this.target,this.targetDelta)):rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),Ks(this.relativeTargetOrigin,this.target,h.target),rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||du(this.parent.latestValues)||eg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var i;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===kt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;rn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;kP(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=it());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(kg(this.prevProjectionDelta.x,this.projectionDelta.x),kg(this.prevProjectionDelta.y,this.projectionDelta.y)),qs(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ko(),this.projectionDelta=ko(),this.projectionDeltaWithTransform=ko()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=ko();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=it(),h=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=h!==m,v=this.getStack(),b=!v||v.members.length<=1,y=!!(p&&!b&&this.options.crossfade===!0&&!this.path.some(bk));this.animationProgress=0;let g;this.mixTargetDelta=T=>{const S=T/1e3;zg(d.x,i.x,S),zg(d.y,i.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ks(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vk(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&nk(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=it()),rn(g,this.relativeTarget)),p&&(this.animationValues=u,ZP(u,c,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Rn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{ga.hasAnimatedSinceResize=!0,this.currentAnimation=bg(0,$g,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($g),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&qg(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||it();const d=$t(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const f=$t(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}rn(a,l),Ao(a,u),qs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new rk),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&yu("z",i,c,this.animationValues);for(let u=0;u<gu.length;u++)yu(`rotate${gu[u]}`,i,c,this.animationValues),yu(`skew${gu[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return sk;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=oa(i==null?void 0:i.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=oa(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Or(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=ok(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:h,y:m}=this.projectionDelta;c.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const p in Ls){if(f[p]===void 0)continue;const{correct:v,applyTo:b,isCSSVariable:y}=Ls[p],g=c.transform==="none"?f[p]:v(f[p],d);if(b){const T=b.length;for(let S=0;S<T;S++)c[b[S]]=g}else y?this.options.visualElement.renderState.vars[p]=g:c[p]=g}return this.options.layoutId&&(c.pointerEvents=d===this?oa(i==null?void 0:i.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function ak(e){e.updateLayout()}function lk(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=n.source!==e.layout.source;s==="size"?nn(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],h=$t(f);f.min=r[d].min,f.max=f.min+h}):qg(s,n.layoutBox,r)&&nn(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],h=$t(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=ko();qs(a,r,n.layoutBox);const l=ko();i?qs(l,e.applyTransform(o,!0),n.measuredBox):qs(l,r,n.layoutBox);const c=!Dg(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=it();Ks(m,n.layoutBox,f.layoutBox);const p=it();Ks(p,r,h.layoutBox),Lg(m,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ck(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function uk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dk(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function fk(e){e.isLayoutDirty=!1}function hk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pk(e){e.resolveTargetDelta()}function mk(e){e.calcProjection()}function gk(e){e.resetSkewAndRotation()}function yk(e){e.removeLeadSnapshot()}function zg(e,t,n){e.translate=Xe(t.translate,0,n),e.scale=Xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hg(e,t,n,r){e.min=Xe(t.min,n.min,r),e.max=Xe(t.max,n.max,r)}function vk(e,t,n,r){Hg(e.x,t.x,n.x,r),Hg(e.y,t.y,n.y,r)}function bk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wk={duration:.45,ease:[.4,0,.1,1]},Ug=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gg=Ug("applewebkit/")&&!Ug("chrome/")?Math.round:zt;function Yg(e){e.min=Gg(e.min),e.max=Gg(e.max)}function xk(e){Yg(e.x),Yg(e.y)}function qg(e,t,n){return e==="position"||e==="preserve-aspect"&&!CP(Fg(t),Fg(n),.2)}function Sk(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Tk=Bg({attachResizeListener:(e,t)=>Gs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vu={current:void 0},Kg=Bg({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vu.current){const e=new Tk({});e.mount(window),e.setOptions({layoutScroll:!0}),vu.current=e}return vu.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ek={pan:{Feature:WP},drag:{Feature:jP,ProjectionNode:Kg,MeasureLayout:vg}};function Zg(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);const s=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Xg(e,t){const n=Zg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Qg(e){return!(e.pointerType==="touch"||Um())}function Ck(e,t,n={}){const[r,o,s]=Xg(e,n),i=a=>{if(!Qg(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Qg(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}function Jg(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&Ue.postRender(()=>s(t,Ys(t)))}class Pk extends rr{mount(){const{current:t}=this.node;t&&(this.unmount=Ck(t,(n,r)=>(Jg(this.node,r,"Start"),o=>Jg(this.node,o,"End"))))}unmount(){}}class kk extends rr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=Hs(Gs(this.node.current,"focus",()=>this.onFocus()),Gs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const ey=(e,t)=>t?e===t?!0:ey(e,t.parentElement):!1,Ik=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ak(e){return Ik.has(e.tagName)||e.tabIndex!==-1}const Xs=new WeakSet;function ty(e){return t=>{t.key==="Enter"&&e(t)}}function bu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ok=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ty(()=>{if(Xs.has(n))return;bu(n,"down");const o=ty(()=>{bu(n,"up")}),s=()=>bu(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ny(e){return cu(e)&&!Um()}function _k(e,t,n={}){const[r,o,s]=Xg(e,n),i=a=>{const l=a.currentTarget;if(!l||!ny(a)||Xs.has(l))return;Xs.add(l),pa(a,"set");const c=t(l,a),u=(h,m)=>{l.removeEventListener("pointerup",d),l.removeEventListener("pointercancel",f),pa(h,"release"),!(!ny(h)||!Xs.has(l))&&(Xs.delete(l),typeof c=="function"&&c(h,{success:m}))},d=h=>{(h.isTrusted?Dk(h,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(h,!1):u(h,!(l instanceof Element)||ey(l,h.target))},f=h=>{u(h,!1)};l.addEventListener("pointerup",d,o),l.addEventListener("pointercancel",f,o),l.addEventListener("lostpointercapture",f,o)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!Ak(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",i,o),l&&a.addEventListener("focus",c=>Ok(c,o),o)}),s}function Dk(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function ry(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&Ue.postRender(()=>s(t,Ys(t)))}class Mk extends rr{mount(){const{current:t}=this.node;t&&(this.unmount=_k(t,(n,r)=>(ry(this.node,r,"Start"),(o,{success:s})=>ry(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wu=new WeakMap,xu=new WeakMap,Nk=e=>{const t=wu.get(e.target);t&&t(e)},Lk=e=>{e.forEach(Nk)};function Fk({root:e,...t}){const n=e||document;xu.has(n)||xu.set(n,{});const r=xu.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Lk,{root:e,...t})),r[o]}function Vk(e,t,n){const r=Fk(t);return wu.set(e,n),r.observe(e),()=>{wu.delete(e),r.unobserve(e)}}const $k={some:0,all:1};class Rk extends rr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:$k[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Vk(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Bk(t,n))&&this.startObserver()}unmount(){}}function Bk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jk={inView:{Feature:Rk},tap:{Feature:Mk},focus:{Feature:kk},hover:{Feature:Pk}},Wk={layout:{ProjectionNode:Kg,MeasureLayout:vg}},Su={current:null},oy={current:!1};function zk(){if(oy.current=!0,!!mc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Su.current=e.matches;e.addListener(t),t()}else Su.current=!1}const Hk=[...Sm,Dt,nr],Uk=e=>Hk.find(xm(e)),Qs=new WeakMap;function Gk(e,t,n){for(const r in t){const o=t[r],s=n[r];if(vt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Ji(o.version==="12.4.7",`Attempting to mix Motion versions ${o.version} with 12.4.7 may not work as expected.`);else if(vt(s))e.addValue(r,To(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,To(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iy{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Kc,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{const h=bn.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=i;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=na(n),this.isVariantNode=Sp(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const m=f[h];l[h]!==void 0&&vt(m)&&m.set(l[h],!1)}}mount(t){this.current=t,Qs.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((n,r)=>this.bindToMotionValue(r,n)),oy.current||zk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Su.current,process.env.NODE_ENV!=="production"&&Ji(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Rn(this.notifyUpdate),Rn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Cr.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bo){const n=bo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):it()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<sy.length;r++){const o=sy[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Gk(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=To(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(bm(o)||im(o))?o=parseFloat(o):!Uk(o)&&nr.test(n)&&(o=hm(t,n)),this.setBaseTarget(t,vt(o)?o.get():o)),vt(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const i=Ac(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);i&&(o=i[t])}if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!vt(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nc),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ay extends iy{constructor(){super(...arguments),this.KeyframeResolver=Em}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;vt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Yk(e){return window.getComputedStyle(e)}class ly extends ay{constructor(){super(...arguments),this.type="html",this.renderInstance=$p}readValueFromInstance(t,n){if(Cr.has(n)){const r=Gc(n);return r&&r.default||0}else{const r=Yk(t),o=(xc(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ag(t,n)}build(t,n,r){Ec(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return _c(t,n,r)}}class cy extends ay{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Vp(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Cr.has(n)){const r=Gc(n);return r&&r.default||0}return n=Rp.has(n)?n:bc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return jp(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ue.postRender(this.updateDimensions)}build(t,n,r){kc(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){Bp(t,n,r,o)}mount(t){this.isSVGTag=Ic(t.tagName),super.mount(t)}}const qk=(e,t)=>Pc(e)?new cy(t):new ly(t,{allowProjection:e!==w.Fragment}),Kk=OE({...gP,...jk,...Ek,...Wk},qk),at=YT(Kk);function _r(e){const t=an(()=>To(e)),{isStatic:n}=w.useContext(yo);if(n){const[,r]=w.useState(e);w.useEffect(()=>t.on("change",r),[])}return t}function uy(e,t){const n=_r(t()),r=()=>n.set(t());return r(),Zi(()=>{const o=()=>Ue.preRender(r,!1,!0),s=e.map(i=>i.on("change",o));return()=>{s.forEach(i=>i()),Rn(r)}}),n}const Zk=e=>e&&typeof e=="object"&&e.mix,Xk=e=>Zk(e)?e.mix:void 0;function Qk(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],o=e[1+n],s=e[2+n],i=e[3+n],a=Vm(o,s,{mixer:Xk(s[0]),...i});return t?a(r):a}function Jk(e){Rs.current=[],e();const t=uy(Rs.current,e);return Rs.current=void 0,t}function eI(e,t,n,r){if(typeof e=="function")return Jk(e);const o=typeof t=="function"?t:Qk(t,n,r);return Array.isArray(e)?dy(e,o):dy([e],([s])=>o(s))}function dy(e,t){const n=an(()=>[]);return uy(e,()=>{n.length=0;const r=e.length;for(let o=0;o<r;o++)n[o]=e[o].get();return t(n)})}function tI(e){return w.useEffect(()=>()=>e(),[])}function nI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Zc(r),ua);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:wn(o)}}const rI=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function fy(e,t){return Lm(e)?e[rI(0,e.length,t)]:e}function Tu(e){return typeof e=="object"&&!Array.isArray(e)}function hy(e,t,n,r){return typeof e=="string"&&Tu(t)?Zg(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function oI(e,t,n){return e*(t+1)}function py(e,t,n,r){var o;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(o=r.get(t))!==null&&o!==void 0?o:e}function sI(e,t,n){for(let r=0;r<e.length;r++){const o=e[r];o.at>t&&o.at<n&&(ia(e,o),r--)}}function iI(e,t,n,r,o,s){sI(e,o,s);for(let i=0;i<t.length;i++)e.push({value:t[i],at:Xe(o,s,r[i]),easing:fy(n,i)})}function aI(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function lI(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const cI="easeInOut",uI=20;function dI(e,{defaultTransition:t={},...n}={},r,o){const s=t.duration||.3,i=new Map,a=new Map,l={},c=new Map;let u=0,d=0,f=0;for(let h=0;h<e.length;h++){const m=e[h];if(typeof m=="string"){c.set(m,d);continue}else if(!Array.isArray(m)){c.set(m.name,py(d,m.at,u,c));continue}let[p,v,b={}]=m;b.at!==void 0&&(d=py(d,b.at,u,c));let y=0;const g=(T,S,E,C=0,I=0)=>{const A=fI(T),{delay:O=0,times:L=Rm(A),type:_="keyframes",repeat:V,repeatType:k,repeatDelay:M=0,...F}=S;let{ease:N=t.ease||"easeOut",duration:R}=S;const z=typeof O=="function"?O(C,I):O,D=A.length,B=aa(_)?_:o==null?void 0:o[_];if(D<=2&&B){let G=100;if(D===2&&mI(A)){const H=A[1]-A[0];G=Math.abs(H)}const $={...F};R!==void 0&&($.duration=ln(R));const j=nI($,G,B);N=j.ease,R=j.duration}R??(R=s);const Z=d+z;L.length===1&&L[0]===0&&(L[1]=1);const oe=L.length-A.length;if(oe>0&&$m(L,oe),A.length===1&&A.unshift(null),V){tn(V<uI,"Repeat count too high, must be less than 20"),R=oI(R,V);const G=[...A],$=[...L];N=Array.isArray(N)?[...N]:[N];const j=[...N];for(let H=0;H<V;H++){A.push(...G);for(let Y=0;Y<G.length;Y++)L.push($[Y]+(H+1)),N.push(Y===0?"linear":fy(j,Y-1))}aI(L,V)}const te=Z+R;iI(E,A,N,L,Z,te),y=Math.max(z+R,y),f=Math.max(te,f)};if(vt(p)){const T=my(p,a);g(v,b,gy("default",T))}else{const T=hy(p,v,r,l),S=T.length;for(let E=0;E<S;E++){v=v,b=b;const C=T[E],I=my(C,a);for(const A in v)g(v[A],hI(b,A),gy(A,I),E,S)}}u=d,d+=y}return a.forEach((h,m)=>{for(const p in h){const v=h[p];v.sort(lI);const b=[],y=[],g=[];for(let S=0;S<v.length;S++){const{at:E,value:C,easing:I}=v[S];b.push(C),y.push(Pr(0,f,E)),g.push(I||"easeOut")}y[0]!==0&&(y.unshift(0),b.unshift(b[0]),g.unshift(cI)),y[y.length-1]!==1&&(y.push(1),b.push(null)),i.has(m)||i.set(m,{keyframes:{},transition:{}});const T=i.get(m);T.keyframes[p]=b,T.transition[p]={...t,duration:f,ease:g,times:y,...n}}}),i}function my(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function gy(e,t){return t[e]||(t[e]=[]),t[e]}function fI(e){return Array.isArray(e)?e:[e]}function hI(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const pI=e=>typeof e=="number",mI=e=>e.every(pI);function gI(e,t){return e in t}class yI extends iy{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(gI(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return it()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function vI(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=wg(e)?new cy(t):new ly(t);n.mount(e),Qs.set(e,n)}function bI(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new yI(t);n.mount(e),Qs.set(e,n)}function wI(e,t){return vt(e)||typeof e=="number"||typeof e=="string"&&!Tu(t)}function yy(e,t,n,r){const o=[];if(wI(e,t))o.push(bg(e,Tu(t)&&t.default||t,n&&(n.default||n)));else{const s=hy(e,t,r),i=s.length;tn(!!i,"No valid elements provided.");for(let a=0;a<i;a++){const l=s[a],c=l instanceof Element?vI:bI;Qs.has(l)||c(l);const u=Qs.get(l),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(a,i)),o.push(...au(u,{...t,transition:d},{}))}}return o}function xI(e,t,n){const r=[];return dI(e,t,n,{spring:ru}).forEach(({keyframes:s,transition:i},a)=>{r.push(...yy(a,s,i))}),r}function SI(e){return Array.isArray(e)&&e.some(Array.isArray)}function TI(e){function t(n,r,o){let s=[];SI(n)?s=xI(n,r,e):s=yy(n,r,o,e);const i=new Yp(s);return e&&e.animations.push(i),i}return t}function EI(){const e=an(()=>({current:null,animations:[]})),t=an(()=>TI(e));return tI(()=>{e.animations.forEach(n=>n.stop())}),[e,t]}class CI{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const PI=()=>new CI;function kI(){return an(PI)}function II(e,t){if(e==="first")return 0;{const n=t-1;return e==="last"?n:n/2}}function AI(e=.1,{startDelay:t=0,from:n=0,ease:r}={}){return(o,s)=>{const i=typeof n=="number"?n:II(n,s),a=Math.abs(i-o);let l=e*a;if(r){const c=s*e;l=ou(r)(l/c)*c}return t+l}}const vy=w.createContext(null);function OI(e,t,n,r){if(!r)return e;const o=e.findIndex(u=>u.value===t);if(o===-1)return e;const s=r>0?1:-1,i=e[o+s];if(!i)return e;const a=e[o],l=i.layout,c=Xe(l.min,l.max,.5);return s===1&&a.layout.max+n>c||s===-1&&a.layout.min+n<c?DE(e,o,o+s):e}function _I({children:e,as:t="ul",axis:n="y",onReorder:r,values:o,...s},i){const a=an(()=>at[t]),l=[],c=w.useRef(!1);tn(!!o,"Reorder.Group must be provided a values prop");const u={axis:n,registerItem:(d,f)=>{const h=l.findIndex(m=>d===m.value);h!==-1?l[h].layout=f[n]:l.push({value:d,layout:f[n]}),l.sort(MI)},updateOrder:(d,f,h)=>{if(c.current)return;const m=OI(l,d,f,h);l!==m&&(c.current=!0,r(m.map(DI).filter(p=>o.indexOf(p)!==-1)))}};return w.useEffect(()=>{c.current=!1}),x.jsx(a,{...s,ref:i,ignoreStrict:!0,children:x.jsx(vy.Provider,{value:u,children:e})})}const by=w.forwardRef(_I);function DI(e){return e.value}function MI(e,t){return e.layout.min-t.layout.min}function wy(e,t=0){return vt(e)?e:_r(t)}function NI({children:e,style:t={},value:n,as:r="li",onDrag:o,layout:s=!0,...i},a){const l=an(()=>at[r]),c=w.useContext(vy),u={x:wy(t.x),y:wy(t.y)},d=eI([u.x,u.y],([p,v])=>p||v?1:"unset");tn(!!c,"Reorder.Item must be a child of Reorder.Group");const{axis:f,registerItem:h,updateOrder:m}=c;return x.jsx(l,{drag:f,...i,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:d},layout:s,onDrag:(p,v)=>{const{velocity:b}=v;b[f]&&m(n,u[f].get(),b[f]),o&&o(p,v)},onLayoutMeasure:p=>h(n,p),ref:a,ignoreStrict:!0,children:e})}const xy=w.forwardRef(NI);/**
13
13
  * @license lucide-react v0.414.0 - ISC
14
14
  *
15
15
  * This source code is licensed under the ISC license.
16
16
  * See the LICENSE file in the root directory of this source tree.
17
- */const MI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sy=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
17
+ */const LI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sy=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
18
18
  * @license lucide-react v0.414.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
- */var NI={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"};/**
22
+ */var FI={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"};/**
23
23
  * @license lucide-react v0.414.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */const LI=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>w.createElement("svg",{ref:l,...NI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sy("lucide",o),...a},[...i.map(([c,u])=>w.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
27
+ */const VI=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>w.createElement("svg",{ref:l,...FI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sy("lucide",o),...a},[...i.map(([c,u])=>w.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
28
28
  * @license lucide-react v0.414.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const ft=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement(LI,{ref:s,iconNode:t,className:Sy(`lucide-${MI(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
32
+ */const ft=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement(VI,{ref:s,iconNode:t,className:Sy(`lucide-${LI(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
33
33
  * @license lucide-react v0.414.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
- */const FI=ft("ArrowDown01",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["rect",{x:"15",y:"4",width:"4",height:"6",ry:"2",key:"1bwicg"}],["path",{d:"M17 20v-6h-2",key:"1qp1so"}],["path",{d:"M15 20h4",key:"1j968p"}]]);/**
37
+ */const $I=ft("ArrowDown01",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["rect",{x:"15",y:"4",width:"4",height:"6",ry:"2",key:"1bwicg"}],["path",{d:"M17 20v-6h-2",key:"1qp1so"}],["path",{d:"M15 20h4",key:"1j968p"}]]);/**
38
38
  * @license lucide-react v0.414.0 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const VI=ft("ArrowUp01",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["rect",{x:"15",y:"4",width:"4",height:"6",ry:"2",key:"1bwicg"}],["path",{d:"M17 20v-6h-2",key:"1qp1so"}],["path",{d:"M15 20h4",key:"1j968p"}]]);/**
42
+ */const RI=ft("ArrowUp01",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["rect",{x:"15",y:"4",width:"4",height:"6",ry:"2",key:"1bwicg"}],["path",{d:"M17 20v-6h-2",key:"1qp1so"}],["path",{d:"M15 20h4",key:"1j968p"}]]);/**
43
43
  * @license lucide-react v0.414.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
@@ -49,22 +49,22 @@
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const $I=ft("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
52
+ */const BI=ft("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
53
53
  * @license lucide-react v0.414.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */const Su=ft("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
57
+ */const Eu=ft("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
58
58
  * @license lucide-react v0.414.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const RI=ft("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
62
+ */const jI=ft("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
63
63
  * @license lucide-react v0.414.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
- */const Tu=ft("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
67
+ */const Cu=ft("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
68
68
  * @license lucide-react v0.414.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
@@ -74,7 +74,7 @@
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const BI=ft("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
77
+ */const WI=ft("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
78
78
  * @license lucide-react v0.414.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
@@ -84,7 +84,7 @@
84
84
  *
85
85
  * This source code is licensed under the ISC license.
86
86
  * See the LICENSE file in the root directory of this source tree.
87
- */const jI=ft("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
87
+ */const zI=ft("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
88
88
  * @license lucide-react v0.414.0 - ISC
89
89
  *
90
90
  * This source code is licensed under the ISC license.
@@ -94,22 +94,22 @@
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
- */const WI=ft("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
97
+ */const HI=ft("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
98
98
  * @license lucide-react v0.414.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
- */const Eu=ft("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
102
+ */const Pu=ft("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
103
103
  * @license lucide-react v0.414.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
- */const zI=ft("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
107
+ */const UI=ft("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
108
108
  * @license lucide-react v0.414.0 - ISC
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const HI=ft("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
112
+ */const GI=ft("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
113
113
  * @license lucide-react v0.414.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
@@ -119,22 +119,22 @@
119
119
  *
120
120
  * This source code is licensed under the ISC license.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
- */const UI=ft("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
122
+ */const YI=ft("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
123
123
  * @license lucide-react v0.414.0 - ISC
124
124
  *
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
- */const GI=ft("Ungroup",[["rect",{width:"8",height:"6",x:"5",y:"4",rx:"1",key:"nzclkv"}],["rect",{width:"8",height:"6",x:"11",y:"14",rx:"1",key:"4tytwb"}]]);/**
127
+ */const qI=ft("Ungroup",[["rect",{width:"8",height:"6",x:"5",y:"4",rx:"1",key:"nzclkv"}],["rect",{width:"8",height:"6",x:"11",y:"14",rx:"1",key:"4tytwb"}]]);/**
128
128
  * @license lucide-react v0.414.0 - ISC
129
129
  *
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
- */const YI=ft("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
132
+ */const KI=ft("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
133
133
  * @license lucide-react v0.414.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
- */const Cu=ft("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ky={true:{opacity:1,height:"auto"},false:{opacity:[.7,.3,0],height:0}},qI={type:"tween",duration:.7,ease:[.04,.62,.23,.98]},Iy=e=>x.jsx(at.div,{...e,layout:!0,layoutRoot:!0,layoutScroll:!0,initial:!1,variants:ky,exit:ky.false,transition:qI,"aria-hidden":!e.open,"data-component":"collapse",animate:e.open.toString(),className:Me("aria-hidden:pointer-events-none",e.className),children:e.children}),KI=po("p-4 w-full block border relative rounded-lg text-sm",{variants:{theme:{primary:"bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",danger:"bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",info:"bg-alert-info-bg text-alert-info-text border-alert-info-border",success:"bg-alert-success-bg text-alert-success-text border-alert-success-border",secondary:"bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",warn:"bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",neutral:"bg-transparent border border-card-border text-alert-primary-text"}},defaultVariants:{theme:"neutral"}}),ZI=w.forwardRef(function({className:t,theme:n,Icon:r,onClose:o,open:s=!0,...i},a){const l=()=>o==null?void 0:o(!1);return x.jsx("div",{"data-open":!!s,"aria-hidden":!s,"data-component":"alert",className:Me("isolate w-full",s?"pointer-events-auto":"pointer-events-none"),children:x.jsx(Iy,{"data-open":!!s,open:!!s,children:x.jsxs(mo,{...i,ref:a,role:"alert","data-theme":n,as:i.as??"div",className:Me(KI({theme:n}),t),children:[x.jsxs("h4",{className:"mb-2 flex items-center gap-2",children:[!r&&n==="success"?x.jsx(Ey,{size:20}):null,!r&&n==="info"?x.jsx(Py,{size:20}):null,!r&&n==="danger"?x.jsx(UI,{size:20}):null,r,x.jsx("span",{className:"tracking-3 text-balance text-lg font-semibold",children:i.title})]}),i.children,o!==void 0?x.jsx("button",{type:"button",onClick:l,className:"absolute right-3 top-3 text-foreground transition-colors duration-300 ease-in-out hover:text-danger",children:x.jsx(Cu,{size:20})}):null]})})})});function Le(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Qe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function _o(e,t){const n=Le(e);return isNaN(t)?Qe(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ga(e,t){const n=Le(e);if(isNaN(t))return Qe(e,NaN);if(!t)return n;const r=n.getDate(),o=Qe(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const s=o.getDate();return r>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Ay=6048e5,XI=864e5,QI=6e4,JI=36e5,eA=1e3;let tA={};function Dr(){return tA}function xn(e,t){var a,l,c,u;const n=Dr(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Le(e),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Do(e){return xn(e,{weekStartsOn:1})}function Oy(e){const t=Le(e),n=t.getFullYear(),r=Qe(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Do(r),s=Qe(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const i=Do(s);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Mo(e){const t=Le(e);return t.setHours(0,0,0,0),t}function ya(e){const t=Le(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function nA(e,t){const n=Mo(e),r=Mo(t),o=+n-ya(n),s=+r-ya(r);return Math.round((o-s)/XI)}function rA(e){const t=Oy(e),n=Qe(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Do(n)}function _y(e,t){const n=t*7;return _o(e,n)}function Dy(e,t){return ga(e,t*12)}function oA(e){return Qe(e,Date.now())}function sA(e,t){const n=Mo(e),r=Mo(t);return+n==+r}function iA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function My(e){if(!iA(e)&&typeof e!="number")return!1;const t=Le(e);return!isNaN(Number(t))}function Ny(e,t){const n=Le(e.start),r=Le(e.end);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0);let a=1;const l=[];for(;+i<=s;)l.push(Le(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return o?l.reverse():l}function Ly(e){const t=Le(e);return t.setDate(1),t.setHours(0,0,0,0),t}function aA(e){const t=Le(e),n=Qe(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function lA(e,t){var a,l;const n=Dr(),r=n.weekStartsOn??((l=(a=n.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,o=Le(e),s=o.getDay(),i=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const cA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},uA=(e,t,n)=>{let r;const o=cA[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Pu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const dA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pA={date:Pu({formats:dA,defaultWidth:"full"}),time:Pu({formats:fA,defaultWidth:"full"}),dateTime:Pu({formats:hA,defaultWidth:"full"})},mA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gA=(e,t,n,r)=>mA[e];function Qs(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const yA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},vA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},wA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},SA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TA={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Qs({values:yA,defaultWidth:"wide"}),quarter:Qs({values:vA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Qs({values:bA,defaultWidth:"wide"}),day:Qs({values:wA,defaultWidth:"wide"}),dayPeriod:Qs({values:xA,defaultWidth:"wide",formattingValues:SA,defaultFormattingWidth:"wide"})};function Js(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?CA(a,d=>d.test(i)):EA(a,d=>d.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(i.length);return{value:c,rest:u}}}function EA(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function CA(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function PA(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const kA=/^(\d+)(th|st|nd|rd)?/i,IA=/\d+/i,AA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},OA={any:[/^b/i,/^(a|c)/i]},_A={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},DA={any:[/1/i,/2/i,/3/i,/4/i]},MA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},NA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},LA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},FA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},VA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$A={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},RA={ordinalNumber:PA({matchPattern:kA,parsePattern:IA,valueCallback:e=>parseInt(e,10)}),era:Js({matchPatterns:AA,defaultMatchWidth:"wide",parsePatterns:OA,defaultParseWidth:"any"}),quarter:Js({matchPatterns:_A,defaultMatchWidth:"wide",parsePatterns:DA,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Js({matchPatterns:MA,defaultMatchWidth:"wide",parsePatterns:NA,defaultParseWidth:"any"}),day:Js({matchPatterns:LA,defaultMatchWidth:"wide",parsePatterns:FA,defaultParseWidth:"any"}),dayPeriod:Js({matchPatterns:VA,defaultMatchWidth:"any",parsePatterns:$A,defaultParseWidth:"any"})},Fy={code:"en-US",formatDistance:uA,formatLong:pA,formatRelative:gA,localize:TA,match:RA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function BA(e){const t=Le(e);return nA(t,aA(t))+1}function Vy(e){const t=Le(e),n=+Do(t)-+rA(t);return Math.round(n/Ay)+1}function ku(e,t){var u,d,f,h;const n=Le(e),r=n.getFullYear(),o=Dr(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=Qe(e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=xn(i,t),l=Qe(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=xn(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function jA(e,t){var a,l,c,u;const n=Dr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=ku(e,t),s=Qe(e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),xn(s,t)}function $y(e,t){const n=Le(e),r=+xn(n,t)-+jA(n,t);return Math.round(r/Ay)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const or={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return We(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):We(n+1,2)},d(e,t){return We(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return We(o,t.length)}},No={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ry={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return or.y(e,t)},Y:function(e,t,n,r){const o=ku(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return We(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):We(s,t.length)},R:function(e,t){const n=Oy(e);return We(n,t.length)},u:function(e,t){const n=e.getFullYear();return We(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return We(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return We(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return or.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return We(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=$y(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):We(o,t.length)},I:function(e,t,n){const r=Vy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):We(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):or.d(e,t)},D:function(e,t,n){const r=BA(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):We(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return We(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return We(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return We(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=No.noon:r===0?o=No.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=No.evening:r>=12?o=No.afternoon:r>=4?o=No.morning:o=No.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return or.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):or.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):or.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):or.s(e,t)},S:function(e,t){return or.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return jy(r);case"XXXX":case"XX":return Mr(r);case"XXXXX":case"XXX":default:return Mr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return jy(r);case"xxxx":case"xx":return Mr(r);case"xxxxx":case"xxx":default:return Mr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+By(r,":");case"OOOO":default:return"GMT"+Mr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+By(r,":");case"zzzz":default:return"GMT"+Mr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return We(r,t.length)},T:function(e,t,n){const r=e.getTime();return We(r,t.length)}};function By(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+We(s,2)}function jy(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):Mr(e,t)}function Mr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=We(Math.trunc(r/60),2),s=We(r%60,2);return n+o+t+s}const Wy=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},zy=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Iu={p:zy,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Wy(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Wy(r,t)).replace("{{time}}",zy(o,t))}},WA=/^D+$/,zA=/^Y+$/,HA=["D","DD","YY","YYYY"];function Hy(e){return WA.test(e)}function Uy(e){return zA.test(e)}function Au(e,t,n){const r=UA(e,t,n);if(console.warn(r),HA.includes(e))throw new RangeError(r)}function UA(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qA=/^'([^]*?)'?$/,KA=/''/g,ZA=/[a-zA-Z]/;function XA(e,t,n){var u,d,f,h;const r=Dr(),o=r.locale??Fy,s=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=Le(e);if(!My(a))throw new RangeError("Invalid time value");let l=t.match(YA).map(m=>{const p=m[0];if(p==="p"||p==="P"){const y=Iu[p];return y(m,o.formatLong)}return m}).join("").match(GA).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:QA(m)};if(Ry[p])return{isToken:!0,value:m};if(p.match(ZA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(m=>{if(!m.isToken)return m.value;const p=m.value;(Uy(p)||Hy(p))&&Au(p,t,String(e));const y=Ry[p[0]];return y(a,p,o.localize,c)}).join("")}function QA(e){const t=e.match(qA);return t?t[1].replace(KA,"'"):e}function JA(){return Object.assign({},Dr())}function eO(e){let n=Le(e).getDay();return n===0&&(n=7),n}function tO(e,t){const n=Le(e),r=Le(t);return n.getTime()>r.getTime()}function nO(e,t){const n=Le(e),r=Le(t);return+n<+r}function rO(e,t){const n=t instanceof Date?Qe(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const oO=10;class Gy{constructor(){ce(this,"subPriority",0)}validate(t,n){return!0}}class sO extends Gy{constructor(t,n,r,o,s){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class iO extends Gy{constructor(){super(...arguments);ce(this,"priority",oO);ce(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:Qe(n,rO(n,Date))}}class Fe{run(t,n,r,o){const s=this.parse(t,n,r,o);return s?{setter:new sO(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,r){return!0}}class aO extends Fe{constructor(){super(...arguments);ce(this,"priority",140);ce(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const ht={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Sn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function pt(e,t){return e&&{value:t(e.value),rest:e.rest}}function rt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Tn(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:r*(o*JI+s*QI+i*eA),rest:t.slice(n[0].length)}}function Yy(e){return rt(ht.anyDigitsSigned,e)}function lt(e,t){switch(e){case 1:return rt(ht.singleDigit,t);case 2:return rt(ht.twoDigits,t);case 3:return rt(ht.threeDigits,t);case 4:return rt(ht.fourDigits,t);default:return rt(new RegExp("^\\d{1,"+e+"}"),t)}}function va(e,t){switch(e){case 1:return rt(ht.singleDigitSigned,t);case 2:return rt(ht.twoDigitsSigned,t);case 3:return rt(ht.threeDigitsSigned,t);case 4:return rt(ht.fourDigitsSigned,t);default:return rt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Ou(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qy(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const s=r+50,i=Math.trunc(s/100)*100,a=e>=s%100;o=e+i-(a?100:0)}return n?o:1-o}function Ky(e){return e%400===0||e%4===0&&e%100!==0}class lO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="yy"});switch(r){case"y":return pt(lt(4,n),s);case"yo":return pt(o.ordinalNumber(n,{unit:"year"}),s);default:return pt(lt(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const s=n.getFullYear();if(o.isTwoDigitYear){const a=qy(o.year,s);return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}const i=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}class cO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="YY"});switch(r){case"Y":return pt(lt(4,n),s);case"Yo":return pt(o.ordinalNumber(n,{unit:"year"}),s);default:return pt(lt(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,s){const i=ku(n,s);if(o.isTwoDigitYear){const l=qy(o.year,i);return n.setFullYear(l,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),xn(n,s)}const a=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(a,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),xn(n,s)}}class uO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return va(r==="R"?4:r.length,n)}set(n,r,o){const s=Qe(n,0);return s.setFullYear(o,0,4),s.setHours(0,0,0,0),Do(s)}}class dO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return va(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class fO extends Fe{constructor(){super(...arguments);ce(this,"priority",120);ce(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return lt(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class hO extends Fe{constructor(){super(...arguments);ce(this,"priority",120);ce(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return lt(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class pO extends Fe{constructor(){super(...arguments);ce(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ce(this,"priority",110)}parse(n,r,o){const s=i=>i-1;switch(r){case"M":return pt(rt(ht.month,n),s);case"MM":return pt(lt(2,n),s);case"Mo":return pt(o.ordinalNumber(n,{unit:"month"}),s);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class mO extends Fe{constructor(){super(...arguments);ce(this,"priority",110);ce(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const s=i=>i-1;switch(r){case"L":return pt(rt(ht.month,n),s);case"LL":return pt(lt(2,n),s);case"Lo":return pt(o.ordinalNumber(n,{unit:"month"}),s);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function gO(e,t,n){const r=Le(e),o=$y(r,n)-t;return r.setDate(r.getDate()-o*7),r}class yO extends Fe{constructor(){super(...arguments);ce(this,"priority",100);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return rt(ht.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,s){return xn(gO(n,o,s),s)}}function vO(e,t){const n=Le(e),r=Vy(n)-t;return n.setDate(n.getDate()-r*7),n}class bO extends Fe{constructor(){super(...arguments);ce(this,"priority",100);ce(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return rt(ht.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return Do(vO(n,o))}}const wO=[31,28,31,30,31,30,31,31,30,31,30,31],xO=[31,29,31,30,31,30,31,31,30,31,30,31];class SO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"subPriority",1);ce(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return rt(ht.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return lt(r.length,n)}}validate(n,r){const o=n.getFullYear(),s=Ky(o),i=n.getMonth();return s?r>=1&&r<=xO[i]:r>=1&&r<=wO[i]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class TO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"subpriority",1);ce(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return rt(ht.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return lt(r.length,n)}}validate(n,r){const o=n.getFullYear();return Ky(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function _u(e,t,n){var d,f,h,m;const r=Dr(),o=(n==null?void 0:n.weekStartsOn)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,s=Le(e),i=s.getDay(),l=(t%7+7)%7,c=7-o,u=t<0||t>6?t-(i+c)%7:(l+c)%7-(i+c)%7;return _o(s,u)}class EO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=_u(n,o,s),n.setHours(0,0,0,0),n}}class CO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,s){const i=a=>{const l=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+l};switch(r){case"e":case"ee":return pt(lt(r.length,n),i);case"eo":return pt(o.ordinalNumber(n,{unit:"day"}),i);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=_u(n,o,s),n.setHours(0,0,0,0),n}}class PO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,s){const i=a=>{const l=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+l};switch(r){case"c":case"cc":return pt(lt(r.length,n),i);case"co":return pt(o.ordinalNumber(n,{unit:"day"}),i);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=_u(n,o,s),n.setHours(0,0,0,0),n}}function kO(e,t){const n=Le(e),r=eO(n),o=t-r;return _o(n,o)}class IO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const s=i=>i===0?7:i;switch(r){case"i":case"ii":return lt(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return pt(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return pt(o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return pt(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return pt(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=kO(n,o),n.setHours(0,0,0,0),n}}class AO extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ou(o),0,0,0),n}}class OO extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ou(o),0,0,0),n}}class _O extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ou(o),0,0,0),n}}class DO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return rt(ht.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const s=n.getHours()>=12;return s&&o<12?n.setHours(o+12,0,0,0):!s&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class MO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return rt(ht.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class NO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return rt(ht.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class LO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return rt(ht.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const s=o<=24?o%24:o;return n.setHours(s,0,0,0),n}}class FO extends Fe{constructor(){super(...arguments);ce(this,"priority",60);ce(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return rt(ht.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class VO extends Fe{constructor(){super(...arguments);ce(this,"priority",50);ce(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return rt(ht.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class $O extends Fe{constructor(){super(...arguments);ce(this,"priority",30);ce(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=s=>Math.trunc(s*Math.pow(10,-r.length+3));return pt(lt(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class RO extends Fe{constructor(){super(...arguments);ce(this,"priority",10);ce(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Tn(Sn.basicOptionalMinutes,n);case"XX":return Tn(Sn.basic,n);case"XXXX":return Tn(Sn.basicOptionalSeconds,n);case"XXXXX":return Tn(Sn.extendedOptionalSeconds,n);case"XXX":default:return Tn(Sn.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Qe(n,n.getTime()-ya(n)-o)}}class BO extends Fe{constructor(){super(...arguments);ce(this,"priority",10);ce(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Tn(Sn.basicOptionalMinutes,n);case"xx":return Tn(Sn.basic,n);case"xxxx":return Tn(Sn.basicOptionalSeconds,n);case"xxxxx":return Tn(Sn.extendedOptionalSeconds,n);case"xxx":default:return Tn(Sn.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Qe(n,n.getTime()-ya(n)-o)}}class jO extends Fe{constructor(){super(...arguments);ce(this,"priority",40);ce(this,"incompatibleTokens","*")}parse(n){return Yy(n)}set(n,r,o){return[Qe(n,o*1e3),{timestampIsSet:!0}]}}class WO extends Fe{constructor(){super(...arguments);ce(this,"priority",20);ce(this,"incompatibleTokens","*")}parse(n){return Yy(n)}set(n,r,o){return[Qe(n,o),{timestampIsSet:!0}]}}const zO={G:new aO,y:new lO,Y:new cO,R:new uO,u:new dO,Q:new fO,q:new hO,M:new pO,L:new mO,w:new yO,I:new bO,d:new SO,D:new TO,E:new EO,e:new CO,c:new PO,i:new IO,a:new AO,b:new OO,B:new _O,h:new DO,H:new MO,K:new NO,k:new LO,m:new FO,s:new VO,S:new $O,X:new RO,x:new BO,t:new jO,T:new WO},HO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,UO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,GO=/^'([^]*?)'?$/,YO=/''/g,qO=/\S/,KO=/[a-zA-Z]/;function ZO(e,t,n,r){var p,y,b,v;const o=JA(),s=o.locale??Fy,i=o.firstWeekContainsDate??((y=(p=o.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??1,a=o.weekStartsOn??((v=(b=o.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??0;if(t==="")return e===""?Le(n):Qe(n,NaN);const l={firstWeekContainsDate:i,weekStartsOn:a,locale:s},c=[new iO],u=t.match(UO).map(g=>{const T=g[0];if(T in Iu){const S=Iu[T];return S(g,s.formatLong)}return g}).join("").match(HO),d=[];for(let g of u){Uy(g)&&Au(g,t,e),Hy(g)&&Au(g,t,e);const T=g[0],S=zO[T];if(S){const{incompatibleTokens:E}=S;if(Array.isArray(E)){const I=d.find(A=>E.includes(A.token)||A.token===T);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${g}\` at the same time`)}else if(S.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);d.push({token:T,fullToken:g});const C=S.run(e,g,s.match,l);if(!C)return Qe(n,NaN);c.push(C.setter),e=C.rest}else{if(T.match(KO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");if(g==="''"?g="'":T==="'"&&(g=XO(g)),e.indexOf(g)===0)e=e.slice(g.length);else return Qe(n,NaN)}}if(e.length>0&&qO.test(e))return Qe(n,NaN);const f=c.map(g=>g.priority).sort((g,T)=>T-g).filter((g,T,S)=>S.indexOf(g)===T).map(g=>c.filter(T=>T.priority===g).sort((T,S)=>S.subPriority-T.subPriority)).map(g=>g[0]);let h=Le(n);if(isNaN(h.getTime()))return Qe(n,NaN);const m={};for(const g of f){if(!g.validate(h,l))return Qe(n,NaN);const T=g.set(h,m,l);Array.isArray(T)?(h=T[0],Object.assign(m,T[1])):h=T}return Qe(n,h)}function XO(e){return e.match(GO)[1].replace(YO,"'")}function QO(e,t){const n=Le(e),r=Le(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function JO(e){return sA(e,oA(e))}function e_(e,t){return _o(e,-t)}function Zy(e,t){return ga(e,-t)}function t_(e,t){return _y(e,-t)}function n_(e,t){return Dy(e,-t)}var mt=function(){return mt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},mt.apply(this,arguments)};function Du(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Mu(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var ei=function(e){return e.replace(new RegExp(" ","g")," ")},Xy=function(e,t){var n=e.length,r=t+1;if(n>=r)return e;var o="0".repeat(r-n);return"".concat(o).concat(e)},r_=function(e){return e.replace(/^0+([0-9]+)/,"$1")},Qy=function(e,t,n){var r=e.length-2,o=r_(e.substring(0,r)),s=e.substring(r);return o.split(/(?=(?:\d{3})*$)/).join(t)+n+s},Jy=function(e){return e===void 0&&(e=""),e.replace(/(-(?!\d))|[^0-9|-]/g,"")||""},ba=function(e){return Number.parseFloat(e.replace(/,/g,".").replace(/(.*)\./,function(t){return"".concat(t.replace(/\./g,""),".")}).replace(/[^0-9.]/g,""))},o_=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Nu=function(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e},[e]),t},s_=function(e){return e==="money"||e==="currency"},i_=function(e,t,n){return new Intl.NumberFormat(e,{style:"currency",currency:t,currencyDisplay:n}).formatToParts(1e3).reduce(function(r,o){var s;return mt(mt({},r),(s={},s[o.type]=o.value,s))},{currency:"",currencyDisplay:"",decimal:",",fraction:"",group:"",integer:"",literal:""})},wa=function(e,t){var n=Xy(Jy(e),t.fraction.length),r="".concat(t.currency).concat(Qy(n,t.group,t.decimal));return ei(r)},a_=w.forwardRef(function(e,t){var n=e.locale,r=n===void 0?"pt-BR":n,o=e.currency,s=o===void 0?"BRL":o,i=e.currencyDisplay,a=i===void 0?"symbol":i;e.mask;var l=e.onChange,c=Du(e,["locale","currency","currencyDisplay","mask","onChange"]),u=w.useRef(null);w.useImperativeHandle(t,function(){return u.current});var d=w.useMemo(function(){var m=i_(r,s,a);return m.currency=ei("".concat(m.currency.trim()," ")),m.literal=ei(m.literal.trim()),m},[r,s]),f=function(m){var p=wa(m.target.value,d),y=ba(p);m.target.value=p,m.target.setAttribute("data-number",y.toString()),l==null||l(m),y!==0&&(u.current.selectionEnd=p.length)};w.useEffect(function(){if(u.current!==null){var m=u.current.value;if(m!==""){var p=wa(m,d),y=ba(p);u.current.value=p,u.current.setAttribute("data-number",y.toString());var b=new InputEvent("change",{});l==null||l(mt(mt({},b),{target:u.current,currentTarget:u.current})),y!==0&&(u.current.selectionEnd=p.length)}}},[d]);var h=c.defaultValue?wa(c.defaultValue,d):void 0;return w.createElement("input",mt({},c,{value:typeof c.value=="string"?wa(c.value,d):c.value,defaultValue:h,type:"text",ref:u,onChange:f,inputMode:"decimal"}))}),l_=1,c_=function(e){return e==="percentage"||e==="percent"||e==="percentual"},u_=function(e){return new Intl.NumberFormat(e,{style:"percent",minimumFractionDigits:2}).formatToParts(1e3).reduce(function(t,n){var r;return mt(mt({},t),(r={},r[n.type]=n.value,r))},{decimal:"",fraction:"",group:"",integer:"",percentSign:"",type:"",value:""})},xa=function(e,t){var n=Xy(Jy(e),t.fraction.length),r="".concat(Qy(n,t.group,t.decimal)," ").concat(t.percentSign);return ei(r)},d_=w.forwardRef(function(e,t){var n=e.locale,r=n===void 0?"pt-BR":n;e.mask;var o=e.onChange,s=e.onKeyUp,i=Du(e,["locale","mask","onChange","onKeyUp"]),a=w.useRef(null),l=Mu(w.useState(function(){var b,v;return(v=(b=i.value)===null||b===void 0?void 0:b.toString())!==null&&v!==void 0?v:""}),2),c=l[0],u=l[1];w.useImperativeHandle(t,function(){return a.current}),w.useEffect(function(){var b,v=Number.parseFloat("".concat((b=i.value)!==null&&b!==void 0?b:"0")).toFixed(d.fraction.length);u(xa(v,d))},[i.value]);var d=w.useMemo(function(){var b=u_(r);return b.percentSign=ei("".concat(b.percentSign)),b},[r]),f=c.length-d.percentSign.length-l_,h=function(b){var v,g=a.current;g&&(g.setSelectionRange(f,f),b&&((v=i.onFocus)===null||v===void 0||v.call(i,b)))},m=function(b){var v=b.currentTarget;if(v.selectionStart!==null){var g=v.selectionStart,T=v.selectionEnd,S=g!==T,E=f<g;!S&&E&&h()}s==null||s(b)},p=function(b){var v=xa(b.target.value,d),g=ba(v);u(v),b.target.value=v,b.target.setAttribute("data-number",g.toString()),o==null||o(b)};w.useEffect(function(){if(a.current!==null){var b=a.current.value;if(b!==""){var v=xa(b,d),g=ba(v);u(v),a.current.value=v,a.current.setAttribute("data-number",g.toString());var T=new InputEvent("change",{});o==null||o(mt(mt({},T),{target:a.current,currentTarget:a.current}))}}},[]),w.useEffect(function(){return h()},[c]);var y=i.defaultValue?xa(i.defaultValue,d):void 0;return w.createElement("input",mt({},i,{defaultValue:y,inputMode:"decimal",onChange:p,onFocus:h,onKeyUp:m,ref:a,type:"text"}))}),ti={dots:/\./g,openParenthesis:/\(/g,closeParenthesis:/\)/g,leadingBars:/\\\\/g,escape:/[.*+?^${}()|[\]\\]/g},f_=function(e){for(var t,n=e.length,r=[],o=0;o<n;o++){var s=e[o],i=Sa[s];i===void 0?r.push(s.replace(ti.dots,"\\.").replace(ti.openParenthesis,"\\(").replace(ti.closeParenthesis,"\\)")):r.push((t=i.regex)===null||t===void 0?void 0:t.source)}return r.join("").replace(ti.leadingBars,"\\")},ni=function(e,t,n){var r=typeof e=="function",o=r?"":e;if(r&&(o=e(t)),Array.isArray(o))return Lu(o,n);var s=f_(o);return n?"^".concat(s,"$"):s},h_=function(e){return e.replace(ti.escape,"\\$&")},Lu=function(e,t){var n=e.map(function(r){return typeof r=="string"?h_(r):r.source}).join("");return new RegExp(t?"^".concat(n,"$"):n).source},Sa={A:{regex:/[a-zA-Z]/,parse:function(e){return e.toLocaleUpperCase()}},H:{regex:/[a-fA-F0-9]/},X:{regex:/[0-9a-zA-Z]/},a:{regex:/[a-zA-Z]/,parse:function(e){return e.toLocaleLowerCase()}},d:{regex:/\d/,escape:!0},x:{regex:/[a-zA-Z]/}},p_=/\d/,ev="(dd) 9dddd-dddd",tv="(dd) dddd-dddd",nv="ddd.ddd.ddd-dd",rv="dd.ddd.ddd/dddd-dd",Ta=function(e){return e.replace(/\D/g,"")},m_=["2",/[0-3]/,":",/[0-5]/,/\d/],g_=[/[012]/,/\d/,":",/[0-5]/,/[0-9]/],Ht={cep:"ddddd-ddd",date:"dd/dd/dddd",cpf:nv,isoDate:"dddd-dd-dd",cnpj:rv,telephone:tv,cellphone:ev,creditCard:"dddd dddd dddd dddd",uuid:"HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH",color:function(e){return e.length>4?"#HHHHHH":"#HHH"},cpfCnpj:function(e){return Ta(e).length<=11?nv:rv},int:function(e){return e===void 0&&(e=""),p_.test(e.toString().slice(-1))?"d".repeat(Math.max(e.length,0)):"d".repeat(Math.max(e.length-1,0))},cellTelephone:function(e){var t=Ta(e);return t.length<11?tv:ev},time:function(e){var t=Ta(e),n=t[0];return n==="2"?m_:g_}},Ut=function(e,t,n){var r;return n===void 0&&(n={}),mt({mask:e,inputMode:t,strict:!0,pattern:((r=n.pattern)!==null&&r!==void 0?r:typeof e=="function")?void 0:ni(e,"",!0),infinity:n.infinity},n)},Mt={cellTelephone:Ut(Ht.cellTelephone,"tel"),cellphone:Ut(Ht.cellphone,"tel"),cep:Ut(Ht.cep,"decimal"),cnpj:Ut(Ht.cnpj,"decimal"),color:Ut(Ht.color,"decimal",{pattern:"#[a-fA-F0-9]{3}([a-fA-F0-9]{3})?"}),cpf:Ut(Ht.cpf,"decimal"),cpfCnpj:Ut(Ht.cpfCnpj,"decimal",{transform:Ta}),creditCard:Ut(Ht.creditCard,"decimal",{pattern:"[0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3,4}"}),date:Ut(Ht.date,"decimal"),int:Ut(Ht.int,"decimal",{pattern:"[0-9]+"}),isoDate:Ut(Ht.isoDate,"decimal"),telephone:Ut(Ht.telephone,"tel"),time:Ut(Ht.time,"decimal",{pattern:"[0-9]{2}:[0-9]{2}"}),uuid:Ut(Ht.uuid,"decimal",{pattern:"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"})};function ov(e,t,n,r){var o,s;r===void 0&&(r=Sa);for(var i=n(e),a="",l=0,c=0;l<t.length&&c<i.length;){var u=t[l],d=u instanceof RegExp?u:r[u],f=i[c];if(d===void 0){a+=u,f===u&&(c+=1),l+=1;continue}var h=d instanceof RegExp?{regex:d}:d;h.regex.test(f)&&(a+=(s=(o=h.parse)===null||o===void 0?void 0:o.call(h,f))!==null&&s!==void 0?s:f),c+=1,l+=1}return a}var sv=function(e){return e},y_=function(e,t,n){if(!e||!n)return!1;var r=new RegExp(ni(e,n,t));return r.test(n)};function v_(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e},[e]),t.current}var b_=w.forwardRef(function(e,t){var n=e.infinity,r=n===void 0?!1:n,o=e.strict,s=o===void 0?!0:o,i=e.transform,a=e.onChange,l=e.pattern,c=e.tokens,u=e.mask,d=e.onChangeText,f=e.as,h=Du(e,["infinity","strict","transform","onChange","pattern","tokens","mask","onChangeText","as"]),m=w.useRef(null);w.useImperativeHandle(t,function(){return m.current});var p=Nu(a),y=Nu(d),b=Nu(u),v=w.useRef(y_(u,s,h.value||h.defaultValue)),g=f??"input",T=Mu(w.useState(""),2),S=T[0],E=T[1],C=v_(S),I=w.useCallback(function(M,L){var N,R,z=(N=M??L)!==null&&N!==void 0?N:"";if(u===void 0)return z;var D=(R=z==null?void 0:z.toString())!==null&&R!==void 0?R:"";return ov(D,typeof u=="function"?u(D):u,i??sv,c??Sa)},[i,u,c]),A=Mu(w.useState(function(){return I(h.value,h.defaultValue)}),2),O=A[0],F=A[1],_=I(h.defaultValue,h.defaultValue),V=w.useMemo(function(){if(l||u===void 0)return l;if(typeof u=="function"){var M=u(O);return Array.isArray(M)?Lu(M,s):ni(u,O,s)}return typeof u=="string"?ni(u,O,s):Lu(u,s)},[l,O,s,u]);w.useEffect(function(){if(h.value!==void 0){var M=I(h.value,h.defaultValue);F(M),m.current!==null&&(m.current.value=M)}},[h.value,u,i,h.defaultValue]);var k=function(M){var L,N,R,z,D,B=M.currentTarget,Z=M.target.value;if(b.current===void 0)return F(Z),(L=y.current)===null||L===void 0||L.call(y,Z),(N=p.current)===null||N===void 0||N.call(p,M),d==null?void 0:d(Z);var oe=new RegExp(ni(b.current,Z,s)),te=(R=B.selectionEnd)!==null&&R!==void 0?R:0,G=function(Q,fe,U){if(Q.type!=="number")return Q.setSelectionRange(fe,U)};if(r&&v.current&&Z.length>=O.length)return B.value=O,G(B,te-1,te-1);var $=!1;Z.length<C.length&&(v.current=!1,$=!0),oe.test(Z)&&(v.current=!0);var j=te,H=Z[j-1],Y=ov(Z,typeof b.current=="function"?b.current(Z):b.current,i??sv,c??Sa);for(B.value=Y,F(Y);j<Y.length&&Y.charAt(j-1)!==H;)j+=1;$?G(B,te,te):G(B,j,j),M.target.value=Y,E(Y),(z=y.current)===null||z===void 0||z.call(y,Y),(D=p.current)===null||D===void 0||D.call(p,M)};return w.createElement(g,mt({},h,{ref:m,pattern:V,onChange:k,defaultValue:iv(h.defaultValue)?_:void 0,value:iv(h.value)?I(h.value,h.value):h.value}))}),iv=function(e){return typeof e=="string"},av=w.forwardRef(function(e,t){return s_(e.mask)?w.createElement(a_,mt({},e,{mask:void 0,ref:t})):c_(e.mask)?w.createElement(d_,mt({},e,{mask:void 0,ref:t})):w.createElement(b_,mt({},e,{ref:t}))}),Gt=function(e){return function(t){return w.createElement(av,mt({},e,t))}};Gt(Mt.cellTelephone),Gt(Mt.cellphone),Gt(Mt.cep),Gt(Mt.cnpj),Gt(Mt.color),Gt(Mt.cpf),Gt(Mt.cpfCnpj),Gt(Mt.creditCard),Gt(Mt.date),Gt(Mt.int),Gt(Mt.isoDate),Gt(Mt.telephone),Gt(Mt.time),Gt(Mt.uuid);var lv=w.forwardRef(function(t,n){var r=w.useMemo(function(){if(t.mask)return typeof t.mask=="string"&&o_(Mt,t.mask)?Mt[t.mask]:{mask:t.mask}},[t.mask]),o=mt(mt({},t),r);return w.createElement(av,mt({},o,{ref:n}))}),Fu={},Vu={exports:{}},$u={};/**
137
+ */const ku=ft("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ky={true:{opacity:1,height:"auto"},false:{opacity:[.7,.3,0],height:0}},ZI={type:"tween",duration:.7,ease:[.04,.62,.23,.98]},Iy=e=>x.jsx(at.div,{...e,layout:!0,layoutRoot:!0,layoutScroll:!0,initial:!1,variants:ky,exit:ky.false,transition:ZI,"aria-hidden":!e.open,"data-component":"collapse",animate:e.open.toString(),className:Me("aria-hidden:pointer-events-none",e.className),children:e.children}),XI=po("p-4 w-full block border relative rounded-lg text-sm",{variants:{theme:{primary:"bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",danger:"bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",info:"bg-alert-info-bg text-alert-info-text border-alert-info-border",success:"bg-alert-success-bg text-alert-success-text border-alert-success-border",secondary:"bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",warn:"bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",neutral:"bg-transparent border border-card-border text-alert-primary-text"}},defaultVariants:{theme:"neutral"}}),QI=w.forwardRef(function({className:t,theme:n,Icon:r,onClose:o,open:s=!0,...i},a){const l=()=>o==null?void 0:o(!1);return x.jsx("div",{"data-open":!!s,"aria-hidden":!s,"data-component":"alert",className:Me("isolate w-full",s?"pointer-events-auto":"pointer-events-none"),children:x.jsx(Iy,{"data-open":!!s,open:!!s,children:x.jsxs(mo,{...i,ref:a,role:"alert","data-theme":n,as:i.as??"div",className:Me(XI({theme:n}),t),children:[x.jsxs("h4",{className:"mb-2 flex items-center gap-2",children:[!r&&n==="success"?x.jsx(Ey,{size:20}):null,!r&&n==="info"?x.jsx(Py,{size:20}):null,!r&&n==="danger"?x.jsx(YI,{size:20}):null,r,x.jsx("span",{className:"tracking-3 text-balance text-lg font-semibold",children:i.title})]}),i.children,o!==void 0?x.jsx("button",{type:"button",onClick:l,className:"absolute right-3 top-3 text-foreground transition-colors duration-300 ease-in-out hover:text-danger",children:x.jsx(ku,{size:20})}):null]})})})});function Le(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Qe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function _o(e,t){const n=Le(e);return isNaN(t)?Qe(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ya(e,t){const n=Le(e);if(isNaN(t))return Qe(e,NaN);if(!t)return n;const r=n.getDate(),o=Qe(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const s=o.getDate();return r>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Ay=6048e5,JI=864e5,eA=6e4,tA=36e5,nA=1e3;let rA={};function Dr(){return rA}function xn(e,t){var a,l,c,u;const n=Dr(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Le(e),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Do(e){return xn(e,{weekStartsOn:1})}function Oy(e){const t=Le(e),n=t.getFullYear(),r=Qe(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Do(r),s=Qe(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const i=Do(s);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Mo(e){const t=Le(e);return t.setHours(0,0,0,0),t}function va(e){const t=Le(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function oA(e,t){const n=Mo(e),r=Mo(t),o=+n-va(n),s=+r-va(r);return Math.round((o-s)/JI)}function sA(e){const t=Oy(e),n=Qe(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Do(n)}function _y(e,t){const n=t*7;return _o(e,n)}function Dy(e,t){return ya(e,t*12)}function iA(e){return Qe(e,Date.now())}function aA(e,t){const n=Mo(e),r=Mo(t);return+n==+r}function lA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function My(e){if(!lA(e)&&typeof e!="number")return!1;const t=Le(e);return!isNaN(Number(t))}function Ny(e,t){const n=Le(e.start),r=Le(e.end);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0);let a=1;const l=[];for(;+i<=s;)l.push(Le(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return o?l.reverse():l}function Ly(e){const t=Le(e);return t.setDate(1),t.setHours(0,0,0,0),t}function cA(e){const t=Le(e),n=Qe(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uA(e,t){var a,l;const n=Dr(),r=n.weekStartsOn??((l=(a=n.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,o=Le(e),s=o.getDay(),i=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const dA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fA=(e,t,n)=>{let r;const o=dA[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Iu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const hA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gA={date:Iu({formats:hA,defaultWidth:"full"}),time:Iu({formats:pA,defaultWidth:"full"}),dateTime:Iu({formats:mA,defaultWidth:"full"})},yA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vA=(e,t,n,r)=>yA[e];function Js(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const bA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},SA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},TA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},EA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},CA={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Js({values:bA,defaultWidth:"wide"}),quarter:Js({values:wA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Js({values:xA,defaultWidth:"wide"}),day:Js({values:SA,defaultWidth:"wide"}),dayPeriod:Js({values:TA,defaultWidth:"wide",formattingValues:EA,defaultFormattingWidth:"wide"})};function ei(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?kA(a,d=>d.test(i)):PA(a,d=>d.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(i.length);return{value:c,rest:u}}}function PA(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function kA(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function IA(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const AA=/^(\d+)(th|st|nd|rd)?/i,OA=/\d+/i,_A={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},DA={any:[/^b/i,/^(a|c)/i]},MA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NA={any:[/1/i,/2/i,/3/i,/4/i]},LA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},FA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},VA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$A={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},RA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},BA={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jA={ordinalNumber:IA({matchPattern:AA,parsePattern:OA,valueCallback:e=>parseInt(e,10)}),era:ei({matchPatterns:_A,defaultMatchWidth:"wide",parsePatterns:DA,defaultParseWidth:"any"}),quarter:ei({matchPatterns:MA,defaultMatchWidth:"wide",parsePatterns:NA,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ei({matchPatterns:LA,defaultMatchWidth:"wide",parsePatterns:FA,defaultParseWidth:"any"}),day:ei({matchPatterns:VA,defaultMatchWidth:"wide",parsePatterns:$A,defaultParseWidth:"any"}),dayPeriod:ei({matchPatterns:RA,defaultMatchWidth:"any",parsePatterns:BA,defaultParseWidth:"any"})},Fy={code:"en-US",formatDistance:fA,formatLong:gA,formatRelative:vA,localize:CA,match:jA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WA(e){const t=Le(e);return oA(t,cA(t))+1}function Vy(e){const t=Le(e),n=+Do(t)-+sA(t);return Math.round(n/Ay)+1}function Au(e,t){var u,d,f,h;const n=Le(e),r=n.getFullYear(),o=Dr(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=Qe(e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=xn(i,t),l=Qe(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=xn(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function zA(e,t){var a,l,c,u;const n=Dr(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=Au(e,t),s=Qe(e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),xn(s,t)}function $y(e,t){const n=Le(e),r=+xn(n,t)-+zA(n,t);return Math.round(r/Ay)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const or={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return We(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):We(n+1,2)},d(e,t){return We(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return We(o,t.length)}},No={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ry={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return or.y(e,t)},Y:function(e,t,n,r){const o=Au(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return We(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):We(s,t.length)},R:function(e,t){const n=Oy(e);return We(n,t.length)},u:function(e,t){const n=e.getFullYear();return We(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return We(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return We(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return or.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return We(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=$y(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):We(o,t.length)},I:function(e,t,n){const r=Vy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):We(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):or.d(e,t)},D:function(e,t,n){const r=WA(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):We(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return We(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return We(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return We(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=No.noon:r===0?o=No.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=No.evening:r>=12?o=No.afternoon:r>=4?o=No.morning:o=No.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return or.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):or.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):or.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):or.s(e,t)},S:function(e,t){return or.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return jy(r);case"XXXX":case"XX":return Mr(r);case"XXXXX":case"XXX":default:return Mr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return jy(r);case"xxxx":case"xx":return Mr(r);case"xxxxx":case"xxx":default:return Mr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+By(r,":");case"OOOO":default:return"GMT"+Mr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+By(r,":");case"zzzz":default:return"GMT"+Mr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return We(r,t.length)},T:function(e,t,n){const r=e.getTime();return We(r,t.length)}};function By(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+We(s,2)}function jy(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):Mr(e,t)}function Mr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=We(Math.trunc(r/60),2),s=We(r%60,2);return n+o+t+s}const Wy=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},zy=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ou={p:zy,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Wy(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Wy(r,t)).replace("{{time}}",zy(o,t))}},HA=/^D+$/,UA=/^Y+$/,GA=["D","DD","YY","YYYY"];function Hy(e){return HA.test(e)}function Uy(e){return UA.test(e)}function _u(e,t,n){const r=YA(e,t,n);if(console.warn(r),GA.includes(e))throw new RangeError(r)}function YA(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZA=/^'([^]*?)'?$/,XA=/''/g,QA=/[a-zA-Z]/;function JA(e,t,n){var u,d,f,h;const r=Dr(),o=r.locale??Fy,s=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=Le(e);if(!My(a))throw new RangeError("Invalid time value");let l=t.match(KA).map(m=>{const p=m[0];if(p==="p"||p==="P"){const v=Ou[p];return v(m,o.formatLong)}return m}).join("").match(qA).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:eO(m)};if(Ry[p])return{isToken:!0,value:m};if(p.match(QA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(m=>{if(!m.isToken)return m.value;const p=m.value;(Uy(p)||Hy(p))&&_u(p,t,String(e));const v=Ry[p[0]];return v(a,p,o.localize,c)}).join("")}function eO(e){const t=e.match(ZA);return t?t[1].replace(XA,"'"):e}function tO(){return Object.assign({},Dr())}function nO(e){let n=Le(e).getDay();return n===0&&(n=7),n}function rO(e,t){const n=Le(e),r=Le(t);return n.getTime()>r.getTime()}function oO(e,t){const n=Le(e),r=Le(t);return+n<+r}function sO(e,t){const n=t instanceof Date?Qe(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const iO=10;class Gy{constructor(){ce(this,"subPriority",0)}validate(t,n){return!0}}class aO extends Gy{constructor(t,n,r,o,s){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class lO extends Gy{constructor(){super(...arguments);ce(this,"priority",iO);ce(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:Qe(n,sO(n,Date))}}class Fe{run(t,n,r,o){const s=this.parse(t,n,r,o);return s?{setter:new aO(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,r){return!0}}class cO extends Fe{constructor(){super(...arguments);ce(this,"priority",140);ce(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const ht={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Sn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function pt(e,t){return e&&{value:t(e.value),rest:e.rest}}function rt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Tn(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:r*(o*tA+s*eA+i*nA),rest:t.slice(n[0].length)}}function Yy(e){return rt(ht.anyDigitsSigned,e)}function lt(e,t){switch(e){case 1:return rt(ht.singleDigit,t);case 2:return rt(ht.twoDigits,t);case 3:return rt(ht.threeDigits,t);case 4:return rt(ht.fourDigits,t);default:return rt(new RegExp("^\\d{1,"+e+"}"),t)}}function ba(e,t){switch(e){case 1:return rt(ht.singleDigitSigned,t);case 2:return rt(ht.twoDigitsSigned,t);case 3:return rt(ht.threeDigitsSigned,t);case 4:return rt(ht.fourDigitsSigned,t);default:return rt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Du(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qy(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const s=r+50,i=Math.trunc(s/100)*100,a=e>=s%100;o=e+i-(a?100:0)}return n?o:1-o}function Ky(e){return e%400===0||e%4===0&&e%100!==0}class uO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="yy"});switch(r){case"y":return pt(lt(4,n),s);case"yo":return pt(o.ordinalNumber(n,{unit:"year"}),s);default:return pt(lt(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const s=n.getFullYear();if(o.isTwoDigitYear){const a=qy(o.year,s);return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}const i=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}class dO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="YY"});switch(r){case"Y":return pt(lt(4,n),s);case"Yo":return pt(o.ordinalNumber(n,{unit:"year"}),s);default:return pt(lt(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,s){const i=Au(n,s);if(o.isTwoDigitYear){const l=qy(o.year,i);return n.setFullYear(l,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),xn(n,s)}const a=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(a,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),xn(n,s)}}class fO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return ba(r==="R"?4:r.length,n)}set(n,r,o){const s=Qe(n,0);return s.setFullYear(o,0,4),s.setHours(0,0,0,0),Do(s)}}class hO extends Fe{constructor(){super(...arguments);ce(this,"priority",130);ce(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return ba(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class pO extends Fe{constructor(){super(...arguments);ce(this,"priority",120);ce(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return lt(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class mO extends Fe{constructor(){super(...arguments);ce(this,"priority",120);ce(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return lt(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class gO extends Fe{constructor(){super(...arguments);ce(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ce(this,"priority",110)}parse(n,r,o){const s=i=>i-1;switch(r){case"M":return pt(rt(ht.month,n),s);case"MM":return pt(lt(2,n),s);case"Mo":return pt(o.ordinalNumber(n,{unit:"month"}),s);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class yO extends Fe{constructor(){super(...arguments);ce(this,"priority",110);ce(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const s=i=>i-1;switch(r){case"L":return pt(rt(ht.month,n),s);case"LL":return pt(lt(2,n),s);case"Lo":return pt(o.ordinalNumber(n,{unit:"month"}),s);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function vO(e,t,n){const r=Le(e),o=$y(r,n)-t;return r.setDate(r.getDate()-o*7),r}class bO extends Fe{constructor(){super(...arguments);ce(this,"priority",100);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return rt(ht.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,s){return xn(vO(n,o,s),s)}}function wO(e,t){const n=Le(e),r=Vy(n)-t;return n.setDate(n.getDate()-r*7),n}class xO extends Fe{constructor(){super(...arguments);ce(this,"priority",100);ce(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return rt(ht.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return Do(wO(n,o))}}const SO=[31,28,31,30,31,30,31,31,30,31,30,31],TO=[31,29,31,30,31,30,31,31,30,31,30,31];class EO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"subPriority",1);ce(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return rt(ht.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return lt(r.length,n)}}validate(n,r){const o=n.getFullYear(),s=Ky(o),i=n.getMonth();return s?r>=1&&r<=TO[i]:r>=1&&r<=SO[i]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class CO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"subpriority",1);ce(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return rt(ht.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return lt(r.length,n)}}validate(n,r){const o=n.getFullYear();return Ky(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function Mu(e,t,n){var d,f,h,m;const r=Dr(),o=(n==null?void 0:n.weekStartsOn)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,s=Le(e),i=s.getDay(),l=(t%7+7)%7,c=7-o,u=t<0||t>6?t-(i+c)%7:(l+c)%7-(i+c)%7;return _o(s,u)}class PO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Mu(n,o,s),n.setHours(0,0,0,0),n}}class kO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,s){const i=a=>{const l=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+l};switch(r){case"e":case"ee":return pt(lt(r.length,n),i);case"eo":return pt(o.ordinalNumber(n,{unit:"day"}),i);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Mu(n,o,s),n.setHours(0,0,0,0),n}}class IO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,s){const i=a=>{const l=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+l};switch(r){case"c":case"cc":return pt(lt(r.length,n),i);case"co":return pt(o.ordinalNumber(n,{unit:"day"}),i);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Mu(n,o,s),n.setHours(0,0,0,0),n}}function AO(e,t){const n=Le(e),r=nO(n),o=t-r;return _o(n,o)}class OO extends Fe{constructor(){super(...arguments);ce(this,"priority",90);ce(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const s=i=>i===0?7:i;switch(r){case"i":case"ii":return lt(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return pt(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return pt(o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return pt(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return pt(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=AO(n,o),n.setHours(0,0,0,0),n}}class _O extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Du(o),0,0,0),n}}class DO extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Du(o),0,0,0),n}}class MO extends Fe{constructor(){super(...arguments);ce(this,"priority",80);ce(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Du(o),0,0,0),n}}class NO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return rt(ht.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const s=n.getHours()>=12;return s&&o<12?n.setHours(o+12,0,0,0):!s&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class LO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return rt(ht.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class FO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return rt(ht.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class VO extends Fe{constructor(){super(...arguments);ce(this,"priority",70);ce(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return rt(ht.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return lt(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const s=o<=24?o%24:o;return n.setHours(s,0,0,0),n}}class $O extends Fe{constructor(){super(...arguments);ce(this,"priority",60);ce(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return rt(ht.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class RO extends Fe{constructor(){super(...arguments);ce(this,"priority",50);ce(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return rt(ht.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return lt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class BO extends Fe{constructor(){super(...arguments);ce(this,"priority",30);ce(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=s=>Math.trunc(s*Math.pow(10,-r.length+3));return pt(lt(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class jO extends Fe{constructor(){super(...arguments);ce(this,"priority",10);ce(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Tn(Sn.basicOptionalMinutes,n);case"XX":return Tn(Sn.basic,n);case"XXXX":return Tn(Sn.basicOptionalSeconds,n);case"XXXXX":return Tn(Sn.extendedOptionalSeconds,n);case"XXX":default:return Tn(Sn.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Qe(n,n.getTime()-va(n)-o)}}class WO extends Fe{constructor(){super(...arguments);ce(this,"priority",10);ce(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Tn(Sn.basicOptionalMinutes,n);case"xx":return Tn(Sn.basic,n);case"xxxx":return Tn(Sn.basicOptionalSeconds,n);case"xxxxx":return Tn(Sn.extendedOptionalSeconds,n);case"xxx":default:return Tn(Sn.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Qe(n,n.getTime()-va(n)-o)}}class zO extends Fe{constructor(){super(...arguments);ce(this,"priority",40);ce(this,"incompatibleTokens","*")}parse(n){return Yy(n)}set(n,r,o){return[Qe(n,o*1e3),{timestampIsSet:!0}]}}class HO extends Fe{constructor(){super(...arguments);ce(this,"priority",20);ce(this,"incompatibleTokens","*")}parse(n){return Yy(n)}set(n,r,o){return[Qe(n,o),{timestampIsSet:!0}]}}const UO={G:new cO,y:new uO,Y:new dO,R:new fO,u:new hO,Q:new pO,q:new mO,M:new gO,L:new yO,w:new bO,I:new xO,d:new EO,D:new CO,E:new PO,e:new kO,c:new IO,i:new OO,a:new _O,b:new DO,B:new MO,h:new NO,H:new LO,K:new FO,k:new VO,m:new $O,s:new RO,S:new BO,X:new jO,x:new WO,t:new zO,T:new HO},GO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qO=/^'([^]*?)'?$/,KO=/''/g,ZO=/\S/,XO=/[a-zA-Z]/;function QO(e,t,n,r){var p,v,b,y;const o=tO(),s=o.locale??Fy,i=o.firstWeekContainsDate??((v=(p=o.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,a=o.weekStartsOn??((y=(b=o.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??0;if(t==="")return e===""?Le(n):Qe(n,NaN);const l={firstWeekContainsDate:i,weekStartsOn:a,locale:s},c=[new lO],u=t.match(YO).map(g=>{const T=g[0];if(T in Ou){const S=Ou[T];return S(g,s.formatLong)}return g}).join("").match(GO),d=[];for(let g of u){Uy(g)&&_u(g,t,e),Hy(g)&&_u(g,t,e);const T=g[0],S=UO[T];if(S){const{incompatibleTokens:E}=S;if(Array.isArray(E)){const I=d.find(A=>E.includes(A.token)||A.token===T);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${g}\` at the same time`)}else if(S.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);d.push({token:T,fullToken:g});const C=S.run(e,g,s.match,l);if(!C)return Qe(n,NaN);c.push(C.setter),e=C.rest}else{if(T.match(XO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");if(g==="''"?g="'":T==="'"&&(g=JO(g)),e.indexOf(g)===0)e=e.slice(g.length);else return Qe(n,NaN)}}if(e.length>0&&ZO.test(e))return Qe(n,NaN);const f=c.map(g=>g.priority).sort((g,T)=>T-g).filter((g,T,S)=>S.indexOf(g)===T).map(g=>c.filter(T=>T.priority===g).sort((T,S)=>S.subPriority-T.subPriority)).map(g=>g[0]);let h=Le(n);if(isNaN(h.getTime()))return Qe(n,NaN);const m={};for(const g of f){if(!g.validate(h,l))return Qe(n,NaN);const T=g.set(h,m,l);Array.isArray(T)?(h=T[0],Object.assign(m,T[1])):h=T}return Qe(n,h)}function JO(e){return e.match(qO)[1].replace(KO,"'")}function e_(e,t){const n=Le(e),r=Le(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function t_(e){return aA(e,iA(e))}function n_(e,t){return _o(e,-t)}function Zy(e,t){return ya(e,-t)}function r_(e,t){return _y(e,-t)}function o_(e,t){return Dy(e,-t)}var mt=function(){return mt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},mt.apply(this,arguments)};function Nu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Lu(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var ti=function(e){return e.replace(new RegExp(" ","g")," ")},Xy=function(e,t){var n=e.length,r=t+1;if(n>=r)return e;var o="0".repeat(r-n);return"".concat(o).concat(e)},s_=function(e){return e.replace(/^0+([0-9]+)/,"$1")},Qy=function(e,t,n){var r=e.length-2,o=s_(e.substring(0,r)),s=e.substring(r);return o.split(/(?=(?:\d{3})*$)/).join(t)+n+s},Jy=function(e){return e===void 0&&(e=""),e.replace(/(-(?!\d))|[^0-9|-]/g,"")||""},wa=function(e){return Number.parseFloat(e.replace(/,/g,".").replace(/(.*)\./,function(t){return"".concat(t.replace(/\./g,""),".")}).replace(/[^0-9.]/g,""))},i_=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Fu=function(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e},[e]),t},a_=function(e){return e==="money"||e==="currency"},l_=function(e,t,n){return new Intl.NumberFormat(e,{style:"currency",currency:t,currencyDisplay:n}).formatToParts(1e3).reduce(function(r,o){var s;return mt(mt({},r),(s={},s[o.type]=o.value,s))},{currency:"",currencyDisplay:"",decimal:",",fraction:"",group:"",integer:"",literal:""})},xa=function(e,t){var n=Xy(Jy(e),t.fraction.length),r="".concat(t.currency).concat(Qy(n,t.group,t.decimal));return ti(r)},c_=w.forwardRef(function(e,t){var n=e.locale,r=n===void 0?"pt-BR":n,o=e.currency,s=o===void 0?"BRL":o,i=e.currencyDisplay,a=i===void 0?"symbol":i;e.mask;var l=e.onChange,c=Nu(e,["locale","currency","currencyDisplay","mask","onChange"]),u=w.useRef(null);w.useImperativeHandle(t,function(){return u.current});var d=w.useMemo(function(){var m=l_(r,s,a);return m.currency=ti("".concat(m.currency.trim()," ")),m.literal=ti(m.literal.trim()),m},[r,s]),f=function(m){var p=xa(m.target.value,d),v=wa(p);m.target.value=p,m.target.setAttribute("data-number",v.toString()),l==null||l(m),v!==0&&(u.current.selectionEnd=p.length)};w.useEffect(function(){if(u.current!==null){var m=u.current.value;if(m!==""){var p=xa(m,d),v=wa(p);u.current.value=p,u.current.setAttribute("data-number",v.toString());var b=new InputEvent("change",{});l==null||l(mt(mt({},b),{target:u.current,currentTarget:u.current})),v!==0&&(u.current.selectionEnd=p.length)}}},[d]);var h=c.defaultValue?xa(c.defaultValue,d):void 0;return w.createElement("input",mt({},c,{value:typeof c.value=="string"?xa(c.value,d):c.value,defaultValue:h,type:"text",ref:u,onChange:f,inputMode:"decimal"}))}),u_=1,d_=function(e){return e==="percentage"||e==="percent"||e==="percentual"},f_=function(e){return new Intl.NumberFormat(e,{style:"percent",minimumFractionDigits:2}).formatToParts(1e3).reduce(function(t,n){var r;return mt(mt({},t),(r={},r[n.type]=n.value,r))},{decimal:"",fraction:"",group:"",integer:"",percentSign:"",type:"",value:""})},Sa=function(e,t){var n=Xy(Jy(e),t.fraction.length),r="".concat(Qy(n,t.group,t.decimal)," ").concat(t.percentSign);return ti(r)},h_=w.forwardRef(function(e,t){var n=e.locale,r=n===void 0?"pt-BR":n;e.mask;var o=e.onChange,s=e.onKeyUp,i=Nu(e,["locale","mask","onChange","onKeyUp"]),a=w.useRef(null),l=Lu(w.useState(function(){var b,y;return(y=(b=i.value)===null||b===void 0?void 0:b.toString())!==null&&y!==void 0?y:""}),2),c=l[0],u=l[1];w.useImperativeHandle(t,function(){return a.current}),w.useEffect(function(){var b,y=Number.parseFloat("".concat((b=i.value)!==null&&b!==void 0?b:"0")).toFixed(d.fraction.length);u(Sa(y,d))},[i.value]);var d=w.useMemo(function(){var b=f_(r);return b.percentSign=ti("".concat(b.percentSign)),b},[r]),f=c.length-d.percentSign.length-u_,h=function(b){var y,g=a.current;g&&(g.setSelectionRange(f,f),b&&((y=i.onFocus)===null||y===void 0||y.call(i,b)))},m=function(b){var y=b.currentTarget;if(y.selectionStart!==null){var g=y.selectionStart,T=y.selectionEnd,S=g!==T,E=f<g;!S&&E&&h()}s==null||s(b)},p=function(b){var y=Sa(b.target.value,d),g=wa(y);u(y),b.target.value=y,b.target.setAttribute("data-number",g.toString()),o==null||o(b)};w.useEffect(function(){if(a.current!==null){var b=a.current.value;if(b!==""){var y=Sa(b,d),g=wa(y);u(y),a.current.value=y,a.current.setAttribute("data-number",g.toString());var T=new InputEvent("change",{});o==null||o(mt(mt({},T),{target:a.current,currentTarget:a.current}))}}},[]),w.useEffect(function(){return h()},[c]);var v=i.defaultValue?Sa(i.defaultValue,d):void 0;return w.createElement("input",mt({},i,{defaultValue:v,inputMode:"decimal",onChange:p,onFocus:h,onKeyUp:m,ref:a,type:"text"}))}),ni={dots:/\./g,openParenthesis:/\(/g,closeParenthesis:/\)/g,leadingBars:/\\\\/g,escape:/[.*+?^${}()|[\]\\]/g},p_=function(e){for(var t,n=e.length,r=[],o=0;o<n;o++){var s=e[o],i=Ta[s];i===void 0?r.push(s.replace(ni.dots,"\\.").replace(ni.openParenthesis,"\\(").replace(ni.closeParenthesis,"\\)")):r.push((t=i.regex)===null||t===void 0?void 0:t.source)}return r.join("").replace(ni.leadingBars,"\\")},ri=function(e,t,n){var r=typeof e=="function",o=r?"":e;if(r&&(o=e(t)),Array.isArray(o))return Vu(o,n);var s=p_(o);return n?"^".concat(s,"$"):s},m_=function(e){return e.replace(ni.escape,"\\$&")},Vu=function(e,t){var n=e.map(function(r){return typeof r=="string"?m_(r):r.source}).join("");return new RegExp(t?"^".concat(n,"$"):n).source},Ta={A:{regex:/[a-zA-Z]/,parse:function(e){return e.toLocaleUpperCase()}},H:{regex:/[a-fA-F0-9]/},X:{regex:/[0-9a-zA-Z]/},a:{regex:/[a-zA-Z]/,parse:function(e){return e.toLocaleLowerCase()}},d:{regex:/\d/,escape:!0},x:{regex:/[a-zA-Z]/}},g_=/\d/,ev="(dd) 9dddd-dddd",tv="(dd) dddd-dddd",nv="ddd.ddd.ddd-dd",rv="dd.ddd.ddd/dddd-dd",Ea=function(e){return e.replace(/\D/g,"")},y_=["2",/[0-3]/,":",/[0-5]/,/\d/],v_=[/[012]/,/\d/,":",/[0-5]/,/[0-9]/],Ht={cep:"ddddd-ddd",date:"dd/dd/dddd",cpf:nv,isoDate:"dddd-dd-dd",cnpj:rv,telephone:tv,cellphone:ev,creditCard:"dddd dddd dddd dddd",uuid:"HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH",color:function(e){return e.length>4?"#HHHHHH":"#HHH"},cpfCnpj:function(e){return Ea(e).length<=11?nv:rv},int:function(e){return e===void 0&&(e=""),g_.test(e.toString().slice(-1))?"d".repeat(Math.max(e.length,0)):"d".repeat(Math.max(e.length-1,0))},cellTelephone:function(e){var t=Ea(e);return t.length<11?tv:ev},time:function(e){var t=Ea(e),n=t[0];return n==="2"?y_:v_}},Ut=function(e,t,n){var r;return n===void 0&&(n={}),mt({mask:e,inputMode:t,strict:!0,pattern:((r=n.pattern)!==null&&r!==void 0?r:typeof e=="function")?void 0:ri(e,"",!0),infinity:n.infinity},n)},Mt={cellTelephone:Ut(Ht.cellTelephone,"tel"),cellphone:Ut(Ht.cellphone,"tel"),cep:Ut(Ht.cep,"decimal"),cnpj:Ut(Ht.cnpj,"decimal"),color:Ut(Ht.color,"decimal",{pattern:"#[a-fA-F0-9]{3}([a-fA-F0-9]{3})?"}),cpf:Ut(Ht.cpf,"decimal"),cpfCnpj:Ut(Ht.cpfCnpj,"decimal",{transform:Ea}),creditCard:Ut(Ht.creditCard,"decimal",{pattern:"[0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3,4}"}),date:Ut(Ht.date,"decimal"),int:Ut(Ht.int,"decimal",{pattern:"[0-9]+"}),isoDate:Ut(Ht.isoDate,"decimal"),telephone:Ut(Ht.telephone,"tel"),time:Ut(Ht.time,"decimal",{pattern:"[0-9]{2}:[0-9]{2}"}),uuid:Ut(Ht.uuid,"decimal",{pattern:"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"})};function ov(e,t,n,r){var o,s;r===void 0&&(r=Ta);for(var i=n(e),a="",l=0,c=0;l<t.length&&c<i.length;){var u=t[l],d=u instanceof RegExp?u:r[u],f=i[c];if(d===void 0){a+=u,f===u&&(c+=1),l+=1;continue}var h=d instanceof RegExp?{regex:d}:d;h.regex.test(f)&&(a+=(s=(o=h.parse)===null||o===void 0?void 0:o.call(h,f))!==null&&s!==void 0?s:f),c+=1,l+=1}return a}var sv=function(e){return e},b_=function(e,t,n){if(!e||!n)return!1;var r=new RegExp(ri(e,n,t));return r.test(n)};function w_(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e},[e]),t.current}var x_=w.forwardRef(function(e,t){var n=e.infinity,r=n===void 0?!1:n,o=e.strict,s=o===void 0?!0:o,i=e.transform,a=e.onChange,l=e.pattern,c=e.tokens,u=e.mask,d=e.onChangeText,f=e.as,h=Nu(e,["infinity","strict","transform","onChange","pattern","tokens","mask","onChangeText","as"]),m=w.useRef(null);w.useImperativeHandle(t,function(){return m.current});var p=Fu(a),v=Fu(d),b=Fu(u),y=w.useRef(b_(u,s,h.value||h.defaultValue)),g=f??"input",T=Lu(w.useState(""),2),S=T[0],E=T[1],C=w_(S),I=w.useCallback(function(M,F){var N,R,z=(N=M??F)!==null&&N!==void 0?N:"";if(u===void 0)return z;var D=(R=z==null?void 0:z.toString())!==null&&R!==void 0?R:"";return ov(D,typeof u=="function"?u(D):u,i??sv,c??Ta)},[i,u,c]),A=Lu(w.useState(function(){return I(h.value,h.defaultValue)}),2),O=A[0],L=A[1],_=I(h.defaultValue,h.defaultValue),V=w.useMemo(function(){if(l||u===void 0)return l;if(typeof u=="function"){var M=u(O);return Array.isArray(M)?Vu(M,s):ri(u,O,s)}return typeof u=="string"?ri(u,O,s):Vu(u,s)},[l,O,s,u]);w.useEffect(function(){if(h.value!==void 0){var M=I(h.value,h.defaultValue);L(M),m.current!==null&&(m.current.value=M)}},[h.value,u,i,h.defaultValue]);var k=function(M){var F,N,R,z,D,B=M.currentTarget,Z=M.target.value;if(b.current===void 0)return L(Z),(F=v.current)===null||F===void 0||F.call(v,Z),(N=p.current)===null||N===void 0||N.call(p,M),d==null?void 0:d(Z);var oe=new RegExp(ri(b.current,Z,s)),te=(R=B.selectionEnd)!==null&&R!==void 0?R:0,G=function(Q,fe,U){if(Q.type!=="number")return Q.setSelectionRange(fe,U)};if(r&&y.current&&Z.length>=O.length)return B.value=O,G(B,te-1,te-1);var $=!1;Z.length<C.length&&(y.current=!1,$=!0),oe.test(Z)&&(y.current=!0);var j=te,H=Z[j-1],Y=ov(Z,typeof b.current=="function"?b.current(Z):b.current,i??sv,c??Ta);for(B.value=Y,L(Y);j<Y.length&&Y.charAt(j-1)!==H;)j+=1;$?G(B,te,te):G(B,j,j),M.target.value=Y,E(Y),(z=v.current)===null||z===void 0||z.call(v,Y),(D=p.current)===null||D===void 0||D.call(p,M)};return w.createElement(g,mt({},h,{ref:m,pattern:V,onChange:k,defaultValue:iv(h.defaultValue)?_:void 0,value:iv(h.value)?I(h.value,h.value):h.value}))}),iv=function(e){return typeof e=="string"},av=w.forwardRef(function(e,t){return a_(e.mask)?w.createElement(c_,mt({},e,{mask:void 0,ref:t})):d_(e.mask)?w.createElement(h_,mt({},e,{mask:void 0,ref:t})):w.createElement(x_,mt({},e,{ref:t}))}),Gt=function(e){return function(t){return w.createElement(av,mt({},e,t))}};Gt(Mt.cellTelephone),Gt(Mt.cellphone),Gt(Mt.cep),Gt(Mt.cnpj),Gt(Mt.color),Gt(Mt.cpf),Gt(Mt.cpfCnpj),Gt(Mt.creditCard),Gt(Mt.date),Gt(Mt.int),Gt(Mt.isoDate),Gt(Mt.telephone),Gt(Mt.time),Gt(Mt.uuid);var lv=w.forwardRef(function(t,n){var r=w.useMemo(function(){if(t.mask)return typeof t.mask=="string"&&i_(Mt,t.mask)?Mt[t.mask]:{mask:t.mask}},[t.mask]),o=mt(mt({},t),r);return w.createElement(av,mt({},o,{ref:n}))}),$u={},Ru={exports:{}},Bu={};/**
138
138
  * @license React
139
139
  * use-sync-external-store-shim.production.min.js
140
140
  *
@@ -142,7 +142,7 @@
142
142
  *
143
143
  * This source code is licensed under the MIT license found in the
144
144
  * LICENSE file in the root directory of this source tree.
145
- */var cv;function w_(){if(cv)return $u;cv=1;var e=w;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),p=m[0].inst,y=m[1];return s(function(){p.value=h,p.getSnapshot=f,l(p)&&y({inst:p})},[d,h,f]),o(function(){return l(p)&&y({inst:p}),d(function(){l(p)&&y({inst:p})})},[d]),i(h),h}function l(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return $u.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,$u}var uv={};/**
145
+ */var cv;function S_(){if(cv)return Bu;cv=1;var e=w;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),p=m[0].inst,v=m[1];return s(function(){p.value=h,p.getSnapshot=f,l(p)&&v({inst:p})},[d,h,f]),o(function(){return l(p)&&v({inst:p}),d(function(){l(p)&&v({inst:p})})},[d]),i(h),h}function l(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Bu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Bu}var uv={};/**
146
146
  * @license React
147
147
  * use-sync-external-store-shim.development.js
148
148
  *
@@ -150,7 +150,7 @@
150
150
  *
151
151
  * This source code is licensed under the MIT license found in the
152
152
  * LICENSE file in the root directory of this source tree.
153
- */var dv;function x_(){return dv||(dv=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(g){{for(var T=arguments.length,S=new Array(T>1?T-1:0),E=1;E<T;E++)S[E-1]=arguments[E];r("error",g,S)}}function r(g,T,S){{var E=t.ReactDebugCurrentFrame,C=E.getStackAddendum();C!==""&&(T+="%s",S=S.concat([C]));var I=S.map(function(A){return String(A)});I.unshift("Warning: "+T),Function.prototype.apply.call(console[g],console,I)}}function o(g,T){return g===T&&(g!==0||1/g===1/T)||g!==g&&T!==T}var s=typeof Object.is=="function"?Object.is:o,i=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function f(g,T,S){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=T();if(!d){var C=T();s(E,C)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var I=i({inst:{value:E,getSnapshot:T}}),A=I[0].inst,O=I[1];return l(function(){A.value=E,A.getSnapshot=T,h(A)&&O({inst:A})},[g,E,T]),a(function(){h(A)&&O({inst:A});var F=function(){h(A)&&O({inst:A})};return g(F)},[g]),c(E),E}function h(g){var T=g.getSnapshot,S=g.value;try{var E=T();return!s(S,E)}catch{return!0}}function m(g,T,S){return T()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!p,b=y?m:f,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;uv.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),uv}var fv;function hv(){return fv||(fv=1,process.env.NODE_ENV==="production"?Vu.exports=w_():Vu.exports=x_()),Vu.exports}/**
153
+ */var dv;function T_(){return dv||(dv=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(g){{for(var T=arguments.length,S=new Array(T>1?T-1:0),E=1;E<T;E++)S[E-1]=arguments[E];r("error",g,S)}}function r(g,T,S){{var E=t.ReactDebugCurrentFrame,C=E.getStackAddendum();C!==""&&(T+="%s",S=S.concat([C]));var I=S.map(function(A){return String(A)});I.unshift("Warning: "+T),Function.prototype.apply.call(console[g],console,I)}}function o(g,T){return g===T&&(g!==0||1/g===1/T)||g!==g&&T!==T}var s=typeof Object.is=="function"?Object.is:o,i=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function f(g,T,S){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=T();if(!d){var C=T();s(E,C)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var I=i({inst:{value:E,getSnapshot:T}}),A=I[0].inst,O=I[1];return l(function(){A.value=E,A.getSnapshot=T,h(A)&&O({inst:A})},[g,E,T]),a(function(){h(A)&&O({inst:A});var L=function(){h(A)&&O({inst:A})};return g(L)},[g]),c(E),E}function h(g){var T=g.getSnapshot,S=g.value;try{var E=T();return!s(S,E)}catch{return!0}}function m(g,T,S){return T()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!p,b=v?m:f,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;uv.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),uv}var fv;function hv(){return fv||(fv=1,process.env.NODE_ENV==="production"?Ru.exports=S_():Ru.exports=T_()),Ru.exports}/**
154
154
  * @license React
155
155
  * use-sync-external-store-shim/with-selector.production.min.js
156
156
  *
@@ -158,7 +158,7 @@
158
158
  *
159
159
  * This source code is licensed under the MIT license found in the
160
160
  * LICENSE file in the root directory of this source tree.
161
- */var pv;function S_(){if(pv)return Fu;pv=1;var e=w,t=hv();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Fu.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var m=s(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function b(E){if(!v){if(v=!0,g=E,E=f(E),h!==void 0&&p.hasValue){var C=p.value;if(h(C,E))return T=C}return T=E}if(C=T,r(g,E))return C;var I=f(E);return h!==void 0&&h(C,I)?C:(g=E,T=I)}var v=!1,g,T,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=o(c,m[0],m[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},Fu}var mv={};/**
161
+ */var pv;function E_(){if(pv)return $u;pv=1;var e=w,t=hv();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return $u.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var m=s(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function b(E){if(!y){if(y=!0,g=E,E=f(E),h!==void 0&&p.hasValue){var C=p.value;if(h(C,E))return T=C}return T=E}if(C=T,r(g,E))return C;var I=f(E);return h!==void 0&&h(C,I)?C:(g=E,T=I)}var y=!1,g,T,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var v=o(c,m[0],m[1]);return i(function(){p.hasValue=!0,p.value=v},[v]),l(v),v},$u}var mv={};/**
162
162
  * @license React
163
163
  * use-sync-external-store-shim/with-selector.development.js
164
164
  *
@@ -166,11 +166,11 @@
166
166
  *
167
167
  * This source code is licensed under the MIT license found in the
168
168
  * LICENSE file in the root directory of this source tree.
169
- */var gv;function T_(){return gv||(gv=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=hv();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,f,h,m){var p=s(null),y;p.current===null?(y={hasValue:!1,value:null},p.current=y):y=p.current;var b=a(function(){var S=!1,E,C,I=function(_){if(!S){S=!0,E=_;var V=h(_);if(m!==void 0&&y.hasValue){var k=y.value;if(m(k,V))return C=k,k}return C=V,V}var M=E,L=C;if(r(M,_))return L;var N=h(_);return m!==void 0&&m(L,N)?L:(E=_,C=N,N)},A=f===void 0?null:f,O=function(){return I(d())},F=A===null?void 0:function(){return I(A())};return[O,F]},[d,f,h,m]),v=b[0],g=b[1],T=o(u,v,g);return i(function(){y.hasValue=!0,y.value=T},[T]),l(T),T}mv.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mv}process.env.NODE_ENV==="production"?S_():T_();const Lo=e=>{const t=w.useRef(e??{});return w.useEffect(()=>void(t.current=e),[e]),t},E_=e=>{const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current},C_=e=>Object.entries(e),yv=e=>e instanceof Promise,vv=(e,t,n,r)=>t===e?n.reduce((o,s)=>s(o,t,r),e):e.constructor.name===Object.name?n.reduce((o,s)=>s(o,t,r),{...t,...e}):n.reduce((o,s)=>s(o,t,r),e),P_=(e,t,n,r,o,s)=>(...i)=>{const a=performance.now(),l=t(...i),c=(u,d)=>n(f=>vv(u,f,s,d));return yv(l)?l.then(u=>{o.current={method:e,props:r(),time:performance.now()-a},c(u,o.current)}):(o.current={method:e,props:r(),time:performance.now()-a},void c(l,o.current))},k_=(e,t,n,r,o,s)=>(...i)=>{o.current={method:e,time:0,props:r()};const a=t(...i),l=c=>n(u=>vv(c,u,s,o.current));return yv(a)?a.then(c=>l(c)):l(a)},Ru=(e,t,n)=>{const[r,o]=w.useState(()=>e),s=Lo(r),i=Lo((n==null?void 0:n.props)??{}),a=Lo(t),l=Lo((n==null?void 0:n.postMiddleware)??[]),c=Lo((n==null?void 0:n.interceptor)??[]),u=w.useRef(e),d=E_(r),f=Lo(d),h=w.useRef(null);w.useEffect(()=>{if(h.current===null)return;const p=h.current;l.current.forEach(y=>{y(r,d,p)})},[r,l,d]);const[m]=w.useState(()=>{const p=()=>i.current,y=a.current({props:p,state:()=>s.current,initialState:u.current,previousState:()=>f.current});return C_(y).reduce((b,[v,g])=>({...b,[v]:n!=null&&n.debug?P_(v,g,o,p,h,c.current):k_(v,g,o,p,h,c.current)}),{})});return[r,m,i.current]},I_=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function A_(e,t){return w.useRef(I_(e,t)).current}const Ea={cssVariable:(e,t,n)=>`var(--${n})`,rgba:e=>`rgba(${e})`,rgb:e=>`rgb(${e})`,hsl:e=>`hsl(${e})`,hsla:e=>`hsla(${e})`,hex:e=>e,raw:e=>e,formatWithVar:e=>(t,n,r)=>`${e}(var(--${r}), <alpha-value>)`},Fo=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return o.concat(t(i,l,a))}return o.concat(Fo(i,t,n,a))},[]),bv=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return{...o,[l]:t(i,s,a)}}return{...o,[s]:bv(i,t,n,a)}},{}),wv={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},Ca=(e,t)=>{const n=t.value||((o,s)=>s),r=e.map(o=>`${o.key}: ${n(o.key,o.value)}`).join(";");return t.result(r)},O_={default:e=>Ca(e,{result:wv.default}),dark:e=>Ca(e,{result:wv.dark})},Bu=(e,t)=>{const n=a=>(l,c,u)=>{const d={key:`--${u}`,value:`${l}`};return a?a(d):d},r=Fo(e.colors,n(t==null?void 0:t.colors)),o=Fo(e.spacing,n(t==null?void 0:t.spacing)),s=Fo(e.rounded,n(t==null?void 0:t.rounded)),i=e.custom?Fo(e.custom,n(t==null?void 0:t.customTokens)):[];return r.concat(o,s,i)},__=(e,t)=>Ca(Bu(e),{result:n=>`html${t?`.${t}`:""} {${n}}`,value:(n,r)=>r.replace("hsla(","").replace(")","")}),D_=(e,t)=>Bu(e,t).reduce((r,o)=>({...r,[o.key]:o.value}),{}),M_=(e,t)=>Ca(Bu(e,t),{result:n=>`html${t!=null&&t.name?`.${t.name}`:""} {${n}}`,value:(n,r)=>r}),xv={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},Sv={base:"1rem",lg:"1.5rem",sm:"0.75rem","input-height":"2.5rem","input-x":"0.5rem","input-y":"0.25rem","input-inline":"0.25rem","input-gap":"0.3rem"},N_={name:"dark",rounded:xv,spacing:Sv,shadow:{floating:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px"},colors:{foreground:"hsla(210, 50%, 98%)",background:"hsla(0, 0%, 9%)",muted:"hsla(0, 0%, 12%)",disabled:"hsla(240, 4%, 33%)",emphasis:{foreground:"hsla(251, 91%, 95%)",DEFAULT:"hsla(255, 92%, 76%)",subtle:"hsla(252, 95%, 85%)",hover:"hsla(262, 83%, 58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(200,98%,39%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{DEFAULT:"hsla(210, 32%, 70%)",background:"hsla(210, 30%, 81%)",subtle:"hsla(210, 27%, 88%)",hover:"hsla(210, 10%, 58%)",foreground:"hsla(210, 20%, 30%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 93%, 77%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(219, 91%, 59%)"},warn:{DEFAULT:"hsla(27, 96%, 61%)",subtle:"hsla(45, 95%, 66%)",hover:"hsla(21, 90%, 48%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(32, 65%, 75%)"},danger:{DEFAULT:"hsla(358, 65%, 57%)",subtle:"hsla(0, 94%, 81%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(358, 40%, 23%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 75%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 50%)",notification:"hsla(161,62%,17%)"},input:{border:"hsla(240, 4%, 25%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 9%)",switch:"hsla(0, 0%, 100%)"},card:{muted:"hsla(0, 0%, 22%)",border:"hsla(240, 7%, 27%)",background:"hsla(0, 0%, 15%)"},floating:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 14%)",hover:"hsla(221, 10%, 22%)",border:"hsla(240, 7%, 27%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 8%)",hover:"hsla(221, 10%, 35%)",border:"hsla(0, 0%, 19%)",overlay:"hsla(0, 0%, 0%)"},table:{header:"hsla(0, 0%, 12%)",border:"hsla(240, 4%, 33%)",background:"hsla(0, 0%, 15%)"},button:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,90%)",bg:"hsla(5,62%,23%)"},muted:{text:"hsla(0, 100%, 100%)",bg:"hsla(0, 0%, 12%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,79%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"},muted:{text:"hsla(0, 100%, 100%)",bg:"hsla(0, 0%, 12%)"}},alert:{primary:{text:"hsla(210,100%,72%)",border:"hsla(212,69%,16%)",bg:"hsla(215,42%,9%)"},warn:{bg:"hsla(28,33%,9%)",border:"hsla(29,65%,12%)",text:"hsla(27,100%,78%)"},info:{text:"hsla(253,100%,83%)",bg:"hsla(263,28%,11%)",border:"hsla(252,34%,51%)"},success:{text:"hsla(144,79%,79%)",bg:"hsla(153,20%,9%)",border:"hsla(144,70%,14%)"},danger:{text:"hsla(350,100%,91%)",bg:"hsla(355,25%,15%)",border:"hsla(355,25%,10%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(220,9%,94%)",bg:"hsla(220,6%,10%)",border:"hsla(214,7%,19%)"},muted:{bg:"hsla(0, 0%, 12%)",border:"hsla(0, 0%, 40%)",text:"hsla(0, 100%, 100%)"}}}},L_={rounded:xv,spacing:Sv,name:"light",shadow:{floating:"rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px"},colors:{foreground:"hsla(217, 15%, 30%)",background:"hsla(210, 34%, 96%)",muted:"hsla(210, 30%, 86%)",disabled:"hsla(240, 10%, 78%)",emphasis:{foreground:"hsla(251,91%,95%)",DEFAULT:"hsla(255,92%,76%)",subtle:"hsla(252,95%,85%)",hover:"hsla(262,83%,58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(199, 89%, 54%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{background:"hsla(210, 25%, 35%)",DEFAULT:"hsla(210, 25%, 35%)",subtle:"hsla(207, 29%, 39%)",hover:"hsla(210, 21%, 67%)",foreground:"hsla(210, 40%, 98%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 70%, 90%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(219, 91%, 59%)"},danger:{DEFAULT:"hsla(0, 82%, 63%)",subtle:"hsla(0, 96%, 95%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(0, 100%, 87%)"},warn:{DEFAULT:"hsla(27, 100%, 70%)",subtle:"hsla(45, 95%, 80%)",hover:"hsla(29, 85%, 50%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(27, 85%, 92%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 90%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 17%)",notification:"hsla(160, 75%, 80%)"},input:{border:"hsla(218, 22%, 85%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 45%)",switch:"hsla(0, 0%, 100%)"},card:{muted:"hsla(210, 25%, 94%)",border:"hsla(210, 25%, 88%)",background:"hsla(0, 0%, 100%)"},floating:{foreground:"hsla(217, 15%, 20%)",background:"hsla(0, 0%, 100%)",hover:"hsla(0, 0%, 92%)",border:"hsla(210, 25%, 88%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(217, 15%, 20%)",background:"hsla(210, 25%, 98%)",hover:"hsla(210, 25%, 92%)",border:"hsla(200, 1%, 80%)",overlay:"hsla(0, 0%, 0%)"},table:{header:"hsla(221, 10%, 90%)",background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},button:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 10%, 15%)"},primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,96%,48%)"},warn:{bg:"hsla(26,90%,60%)",text:"hsla(0, 0%, 100%)"},info:{text:"hsla(0, 0%, 100%)",bg:"hsla(210,60%,60%)"},success:{text:"hsla(0, 0%, 100%)",bg:"hsla(152,56%,39%)"},danger:{text:"hsla(0, 0%, 100%)",bg:"hsla(10,78%,54%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 30%, 86%)"},primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,70%,55%)"},warn:{bg:"hsla(30,100%,82%)",text:"hsla(23,100%,40%)"},info:{text:"hsla(196,100%,20%)",bg:"hsla(197,65%,80%)"},success:{text:"hsla(154,52%,19%)",bg:"hsla(152,56%,80%)"},danger:{text:"hsla(10,82%,45%)",bg:"hsla(359,94%,92%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},alert:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 30%, 86%)",border:"hsla(210, 10%, 70%)"},primary:{text:"hsla(206,70%,50%)",border:"hsla(206,90%,89%)",bg:"hsla(205,92%,95%)"},warn:{bg:"hsla(23,100%,96%)",text:"hsla(23,93%,53%)",border:"hsla(33,100%,85%)"},info:{text:"hsla(252,56%,57%)",bg:"hsla(256,100%,95%)",border:"hsla(252,76%,84%)"},success:{text:"hsla(152,56%,39%)",bg:"hsla(139,47%,93%)",border:"hsla(152,58%,78%)"},danger:{text:"hsla(358,69%,55%)",bg:"hsla(357,90%,96%)",border:"hsla(359,100%,90%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(216,10%,10%)",bg:"hsla(214,7%,92%)",border:"hsla(216,22%,78%)"}}}},F_=N_,V_=L_,ju={emptyDataMessage:"No data",inputCaretDown:"Click to see all options",inputCloseValue:"Click to clear the value",datePickerCalendarButtonLabel:"Click to open a date picker",inputOptionalLabel:"Optional",autocompleteEmpty:"Nothing here...",tableGroupLabel:"Group",tableGroupLabelWithCount:"Group",tableSortAsc:"Ascending",tableSortOrderByLabel:"Order by",tableSortOrderInputPlaceholder:"Order by",tableSortOrderInputTitle:"Order by",tableSortTypeInputPlaceholder:"Ascending",tableSortTypeInputTitle:"Sort type",tableSortAddButton:"Add sort",tableSortDropdownTitle:"Order by",tableSortDesc:"Descending",tableColumnResizer:"Resize column",tableFilterTypeContains:"Contains",tableFilterTypeIs:"Is",tableFilterTypeIsNot:"Is not",tableFilterTypeNotContains:"Not contains",tableFilterTypeLessThan:"Less than",tableFilterTypeGreaterThan:"Greater than",tableFilterTypeStartsWith:"Starts with",tableFilterTypeEndsWith:"Ends with",tableFilterNewFilter:"New filter",tableFilterColumnTitle:"Filter by",tableFilterColumnPlaceholder:"Filter by",tableFilterOperatorTitle:"Operation",tableFilterOperatorPlaceholder:"Equals to...",tableFilterValueTitle:"Value",tableFilterValuePlaceholder:"Something...",tableFilterLabel:"Filters",tableFilterDropdownTitle:"Filters",tableFilterDropdownTitleUnique:"Filter by",tablePaginationPrevious:"Previous",tablePaginationNext:"Next",tablePaginationSelectLabel:"Select the size of page",tablePaginationFooter:e=>x.jsxs(w.Fragment,{children:[e.current," to ",e.pages," of ",e.totalItems," items.",Array.isArray(e.sizes)?e.select:null," per page."]}),calendarFromDate:"From",calendarToDate:"To",calendarToday:"Today",calendarBackMonth:"Back month",calendarNextMonth:"Next month",multiComboboxSelectedLabel:"Selected",multiComboboxInnerPlaceholder:"Search..."},Wu={input:{iconFeedback:!0}},ri=w.createContext({tweaks:Wu,parser:Ea.hsla,map:ju,locale:void 0}),$_=e=>{const t=w.useMemo(()=>({locale:e.locale,tweaks:{...Wu,...e.tweaks},parser:e.parser||Ea.hsla,map:{...ju,...e.map}}),[e]);return x.jsx(ri.Provider,{value:t,children:e.children})},zu=e=>{if(e)return e;const t=w.useContext(ri);if(t)return t.locale||e},Tt=()=>{const e=w.useContext(ri);return e?e.map:ju},R_=()=>{const e=w.useContext(ri);return e?e.parser:Ea.hsla},B_=()=>{const e=w.useContext(ri);return e?e.tweaks:Wu},j_={type:"spring",bounce:.3,duration:.6},Tv=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),Ev={middle:{x:"0%",opacity:1},enter:Tv(1),exit:Tv(-1)},Cv={exit:{visibility:"hidden"}},W_=e=>{const t=xn(Ly(e));return Ny({start:t,end:_o(t,41)})},Pv=(e,t)=>e.toLocaleDateString(t,{month:"long"}),z_=(e,t,n)=>Array.from({length:12}).map((r,o)=>{const s=Ly(new Date(1970,o,1).setMonth(o)),i=Pv(s,n);return x.jsx("option",{value:i,"data-index":o,children:i},`${e}-${i}`)}),Hu={ArrowLeft:(e,t)=>t==="days"?e_(e,1):Zy(e,1),ArrowRight:(e,t)=>t==="days"?_o(e,1):ga(e,1),ArrowUp:(e,t)=>t==="days"?t_(e,1):n_(e,1),ArrowDown:(e,t)=>t==="days"?_y(e,1):Dy(e,1)},kv=(e,t,n,r=0)=>{const o=n.toISOString(),s=()=>{var i;if(e!=null&&e.dataset.focustrap){const a=(i=t.current)==null?void 0:i.querySelector(`button[data-focustrap="${e==null?void 0:e.dataset.focustrap}"]`);return setTimeout(()=>a==null?void 0:a.focus({preventScroll:!1}),r)}if(t.current){const a=t.current.querySelector(`button[data-date="${o}"]`);if(a)return a.focus({preventScroll:!1})}};r===0&&s(),setTimeout(s,r)},Nr=e=>e.getFullYear().toString().padStart(4,"0"),H_=(e,t,n)=>e===void 0||n===void 0?!1:tO(t,e)&&nO(t,n),U_=e=>{var n;const t=Tt();return x.jsx(at.tbody,{layout:!0,variants:Ev,custom:e.direction,onKeyDown:e.onKeyDown,className:Me((n=e.styles)==null?void 0:n.week),children:e.zip.map((r,o)=>{var s;return x.jsx("tr",{className:(s=e.styles)==null?void 0:s.week,children:r.map(i=>{var h,m,p,y,b,v,g,T,S,E,C,I,A,O;const a=i.toISOString(),l=e.rangeMode?a===((m=(h=e.range)==null?void 0:h.to)==null?void 0:m.toISOString())||a===((y=(p=e.range)==null?void 0:p.from)==null?void 0:y.toISOString()):a===((b=e.date)==null?void 0:b.toISOString()),c=JO(i)&&e.markToday,u=((v=e.disabledDate)==null?void 0:v.call(e,i))||!1,d=!QO(i,e.stateDate)||u,f=e.rangeMode?H_((g=e.range)==null?void 0:g.from,i,(T=e.range)==null?void 0:T.to):!1;return x.jsxs("td",{align:"center",className:Me("relative",(S=e.styles)==null?void 0:S.dayFrame),children:[x.jsxs("button",{type:"button","data-date":a,disabled:u,"data-range":e.rangeMode,onClick:e.dispatch.onSelectDate,"data-view":e.stateDate.getMonth().toString(),className:Me(`flex size-10 items-center justify-center rounded-full proportional-nums disabled:cursor-not-allowed ${c?"text-emphasis":""} ${d?"text-disabled":""} ${l?"bg-primary text-primary-foreground":""}`,(E=e.styles)==null?void 0:E.day,f&&e.markRange?"size-10 border border-dashed border-card-border":""),children:[i.getDate(),l&&((C=e.stateRange.from)==null?void 0:C.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((I=e.labelRange)==null?void 0:I.from)??t.calendarFromDate})}):null,l&&((A=e.stateRange.to)==null?void 0:A.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((O=e.labelRange)==null?void 0:O.to)??t.calendarToDate})}):null]}),e.RenderOnDay?x.jsx(e.RenderOnDay,{date:i}):null]},a)})},`week-${r.length}-${o}`)})})},Iv=({RenderOnDay:e,changeOnlyOnClick:t=!1,labelRange:n,disabledDate:r,locale:o,markToday:s=!0,onChangeMonth:i,onChangeYear:a,rangeMode:l=!1,onChange:c,styles:u,markRange:d=!0,...f})=>{const h=w.useRef(_s()),m=Tt(),p=zu(o),y=w.useRef(null),{date:b,range:v}=f,g=b||new Date,T=w.useRef(null),[S,E]=Ru({date:g,isAnimating:!1,year:Nr(g),direction:void 0,range:{from:v==null?void 0:v.from,to:v==null?void 0:v.to},months:z_(h.current,g,p),selectMode:l?"from":void 0,week:Ny({start:xn(g),end:lA(g)})},_=>({onChangeYear:V=>({year:V}),setToday:()=>({date:Mo(new Date)}),onExitComplete:()=>(kv(T.current||null,y,_.state().date,200),T.current=null,{isAnimating:!1}),date:V=>{const k=V(_.state().date);return{date:k,year:Nr(k)}},nextMonth:V=>{T.current=V.currentTarget;const k=_.state();if(k.isAnimating)return k;const M=ga(k.date,1);return{date:M,isAnimating:!0,direction:1,year:Nr(M)}},previousMonth:V=>{T.current=V.currentTarget;const k=_.state();if(k.isAnimating)return k;const M=Zy(k.date,1);return{date:M,isAnimating:!0,direction:-1,year:Nr(M)}},onSelectDate:V=>{const k=_.state(),M=V.currentTarget.dataset.range==="true",L=V.currentTarget.dataset.date||"",N=new Date(L);return{date:N,year:Nr(N),selectMode:k.selectMode===void 0?void 0:k.selectMode==="from"?"to":"from",range:M?{from:k.selectMode==="from"?N:k.range.from,to:k.selectMode==="to"?N:k.range.to}:k.range}},onChangeMonth:V=>{const k=V.target.value,L=Array.from(V.target.options).find(R=>R.value===k),N=_.state();if(L){const R=L.dataset.index||"",z=new Date(_.state().date);return z.setMonth(+R),{...N,date:z,year:Nr(z)}}return N},onKeyDown:V=>{const k=V.key,M=_.state();if(k in Hu){(k==="ArrowUp"||k==="ArrowDown")&&V.preventDefault();const L=_.state().date,N=Pt.keyof(Hu,k)?Hu[k](L,V.shiftKey?"month":"days"):null;if(N!==null)return kv(V.target,y,N),{...M,date:N,year:Nr(N)}}return _.state()}}),{props:{onChangeMonth:i,onChangeYear:a},postMiddleware:[(_,V,k)=>{var L,N;return(k.method==="onChangeMonth"||k.method==="previousMonth"||k.method==="nextMonth")&&((N=(L=k.props).onChangeMonth)==null||N.call(L,_.date)),_},(_,V,k)=>{var L,N;return k.method==="onChangeYear"&&((N=(L=k.props).onChangeYear)==null||N.call(L,_.date)),_},(_,V,k)=>{const M=k.method==="onSelectDate"||k.method==="setToday"||k.method==="onKeyDown";return l&&M&&t?(c==null||c(_.range),_):(M&&t&&(c==null||c(_.date)),_)}]}),C=ip(W_(S.date),7),I=S.date.toISOString(),A=Pv(S.date,p);w.useEffect(()=>{t||c==null||c(S.date)},[I]);const O=A_(_=>{E.date(V=>{const k=new Date(V);return k.setFullYear(+_),k})},1200),F=_=>{const V=_.currentTarget.value;E.onChangeYear(V),a==null||a(new Date(V)),O(V)};return x.jsx(HT,{transition:j_,children:x.jsxs("div",{"data-component":"calendar",ref:y,className:Me("relative overflow-hidden",u==null?void 0:u.calendar),children:[x.jsx("div",{className:"flex flex-col justify-center rounded text-center",children:x.jsx(er,{initial:!1,mode:"popLayout",custom:S.direction,onExitComplete:E.onExitComplete,children:x.jsxs(at.div,{initial:"enter",animate:"middle",exit:"exit",children:[x.jsxs("header",{className:"relative flex justify-between",children:[x.jsx(at.button,{layout:!0,type:"button","data-focustrap":"prev",variants:Cv,onClick:E.previousMonth,title:m.calendarBackMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground",children:x.jsx(RI,{className:"h-4 w-4"})}),x.jsx(at.span,{layout:!0,variants:Ev,custom:S.direction,className:"absolute inset-0 isolate z-normal flex items-center justify-center font-semibold",children:x.jsxs("span",{className:"flex w-fit items-center justify-center gap-0.5 py-1",children:[x.jsx("select",{value:A,onChange:E.onChangeMonth,style:{width:`${A.length+1}ch`},className:"cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:S.months}),x.jsx(lv,{mask:"int",maxLength:4,placeholder:"YYYY",value:S.year,onChange:F,style:{width:`${S.year.length}ch`},className:"w-16 cursor-pointer appearance-none bg-transparent hover:text-primary"})]})}),x.jsx(at.button,{layout:!0,type:"button","data-focustrap":"next",variants:Cv,onClick:E.nextMonth,title:m.calendarNextMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground",children:x.jsx(Tu,{className:"h-4 w-4"})}),x.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)"}})]}),x.jsxs(at.table,{className:"mt-2 table min-w-full table-auto border-0",children:[x.jsx("thead",{children:x.jsx("tr",{children:S.week.map(_=>x.jsx("th",{className:Me("py-2 text-sm font-medium capitalize",u==null?void 0:u.weekDay),children:_.toLocaleDateString(p,{weekday:"short"})},_.toString()))})}),x.jsx(U_,{zip:C,range:v,styles:u,date:b||null,dispatch:E,markRange:d,markToday:s,rangeMode:l,stateDate:S.date,labelRange:n,stateRange:S.range,RenderOnDay:e,direction:S.direction,disabledDate:r,onKeyDown:E.onKeyDown})]})]},A)})}),x.jsx("footer",{className:"mt-2 text-center text-primary",children:x.jsx("button",{className:"transition-transform duration-300 hover:scale-105",type:"button",onClick:E.setToday,children:m.calendarToday})})]})})},Av=({children:e,title:t,titleClassName:n="",as:r="div",container:o="",header:s=null,className:i="",...a})=>x.jsxs(mo,{...a,as:r,"data-componen":"card",className:Me("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow",o),children:[t?x.jsx("header",{className:Me("mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium",n),children:t}):s,x.jsx("div",{className:Me("min-w-full px-8",i),children:e})]}),Ov=e=>{const t=e.Icon??Cy,n=Tt();return x.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-4 px-8 py-12",children:[x.jsx(t,{size:64,className:"text-disabled"}),x.jsx("p",{className:"text-disabled",children:n.emptyDataMessage})]})};function qt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function G_(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _v(...e){return t=>e.forEach(n=>G_(n,t))}function Lr(...e){return P.useCallback(_v(...e),e)}function Dv(e,t=[]){let n=[];function r(s,i){const a=P.createContext(i),l=n.length;n=[...n,i];function c(d){const{scope:f,children:h,...m}=d,p=(f==null?void 0:f[e][l])||a,y=P.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:y,children:h})}function u(d,f){const h=(f==null?void 0:f[e][l])||a,m=P.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const o=()=>{const s=n.map(i=>P.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Y_(o,...t)]}function Y_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Vo=P.forwardRef((e,t)=>{const{children:n,...r}=e,o=P.Children.toArray(n),s=o.find(K_);if(s){const i=s.props.children,a=o.map(l=>l===s?P.Children.count(i)>1?P.Children.only(null):P.isValidElement(i)?i.props.children:null:l);return x.jsx(Uu,{...r,ref:t,children:P.isValidElement(i)?P.cloneElement(i,void 0,a):null})}return x.jsx(Uu,{...r,ref:t,children:n})});Vo.displayName="Slot";var Uu=P.forwardRef((e,t)=>{const{children:n,...r}=e;if(P.isValidElement(n)){const o=X_(n);return P.cloneElement(n,{...Z_(r,n.props),ref:t?_v(t,o):o})}return P.Children.count(n)>1?P.Children.only(null):null});Uu.displayName="SlotClone";var q_=({children:e})=>x.jsx(x.Fragment,{children:e});function K_(e){return P.isValidElement(e)&&e.type===q_}function Z_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function X_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Q_(e){const t=e+"CollectionProvider",[n,r]=Dv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:m,children:p}=h,y=w.useRef(null),b=w.useRef(new Map).current;return x.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:p})};i.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((h,m)=>{const{scope:p,children:y}=h,b=s(a,p),v=Lr(m,b.collectionRef);return x.jsx(Vo,{ref:v,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((h,m)=>{const{scope:p,children:y,...b}=h,v=w.useRef(null),g=Lr(m,v),T=s(c,p);return w.useEffect(()=>(T.itemMap.set(v,{ref:v,...b}),()=>void T.itemMap.delete(v))),x.jsx(Vo,{[u]:"",ref:g,children:y})});d.displayName=c;function f(h){const m=s(e+"CollectionConsumer",h);return w.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((T,S)=>b.indexOf(T.ref.current)-b.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:l,ItemSlot:d},f,r]}var J_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],En=J_.reduce((e,t)=>{const n=P.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Vo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Mv(e,t){e&&Ss.flushSync(()=>e.dispatchEvent(t))}function jn(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function eD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e);P.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tD="DismissableLayer",Gu="dismissableLayer.update",nD="dismissableLayer.pointerDownOutside",rD="dismissableLayer.focusOutside",Nv,Lv=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fv=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=P.useContext(Lv),[u,d]=P.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),m=Lr(t,C=>d(C)),p=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(y),v=u?p.indexOf(u):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,T=v>=b,S=sD(C=>{const I=C.target,A=[...c.branches].some(O=>O.contains(I));!T||A||(o==null||o(C),i==null||i(C),C.defaultPrevented||a==null||a())},f),E=iD(C=>{const I=C.target;[...c.branches].some(O=>O.contains(I))||(s==null||s(C),i==null||i(C),C.defaultPrevented||a==null||a())},f);return eD(C=>{v===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),P.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Nv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),$v(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Nv)}},[u,f,n,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),$v())},[u,c]),P.useEffect(()=>{const C=()=>h({});return document.addEventListener(Gu,C),()=>document.removeEventListener(Gu,C)},[]),x.jsx(En.div,{...l,ref:m,style:{pointerEvents:g?T?"auto":"none":void 0,...e.style},onFocusCapture:qt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:qt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:qt(e.onPointerDownCapture,S.onPointerDownCapture)})});Fv.displayName=tD;var oD="DismissableLayerBranch",Vv=P.forwardRef((e,t)=>{const n=P.useContext(Lv),r=P.useRef(null),o=Lr(t,r);return P.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(En.div,{...e,ref:o})});Vv.displayName=oD;function sD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Rv(nD,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function iD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=P.useRef(!1);return P.useEffect(()=>{const o=s=>{s.target&&!r.current&&Rv(rD,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $v(){const e=new CustomEvent(Gu);document.dispatchEvent(e)}function Rv(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Mv(o,s):o.dispatchEvent(s)}var aD=Fv,lD=Vv,Pa=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},cD="Portal",Bv=P.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=P.useState(!1);Pa(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?xs.createPortal(x.jsx(En.div,{...r,ref:t}),i):null});Bv.displayName=cD;function uD(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var jv=e=>{const{present:t,children:n}=e,r=dD(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),s=Lr(r.ref,fD(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:s}):null};jv.displayName="Presence";function dD(e){const[t,n]=P.useState(),r=P.useRef({}),o=P.useRef(e),s=P.useRef("none"),i=e?"mounted":"unmounted",[a,l]=uD(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=ka(r.current);s.current=a==="mounted"?c:"none"},[a]),Pa(()=>{const c=r.current,u=o.current;if(u!==e){const f=s.current,h=ka(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Pa(()=>{if(t){const c=d=>{const h=ka(r.current).includes(d.animationName);d.target===t&&h&&Ss.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=ka(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ka(e){return(e==null?void 0:e.animationName)||"none"}function fD(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hD({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=pD({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=jn(n),l=P.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function pD({defaultProp:e,onChange:t}){const n=P.useState(e),[r]=n,o=P.useRef(r),s=jn(t);return P.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var mD="VisuallyHidden",Yu=P.forwardRef((e,t)=>x.jsx(En.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Yu.displayName=mD;var qu="ToastProvider",[Ku,gD,yD]=Q_("Toast"),[Wv,pB]=Dv("Toast",[yD]),[vD,Ia]=Wv(qu),zv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=P.useState(null),[c,u]=P.useState(0),d=P.useRef(!1),f=P.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qu}\`. Expected non-empty \`string\`.`),x.jsx(Ku.Provider,{scope:t,children:x.jsx(vD,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:P.useCallback(()=>u(h=>h+1),[]),onToastRemove:P.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};zv.displayName=qu;var Hv="ToastViewport",bD=["F8"],Zu="toast.viewportPause",Xu="toast.viewportResume",Uv=P.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=bD,label:o="Notifications ({hotkey})",...s}=e,i=Ia(Hv,n),a=gD(n),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),f=Lr(t,d,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;P.useEffect(()=>{const y=b=>{var g;r.every(T=>b[T]||b.code===T)&&((g=d.current)==null||g.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),P.useEffect(()=>{const y=l.current,b=d.current;if(m&&y&&b){const v=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(Zu);b.dispatchEvent(E),i.isClosePausedRef.current=!0}},g=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Xu);b.dispatchEvent(E),i.isClosePausedRef.current=!1}},T=E=>{!y.contains(E.relatedTarget)&&g()},S=()=>{y.contains(document.activeElement)||g()};return y.addEventListener("focusin",v),y.addEventListener("focusout",T),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",S),window.addEventListener("blur",v),window.addEventListener("focus",g),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",T),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",v),window.removeEventListener("focus",g)}}},[m,i.isClosePausedRef]);const p=P.useCallback(({tabbingDirection:y})=>{const v=a().map(g=>{const T=g.ref.current,S=[T,...MD(T)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return P.useEffect(()=>{const y=d.current;if(y){const b=v=>{var S,E,C;const g=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!g){const I=document.activeElement,A=v.shiftKey;if(v.target===y&&A){(S=c.current)==null||S.focus();return}const _=p({tabbingDirection:A?"backwards":"forwards"}),V=_.findIndex(k=>k===I);ed(_.slice(V+1))?v.preventDefault():A?(E=c.current)==null||E.focus():(C=u.current)==null||C.focus()}};return y.addEventListener("keydown",b),()=>y.removeEventListener("keydown",b)}},[a,p]),x.jsxs(lD,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&x.jsx(Qu,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ed(y)}}),x.jsx(Ku.Slot,{scope:n,children:x.jsx(En.ol,{tabIndex:-1,...s,ref:f})}),m&&x.jsx(Qu,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ed(y)}})]})});Uv.displayName=Hv;var Gv="ToastFocusProxy",Qu=P.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Ia(Gv,n);return x.jsx(Yu,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Qu.displayName=Gv;var Aa="Toast",wD="toast.swipeStart",xD="toast.swipeMove",SD="toast.swipeCancel",TD="toast.swipeEnd",Yv=P.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,l]=hD({prop:r,defaultProp:o,onChange:s});return x.jsx(jv,{present:n||a,children:x.jsx(PD,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:jn(e.onPause),onResume:jn(e.onResume),onSwipeStart:qt(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qt(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:qt(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:qt(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Yv.displayName=Aa;var[ED,CD]=Wv(Aa,{onClose(){}}),PD=P.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...m}=e,p=Ia(Aa,n),[y,b]=P.useState(null),v=Lr(t,k=>b(k)),g=P.useRef(null),T=P.useRef(null),S=o||p.duration,E=P.useRef(0),C=P.useRef(S),I=P.useRef(0),{onToastAdd:A,onToastRemove:O}=p,F=jn(()=>{var M;(y==null?void 0:y.contains(document.activeElement))&&((M=p.viewport)==null||M.focus()),i()}),_=P.useCallback(k=>{!k||k===1/0||(window.clearTimeout(I.current),E.current=new Date().getTime(),I.current=window.setTimeout(F,k))},[F]);P.useEffect(()=>{const k=p.viewport;if(k){const M=()=>{_(C.current),c==null||c()},L=()=>{const N=new Date().getTime()-E.current;C.current=C.current-N,window.clearTimeout(I.current),l==null||l()};return k.addEventListener(Zu,L),k.addEventListener(Xu,M),()=>{k.removeEventListener(Zu,L),k.removeEventListener(Xu,M)}}},[p.viewport,S,l,c,_]),P.useEffect(()=>{s&&!p.isClosePausedRef.current&&_(S)},[s,S,p.isClosePausedRef,_]),P.useEffect(()=>(A(),()=>O()),[A,O]);const V=P.useMemo(()=>y?Jv(y):null,[y]);return p.viewport?x.jsxs(x.Fragment,{children:[V&&x.jsx(kD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),x.jsx(ED,{scope:n,onClose:F,children:Ss.createPortal(x.jsx(Ku.ItemSlot,{scope:n,children:x.jsx(aD,{asChild:!0,onEscapeKeyDown:qt(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||F(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(En.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qt(e.onKeyDown,k=>{k.key==="Escape"&&(a==null||a(k.nativeEvent),k.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:qt(e.onPointerDown,k=>{k.button===0&&(g.current={x:k.clientX,y:k.clientY})}),onPointerMove:qt(e.onPointerMove,k=>{if(!g.current)return;const M=k.clientX-g.current.x,L=k.clientY-g.current.y,N=!!T.current,R=["left","right"].includes(p.swipeDirection),z=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,D=R?z(0,M):0,B=R?0:z(0,L),Z=k.pointerType==="touch"?10:2,oe={x:D,y:B},te={originalEvent:k,delta:oe};N?(T.current=oe,Oa(xD,d,te,{discrete:!1})):eb(oe,p.swipeDirection,Z)?(T.current=oe,Oa(wD,u,te,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(M)>Z||Math.abs(L)>Z)&&(g.current=null)}),onPointerUp:qt(e.onPointerUp,k=>{const M=T.current,L=k.target;if(L.hasPointerCapture(k.pointerId)&&L.releasePointerCapture(k.pointerId),T.current=null,g.current=null,M){const N=k.currentTarget,R={originalEvent:k,delta:M};eb(M,p.swipeDirection,p.swipeThreshold)?Oa(TD,h,R,{discrete:!0}):Oa(SD,f,R,{discrete:!0}),N.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),kD=e=>{const{__scopeToast:t,children:n,...r}=e,o=Ia(Aa,t),[s,i]=P.useState(!1),[a,l]=P.useState(!1);return _D(()=>i(!0)),P.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:x.jsx(Bv,{asChild:!0,children:x.jsx(Yu,{...r,children:s&&x.jsxs(x.Fragment,{children:[o.label," ",n]})})})},ID="ToastTitle",qv=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(En.div,{...r,ref:t})});qv.displayName=ID;var AD="ToastDescription",Kv=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(En.div,{...r,ref:t})});Kv.displayName=AD;var Zv="ToastAction",OD=P.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?x.jsx(Qv,{altText:n,asChild:!0,children:x.jsx(Ju,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Zv}\`. Expected non-empty \`string\`.`),null)});OD.displayName=Zv;var Xv="ToastClose",Ju=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=CD(Xv,n);return x.jsx(Qv,{asChild:!0,children:x.jsx(En.button,{type:"button",...r,ref:t,onClick:qt(e.onClick,o.onClose)})})});Ju.displayName=Xv;var Qv=P.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return x.jsx(En.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Jv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),DD(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Jv(r))}}),t}function Oa(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Mv(o,s):o.dispatchEvent(s)}var eb=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function _D(e=()=>{}){const t=jn(e);Pa(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function DD(e){return e.nodeType===e.ELEMENT_NODE}function MD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ed(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var ND=zv,LD=Uv,FD=Yv,VD=qv,$D=Kv,RD=Ju;const BD=e=>{const[t,n]=w.useState(!1),r=()=>n(!0),o=()=>n(!1);return w.useEffect(()=>{const s=e.current;if(s)return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",o),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",o)}},[]),t},jD=po("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-sm supports-[backdrop-filter]:backdrop-blur-xl",{variants:{theme:{warn:"bg-warn-notification/90 text-warn-hover border-warn/50",info:"bg-info-notification supports-[backdrop-filter]:bg-info-notification/50 supports-[backdrop-filter]:bg-info/20 text-info border-info/50",danger:"bg-danger-notification supports-[backdrop-filter]:bg-danger-notification/60 text-danger border-danger/50",success:"bg-success-notification supports-[backdrop-filter]:bg-success-notification/50 text-success border-success/50",default:"border-card-border bg-card-background text-foreground"}},defaultVariants:{theme:"default"}}),tb=w.createContext(()=>{throw new Error("Not implemented")}),WD=()=>w.useContext(tb),nb={0:{opacity:1,y:[10,15],scale:[1,.98]},1:{opacity:1,y:[15,20],scale:[1,.97]},2:{opacity:1,y:[20,25],scale:[1,.96]},default:{opacity:1,y:[25,30],scale:[1,.95]}},zD=w.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,s=t.hover?"hover":t.isLast?"isLast":"other",i=jD({theme:t.theme||"default"});return x.jsx(FD,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:x.jsx(at.li,{layout:!0,layoutScroll:!0,animate:s,"data-index":t.index,initial:{y:-100,zIndex:-1},className:"text-select pointer-events-auto absolute right-0 top-0 w-80",variants:{isLast:{y:10,scale:1,animationDuration:"300ms",opacity:1},hover:{y:0,position:"static",scale:1,opacity:1},other:nb[t.reversedIndex]||nb.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:x.jsxs("div",{className:i,children:[x.jsxs("div",{className:"flex flex-col p-4",children:[t.title?x.jsx(VD,{className:"select-text truncate text-lg font-medium leading-relaxed",children:"Title"}):null,x.jsx($D,{className:"select-text truncate",children:t.text})]}),r?x.jsx(RD,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:x.jsx(Cu,{className:"h-5 w-5"})}):null]})})})});function HD({children:e,max:t=5,duration:n=5e3}){const r=w.useRef(null),o=BD(r),[s,i]=w.useState([]),a=w.useCallback(()=>i([]),[]);w.useEffect(()=>()=>a(),[a]);const l=w.useCallback((c,u)=>{const d=window.crypto.randomUUID();return i(h=>{const m=[...h,{...u,id:d,text:c}];return m.length>t?m.slice(m.length-t,m.length+1):m}),{clear:a,close:()=>i(h=>h.filter(m=>m.id!==d))}},[t]);return x.jsxs(ND,{duration:n,swipeThreshold:150,children:[x.jsx(tb.Provider,{value:l,children:e}),x.jsx(er,{presenceAffectsLayout:!0,mode:"popLayout",children:s.map((c,u,d)=>{const f=()=>i(h=>h.filter(m=>m.id!==c.id));return w.createElement(zD,{...c,key:c.id,hover:o,index:u,onClose:f,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})}),x.jsx(LD,{ref:r,"data-items":s.length,style:{justifyContent:"start",height:`${(o?s.length:Math.min(1,s.length))*7}rem`},className:"fixed right-4 top-10 flex w-80 list-none flex-col-reverse items-end gap-4 overflow-y-clip overflow-x-visible data-[items=true]:pb-8 max-sm:top-20"})]})}const UD=e=>x.jsxs("div",{className:"divide-y divide-card-border bg-card-background shadow border border-card-border rounded-card",children:[x.jsxs("header",{className:"p-6 items-start flex gap-4",children:[x.jsx("div",{className:Me("size-10 p-8 rounded-card flex items-center justify-center aspect-square bg-primary",e.iconContainer),children:x.jsx("div",{children:x.jsx(e.Icon,{className:"size-10 aspect-square text-primary-foreground"})})}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("header",{children:x.jsx("h3",{className:"text-base leading-none",children:e.title})}),x.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?x.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),rb=(e,t)=>{const[n,r]=w.useState(()=>t||e);return w.useEffect(()=>{r(e)},[e]),[n,r]},ob=w.createContext(""),GD=e=>{const[t,n]=rb(e.active),r=_r(0),o=_r(0),s=w.useRef(null),i=e.useHash?"a":"button";w.useEffect(()=>{const u=s.current;if(u===null)return;const d=p=>{if(!p)return;const y=p.getBoundingClientRect();o.set(y.width),r.set(p.offsetLeft)},f=()=>{const p=u.querySelector("li[data-active=true]");return void d(p)};window.addEventListener("resize",f);let h=u.querySelector("li[data-active=true]");const m=window.location.hash.replace(/^#/,"");if(e.active===""&&m!==""&&(h=u.querySelector(`li[data-id="${m}"]`),n(m)),h===null){h=u.querySelector("li[data-id]");const p=h.getAttribute("data-id")||"";n(p)}return d(h),()=>window.removeEventListener("resize",f)},[]);const a=up(e.onChange);w.useEffect(()=>{a.current&&a.current(t)},[a,t]);const l=w.Children.toArray(e.children),c=u=>{const d=u.currentTarget,f=d.getBoundingClientRect();o.set(f.width),r.set(d.offsetLeft),n(d.dataset.id||"")};return x.jsx(ob.Provider,{value:t,children:x.jsx(Av,{className:e.className,container:"pt-0 max-w-full w-full min-w-0",header:x.jsx("header",{ref:s,className:"relative mb-2 overflow-x-auto border-b border-card-border",children:x.jsx("nav",{className:"min-w-0",children:x.jsx("ul",{className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:l.map(u=>{const d=u.props;return x.jsx("li",{"data-id":d.id,"data-active":t===d.id,className:"w-full border-b-2 transition-all border-card-border data-[active=true]:border-primary data-[active=true]:text-primary",children:x.jsx(i,{"data-id":d.id,onClick:c,"aria-current":"page",href:e.useHash?`#${d.id}`:void 0,className:"block w-full whitespace-nowrap px-10 py-4",children:d.title})},`tab-header-${d.id}`)})})})}),children:e.children})})},YD=()=>w.useContext(ob),qD=e=>{const t=YD();return x.jsx(w.Fragment,{children:e.id===t?e.children:null})};function sr(e){return sb(e)?(e.nodeName||"").toLowerCase():"#document"}function Rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wn(e){var t;return(t=(sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sb(e){return e instanceof Node||e instanceof Rt(e).Node}function Ge(e){return e instanceof Element||e instanceof Rt(e).Element}function gt(e){return e instanceof HTMLElement||e instanceof Rt(e).HTMLElement}function td(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rt(e).ShadowRoot}function oi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function KD(e){return["table","td","th"].includes(sr(e))}function _a(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function nd(e){const t=rd(),n=Ge(e)?Kt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZD(e){let t=zn(e);for(;gt(t)&&!ir(t);){if(nd(t))return t;if(_a(t))return null;t=zn(t)}return null}function rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ir(e){return["html","body","#document"].includes(sr(e))}function Kt(e){return Rt(e).getComputedStyle(e)}function Da(e){return Ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zn(e){if(sr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||td(e)&&e.host||Wn(e);return td(t)?t.host:t}function ib(e){const t=zn(e);return ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&oi(t)?t:ib(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ib(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Rt(o);if(s){const a=od(i);return t.concat(i,i.visualViewport||[],oi(o)?o:[],a&&n?ar(a):[])}return t.concat(o,ar(o,[],n))}function od(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function un(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function ct(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&td(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function sd(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ab(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function lb(e){return e.mozInputSource===0&&e.isTrusted?!0:ld()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function id(e){return XD()?!1:!ld()&&e.width===0&&e.height===0||ld()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ad(){return/apple/i.test(navigator.vendor)}function ld(){const e=/android/i;return e.test(sd())||e.test(ab())}function cb(){return sd().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function XD(){return ab().includes("jsdom/")}function $o(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function QD(e){return"nativeEvent"in e}function JD(e){return e.matches("html,body")}function Et(e){return(e==null?void 0:e.ownerDocument)||document}function cd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Cn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const eM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ud(e){return gt(e)&&e.matches(eM)}function It(e){e.preventDefault(),e.stopPropagation()}function ub(e){return e?e.getAttribute("role")==="combobox"&&ud(e):!1}const Pn=Math.min,Zt=Math.max,Ma=Math.round,Ro=Math.floor,lr=e=>({x:e,y:e}),tM={left:"right",right:"left",bottom:"top",top:"bottom"},nM={start:"end",end:"start"};function dd(e,t,n){return Zt(e,Pn(t,n))}function Bo(e,t){return typeof e=="function"?e(t):e}function cr(e){return e.split("-")[0]}function jo(e){return e.split("-")[1]}function db(e){return e==="x"?"y":"x"}function fd(e){return e==="y"?"height":"width"}function Fr(e){return["top","bottom"].includes(cr(e))?"y":"x"}function hd(e){return db(Fr(e))}function rM(e,t,n){n===void 0&&(n=!1);const r=jo(e),o=hd(e),s=fd(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Na(i)),[i,Na(i)]}function oM(e){const t=Na(e);return[pd(e),t,pd(t)]}function pd(e){return e.replace(/start|end/g,t=>nM[t])}function sM(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function iM(e,t,n,r){const o=jo(e);let s=sM(cr(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(pd)))),s}function Na(e){return e.replace(/left|right|bottom|top/g,t=>tM[t])}function aM(e){return{top:0,right:0,bottom:0,left:0,...e}}function fb(e){return typeof e!="number"?aM(e):{top:e,right:e,bottom:e,left:e}}function La(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
169
+ */var gv;function C_(){return gv||(gv=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=hv();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,f,h,m){var p=s(null),v;p.current===null?(v={hasValue:!1,value:null},p.current=v):v=p.current;var b=a(function(){var S=!1,E,C,I=function(_){if(!S){S=!0,E=_;var V=h(_);if(m!==void 0&&v.hasValue){var k=v.value;if(m(k,V))return C=k,k}return C=V,V}var M=E,F=C;if(r(M,_))return F;var N=h(_);return m!==void 0&&m(F,N)?F:(E=_,C=N,N)},A=f===void 0?null:f,O=function(){return I(d())},L=A===null?void 0:function(){return I(A())};return[O,L]},[d,f,h,m]),y=b[0],g=b[1],T=o(u,y,g);return i(function(){v.hasValue=!0,v.value=T},[T]),l(T),T}mv.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mv}process.env.NODE_ENV==="production"?E_():C_();const Lo=e=>{const t=w.useRef(e??{});return w.useEffect(()=>void(t.current=e),[e]),t},P_=e=>{const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current},k_=e=>Object.entries(e),yv=e=>e instanceof Promise,vv=(e,t,n,r)=>t===e?n.reduce((o,s)=>s(o,t,r),e):e.constructor.name===Object.name?n.reduce((o,s)=>s(o,t,r),{...t,...e}):n.reduce((o,s)=>s(o,t,r),e),I_=(e,t,n,r,o,s)=>(...i)=>{const a=performance.now(),l=t(...i),c=(u,d)=>n(f=>vv(u,f,s,d));return yv(l)?l.then(u=>{o.current={method:e,props:r(),time:performance.now()-a},c(u,o.current)}):(o.current={method:e,props:r(),time:performance.now()-a},void c(l,o.current))},A_=(e,t,n,r,o,s)=>(...i)=>{o.current={method:e,time:0,props:r()};const a=t(...i),l=c=>n(u=>vv(c,u,s,o.current));return yv(a)?a.then(c=>l(c)):l(a)},ju=(e,t,n)=>{const[r,o]=w.useState(()=>e),s=Lo(r),i=Lo((n==null?void 0:n.props)??{}),a=Lo(t),l=Lo((n==null?void 0:n.postMiddleware)??[]),c=Lo((n==null?void 0:n.interceptor)??[]),u=w.useRef(e),d=P_(r),f=Lo(d),h=w.useRef(null);w.useEffect(()=>{if(h.current===null)return;const p=h.current;l.current.forEach(v=>{v(r,d,p)})},[r,l,d]);const[m]=w.useState(()=>{const p=()=>i.current,v=a.current({props:p,state:()=>s.current,initialState:u.current,previousState:()=>f.current});return k_(v).reduce((b,[y,g])=>({...b,[y]:n!=null&&n.debug?I_(y,g,o,p,h,c.current):A_(y,g,o,p,h,c.current)}),{})});return[r,m,i.current]},O_=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function __(e,t){return w.useRef(O_(e,t)).current}const Ca={cssVariable:(e,t,n)=>`var(--${n})`,rgba:e=>`rgba(${e})`,rgb:e=>`rgb(${e})`,hsl:e=>`hsl(${e})`,hsla:e=>`hsla(${e})`,hex:e=>e,raw:e=>e,formatWithVar:e=>(t,n,r)=>`${e}(var(--${r}), <alpha-value>)`},Fo=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return o.concat(t(i,l,a))}return o.concat(Fo(i,t,n,a))},[]),bv=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return{...o,[l]:t(i,s,a)}}return{...o,[s]:bv(i,t,n,a)}},{}),wv={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},Pa=(e,t)=>{const n=t.value||((o,s)=>s),r=e.map(o=>`${o.key}: ${n(o.key,o.value)}`).join(";");return t.result(r)},D_={default:e=>Pa(e,{result:wv.default}),dark:e=>Pa(e,{result:wv.dark})},Wu=(e,t)=>{const n=a=>(l,c,u)=>{const d={key:`--${u}`,value:`${l}`};return a?a(d):d},r=Fo(e.colors,n(t==null?void 0:t.colors)),o=Fo(e.spacing,n(t==null?void 0:t.spacing)),s=Fo(e.rounded,n(t==null?void 0:t.rounded)),i=e.custom?Fo(e.custom,n(t==null?void 0:t.customTokens)):[];return r.concat(o,s,i)},M_=(e,t)=>Pa(Wu(e),{result:n=>`html${t?`.${t}`:""} {${n}}`,value:(n,r)=>r.replace("hsla(","").replace(")","")}),N_=(e,t)=>Wu(e,t).reduce((r,o)=>({...r,[o.key]:o.value}),{}),L_=(e,t)=>Pa(Wu(e,t),{result:n=>`html${t!=null&&t.name?`.${t.name}`:""} {${n}}`,value:(n,r)=>r}),xv={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},Sv={base:"1rem",lg:"1.5rem",sm:"0.75rem","input-height":"2.5rem","input-x":"0.5rem","input-y":"0.25rem","input-inline":"0.25rem","input-gap":"0.3rem"},F_={name:"dark",rounded:xv,spacing:Sv,shadow:{floating:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px"},colors:{foreground:"hsla(210, 50%, 98%)",background:"hsla(0, 0%, 9%)",muted:"hsla(0, 0%, 12%)",disabled:"hsla(240, 4%, 33%)",emphasis:{foreground:"hsla(251, 91%, 95%)",DEFAULT:"hsla(255, 92%, 76%)",subtle:"hsla(252, 95%, 85%)",hover:"hsla(262, 83%, 58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(200,98%,39%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{DEFAULT:"hsla(210, 32%, 70%)",background:"hsla(210, 30%, 81%)",subtle:"hsla(210, 27%, 88%)",hover:"hsla(210, 10%, 58%)",foreground:"hsla(210, 20%, 30%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 93%, 77%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(219, 91%, 59%)"},warn:{DEFAULT:"hsla(27, 96%, 61%)",subtle:"hsla(45, 95%, 66%)",hover:"hsla(21, 90%, 48%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(32, 65%, 75%)"},danger:{DEFAULT:"hsla(358, 65%, 57%)",subtle:"hsla(0, 94%, 81%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(358, 40%, 23%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 75%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 50%)",notification:"hsla(161,62%,17%)"},input:{border:"hsla(240, 4%, 25%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 9%)",switch:"hsla(0, 0%, 100%)"},card:{muted:"hsla(0, 0%, 22%)",border:"hsla(240, 7%, 27%)",background:"hsla(0, 0%, 15%)"},floating:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 14%)",hover:"hsla(221, 10%, 22%)",border:"hsla(240, 7%, 27%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 8%)",hover:"hsla(221, 10%, 35%)",border:"hsla(0, 0%, 19%)",overlay:"hsla(0, 0%, 0%)"},table:{header:"hsla(0, 0%, 12%)",border:"hsla(240, 4%, 33%)",background:"hsla(0, 0%, 15%)"},button:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,90%)",bg:"hsla(5,62%,23%)"},muted:{text:"hsla(0, 100%, 100%)",bg:"hsla(0, 0%, 12%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,79%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"},muted:{text:"hsla(0, 100%, 100%)",bg:"hsla(0, 0%, 12%)"}},alert:{primary:{text:"hsla(210,100%,72%)",border:"hsla(212,69%,16%)",bg:"hsla(215,42%,9%)"},warn:{bg:"hsla(28,33%,9%)",border:"hsla(29,65%,12%)",text:"hsla(27,100%,78%)"},info:{text:"hsla(253,100%,83%)",bg:"hsla(263,28%,11%)",border:"hsla(252,34%,51%)"},success:{text:"hsla(144,79%,79%)",bg:"hsla(153,20%,9%)",border:"hsla(144,70%,14%)"},danger:{text:"hsla(350,100%,91%)",bg:"hsla(355,25%,15%)",border:"hsla(355,25%,10%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(220,9%,94%)",bg:"hsla(220,6%,10%)",border:"hsla(214,7%,19%)"},muted:{bg:"hsla(0, 0%, 12%)",border:"hsla(0, 0%, 40%)",text:"hsla(0, 100%, 100%)"}}}},V_={rounded:xv,spacing:Sv,name:"light",shadow:{floating:"rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px"},colors:{foreground:"hsla(217, 15%, 30%)",background:"hsla(210, 34%, 96%)",muted:"hsla(210, 30%, 86%)",disabled:"hsla(240, 10%, 78%)",emphasis:{foreground:"hsla(251,91%,95%)",DEFAULT:"hsla(255,92%,76%)",subtle:"hsla(252,95%,85%)",hover:"hsla(262,83%,58%)"},primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(199, 89%, 54%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{background:"hsla(210, 25%, 35%)",DEFAULT:"hsla(210, 25%, 35%)",subtle:"hsla(207, 29%, 39%)",hover:"hsla(210, 21%, 67%)",foreground:"hsla(210, 40%, 98%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 70%, 90%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(219, 91%, 59%)"},danger:{DEFAULT:"hsla(0, 82%, 63%)",subtle:"hsla(0, 96%, 95%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(0, 100%, 87%)"},warn:{DEFAULT:"hsla(27, 100%, 70%)",subtle:"hsla(45, 95%, 80%)",hover:"hsla(29, 85%, 50%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(27, 85%, 92%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 90%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 17%)",notification:"hsla(160, 75%, 80%)"},input:{border:"hsla(218, 22%, 85%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 45%)",switch:"hsla(0, 0%, 100%)"},card:{muted:"hsla(210, 25%, 94%)",border:"hsla(210, 25%, 88%)",background:"hsla(0, 0%, 100%)"},floating:{foreground:"hsla(217, 15%, 20%)",background:"hsla(0, 0%, 100%)",hover:"hsla(0, 0%, 92%)",border:"hsla(210, 25%, 88%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(217, 15%, 20%)",background:"hsla(210, 25%, 98%)",hover:"hsla(210, 25%, 92%)",border:"hsla(200, 1%, 80%)",overlay:"hsla(0, 0%, 0%)"},table:{header:"hsla(221, 10%, 90%)",background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},button:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 10%, 15%)"},primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,96%,48%)"},warn:{bg:"hsla(26,90%,60%)",text:"hsla(0, 0%, 100%)"},info:{text:"hsla(0, 0%, 100%)",bg:"hsla(210,60%,60%)"},success:{text:"hsla(0, 0%, 100%)",bg:"hsla(152,56%,39%)"},danger:{text:"hsla(0, 0%, 100%)",bg:"hsla(10,78%,54%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 30%, 86%)"},primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,70%,55%)"},warn:{bg:"hsla(30,100%,82%)",text:"hsla(23,100%,40%)"},info:{text:"hsla(196,100%,20%)",bg:"hsla(197,65%,80%)"},success:{text:"hsla(154,52%,19%)",bg:"hsla(152,56%,80%)"},danger:{text:"hsla(10,82%,45%)",bg:"hsla(359,94%,92%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},alert:{muted:{bg:"hsla(210, 30%, 86%)",text:"hsla(210, 30%, 86%)",border:"hsla(210, 10%, 70%)"},primary:{text:"hsla(206,70%,50%)",border:"hsla(206,90%,89%)",bg:"hsla(205,92%,95%)"},warn:{bg:"hsla(23,100%,96%)",text:"hsla(23,93%,53%)",border:"hsla(33,100%,85%)"},info:{text:"hsla(252,56%,57%)",bg:"hsla(256,100%,95%)",border:"hsla(252,76%,84%)"},success:{text:"hsla(152,56%,39%)",bg:"hsla(139,47%,93%)",border:"hsla(152,58%,78%)"},danger:{text:"hsla(358,69%,55%)",bg:"hsla(357,90%,96%)",border:"hsla(359,100%,90%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(216,10%,10%)",bg:"hsla(214,7%,92%)",border:"hsla(216,22%,78%)"}}}},$_=F_,R_=V_,zu={emptyDataMessage:"No data",inputCaretDown:"Click to see all options",inputCloseValue:"Click to clear the value",datePickerCalendarButtonLabel:"Click to open a date picker",inputOptionalLabel:"Optional",autocompleteEmpty:"Nothing here...",tableGroupLabel:"Group",tableGroupLabelWithCount:"Group",tableSortAsc:"Ascending",tableSortOrderByLabel:"Order by",tableSortOrderInputPlaceholder:"Order by",tableSortOrderInputTitle:"Order by",tableSortTypeInputPlaceholder:"Ascending",tableSortTypeInputTitle:"Sort type",tableSortAddButton:"Add sort",tableSortDropdownTitle:"Order by",tableSortDesc:"Descending",tableColumnResizer:"Resize column",tableFilterTypeContains:"Contains",tableFilterTypeIs:"Is",tableFilterTypeIsNot:"Is not",tableFilterTypeNotContains:"Not contains",tableFilterTypeLessThan:"Less than",tableFilterTypeGreaterThan:"Greater than",tableFilterTypeStartsWith:"Starts with",tableFilterTypeEndsWith:"Ends with",tableFilterNewFilter:"New filter",tableFilterColumnTitle:"Filter by",tableFilterColumnPlaceholder:"Filter by",tableFilterOperatorTitle:"Operation",tableFilterOperatorPlaceholder:"Equals to...",tableFilterValueTitle:"Value",tableFilterValuePlaceholder:"Something...",tableFilterLabel:"Filters",tableFilterDropdownTitle:"Filters",tableFilterDropdownTitleUnique:"Filter by",tablePaginationPrevious:"Previous",tablePaginationNext:"Next",tablePaginationSelectLabel:"Select the size of page",tablePaginationFooter:e=>x.jsxs(w.Fragment,{children:[e.current," to ",e.pages," of ",e.totalItems," items.",Array.isArray(e.sizes)?e.select:null," per page."]}),calendarFromDate:"From",calendarToDate:"To",calendarToday:"Today",calendarBackMonth:"Back month",calendarNextMonth:"Next month",multiComboboxSelectedLabel:"Selected",multiComboboxInnerPlaceholder:"Search..."},Hu={input:{iconFeedback:!0}},oi=w.createContext({tweaks:Hu,parser:Ca.hsla,map:zu,locale:void 0}),B_=e=>{const t=w.useMemo(()=>({locale:e.locale,tweaks:{...Hu,...e.tweaks},parser:e.parser||Ca.hsla,map:{...zu,...e.map}}),[e]);return x.jsx(oi.Provider,{value:t,children:e.children})},Uu=e=>{if(e)return e;const t=w.useContext(oi);if(t)return t.locale||e},Tt=()=>{const e=w.useContext(oi);return e?e.map:zu},j_=()=>{const e=w.useContext(oi);return e?e.parser:Ca.hsla},W_=()=>{const e=w.useContext(oi);return e?e.tweaks:Hu},z_={type:"spring",bounce:.3,duration:.6},Tv=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),Ev={middle:{x:"0%",opacity:1},enter:Tv(1),exit:Tv(-1)},Cv={exit:{visibility:"hidden"}},H_=e=>{const t=xn(Ly(e));return Ny({start:t,end:_o(t,41)})},Pv=(e,t)=>e.toLocaleDateString(t,{month:"long"}),U_=(e,t,n)=>Array.from({length:12}).map((r,o)=>{const s=Ly(new Date(1970,o,1).setMonth(o)),i=Pv(s,n);return x.jsx("option",{value:i,"data-index":o,children:i},`${e}-${i}`)}),Gu={ArrowLeft:(e,t)=>t==="days"?n_(e,1):Zy(e,1),ArrowRight:(e,t)=>t==="days"?_o(e,1):ya(e,1),ArrowUp:(e,t)=>t==="days"?r_(e,1):o_(e,1),ArrowDown:(e,t)=>t==="days"?_y(e,1):Dy(e,1)},kv=(e,t,n,r=0)=>{const o=n.toISOString(),s=()=>{var i;if(e!=null&&e.dataset.focustrap){const a=(i=t.current)==null?void 0:i.querySelector(`button[data-focustrap="${e==null?void 0:e.dataset.focustrap}"]`);return setTimeout(()=>a==null?void 0:a.focus({preventScroll:!1}),r)}if(t.current){const a=t.current.querySelector(`button[data-date="${o}"]`);if(a)return a.focus({preventScroll:!1})}};r===0&&s(),setTimeout(s,r)},Nr=e=>e.getFullYear().toString().padStart(4,"0"),G_=(e,t,n)=>e===void 0||n===void 0?!1:rO(t,e)&&oO(t,n),Y_=e=>{var n;const t=Tt();return x.jsx(at.tbody,{layout:!0,variants:Ev,custom:e.direction,onKeyDown:e.onKeyDown,className:Me((n=e.styles)==null?void 0:n.week),children:e.zip.map((r,o)=>{var s;return x.jsx("tr",{className:(s=e.styles)==null?void 0:s.week,children:r.map(i=>{var h,m,p,v,b,y,g,T,S,E,C,I,A,O;const a=i.toISOString(),l=e.rangeMode?a===((m=(h=e.range)==null?void 0:h.to)==null?void 0:m.toISOString())||a===((v=(p=e.range)==null?void 0:p.from)==null?void 0:v.toISOString()):a===((b=e.date)==null?void 0:b.toISOString()),c=t_(i)&&e.markToday,u=((y=e.disabledDate)==null?void 0:y.call(e,i))||!1,d=!e_(i,e.stateDate)||u,f=e.rangeMode?G_((g=e.range)==null?void 0:g.from,i,(T=e.range)==null?void 0:T.to):!1;return x.jsxs("td",{align:"center",className:Me("relative",(S=e.styles)==null?void 0:S.dayFrame),children:[x.jsxs("button",{type:"button","data-date":a,disabled:u,"data-range":e.rangeMode,onClick:e.dispatch.onSelectDate,"data-view":e.stateDate.getMonth().toString(),className:Me(`flex size-10 items-center justify-center rounded-full proportional-nums disabled:cursor-not-allowed ${c?"text-emphasis":""} ${d?"text-disabled":""} ${l?"bg-primary text-primary-foreground":""}`,(E=e.styles)==null?void 0:E.day,f&&e.markRange?"size-10 border border-dashed border-card-border":""),children:[i.getDate(),l&&((C=e.stateRange.from)==null?void 0:C.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((I=e.labelRange)==null?void 0:I.from)??t.calendarFromDate})}):null,l&&((A=e.stateRange.to)==null?void 0:A.toISOString())===a?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:((O=e.labelRange)==null?void 0:O.to)??t.calendarToDate})}):null]}),e.RenderOnDay?x.jsx(e.RenderOnDay,{date:i}):null]},a)})},`week-${r.length}-${o}`)})})},Iv=({RenderOnDay:e,changeOnlyOnClick:t=!1,labelRange:n,disabledDate:r,locale:o,markToday:s=!0,onChangeMonth:i,onChangeYear:a,rangeMode:l=!1,onChange:c,styles:u,markRange:d=!0,...f})=>{const h=w.useRef(_s()),m=Tt(),p=Uu(o),v=w.useRef(null),{date:b,range:y}=f,g=b||new Date,T=w.useRef(null),[S,E]=ju({date:g,isAnimating:!1,year:Nr(g),direction:void 0,range:{from:y==null?void 0:y.from,to:y==null?void 0:y.to},months:U_(h.current,g,p),selectMode:l?"from":void 0,week:Ny({start:xn(g),end:uA(g)})},_=>({onChangeYear:V=>({year:V}),setToday:()=>({date:Mo(new Date)}),onExitComplete:()=>(kv(T.current||null,v,_.state().date,200),T.current=null,{isAnimating:!1}),date:V=>{const k=V(_.state().date);return{date:k,year:Nr(k)}},nextMonth:V=>{T.current=V.currentTarget;const k=_.state();if(k.isAnimating)return k;const M=ya(k.date,1);return{date:M,isAnimating:!0,direction:1,year:Nr(M)}},previousMonth:V=>{T.current=V.currentTarget;const k=_.state();if(k.isAnimating)return k;const M=Zy(k.date,1);return{date:M,isAnimating:!0,direction:-1,year:Nr(M)}},onSelectDate:V=>{const k=_.state(),M=V.currentTarget.dataset.range==="true",F=V.currentTarget.dataset.date||"",N=new Date(F);return{date:N,year:Nr(N),selectMode:k.selectMode===void 0?void 0:k.selectMode==="from"?"to":"from",range:M?{from:k.selectMode==="from"?N:k.range.from,to:k.selectMode==="to"?N:k.range.to}:k.range}},onChangeMonth:V=>{const k=V.target.value,F=Array.from(V.target.options).find(R=>R.value===k),N=_.state();if(F){const R=F.dataset.index||"",z=new Date(_.state().date);return z.setMonth(+R),{...N,date:z,year:Nr(z)}}return N},onKeyDown:V=>{const k=V.key,M=_.state();if(k in Gu){(k==="ArrowUp"||k==="ArrowDown")&&V.preventDefault();const F=_.state().date,N=Pt.keyof(Gu,k)?Gu[k](F,V.shiftKey?"month":"days"):null;if(N!==null)return kv(V.target,v,N),{...M,date:N,year:Nr(N)}}return _.state()}}),{props:{onChangeMonth:i,onChangeYear:a},postMiddleware:[(_,V,k)=>{var F,N;return(k.method==="onChangeMonth"||k.method==="previousMonth"||k.method==="nextMonth")&&((N=(F=k.props).onChangeMonth)==null||N.call(F,_.date)),_},(_,V,k)=>{var F,N;return k.method==="onChangeYear"&&((N=(F=k.props).onChangeYear)==null||N.call(F,_.date)),_},(_,V,k)=>{const M=k.method==="onSelectDate"||k.method==="setToday"||k.method==="onKeyDown";return l&&M&&t?(c==null||c(_.range),_):(M&&t&&(c==null||c(_.date)),_)}]}),C=ap(H_(S.date),7),I=S.date.toISOString(),A=Pv(S.date,p);w.useEffect(()=>{t||c==null||c(S.date)},[I]);const O=__(_=>{E.date(V=>{const k=new Date(V);return k.setFullYear(+_),k})},1200),L=_=>{const V=_.currentTarget.value;E.onChangeYear(V),a==null||a(new Date(V)),O(V)};return x.jsx(GT,{transition:z_,children:x.jsxs("div",{"data-component":"calendar",ref:v,className:Me("relative overflow-hidden",u==null?void 0:u.calendar),children:[x.jsx("div",{className:"flex flex-col justify-center rounded text-center",children:x.jsx(er,{initial:!1,mode:"popLayout",custom:S.direction,onExitComplete:E.onExitComplete,children:x.jsxs(at.div,{initial:"enter",animate:"middle",exit:"exit",children:[x.jsxs("header",{className:"relative flex justify-between",children:[x.jsx(at.button,{layout:!0,type:"button","data-focustrap":"prev",variants:Cv,onClick:E.previousMonth,title:m.calendarBackMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground",children:x.jsx(jI,{className:"h-4 w-4"})}),x.jsx(at.span,{layout:!0,variants:Ev,custom:S.direction,className:"absolute inset-0 isolate z-normal flex items-center justify-center font-semibold",children:x.jsxs("span",{className:"flex w-fit items-center justify-center gap-0.5 py-1",children:[x.jsx("select",{value:A,onChange:E.onChangeMonth,style:{width:`${A.length+1}ch`},className:"cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:S.months}),x.jsx(lv,{mask:"int",maxLength:4,placeholder:"YYYY",value:S.year,onChange:L,style:{width:`${S.year.length}ch`},className:"w-16 cursor-pointer appearance-none bg-transparent hover:text-primary"})]})}),x.jsx(at.button,{layout:!0,type:"button","data-focustrap":"next",variants:Cv,onClick:E.nextMonth,title:m.calendarNextMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground",children:x.jsx(Cu,{className:"h-4 w-4"})}),x.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)"}})]}),x.jsxs(at.table,{className:"mt-2 table min-w-full table-auto border-0",children:[x.jsx("thead",{children:x.jsx("tr",{children:S.week.map(_=>x.jsx("th",{className:Me("py-2 text-sm font-medium capitalize",u==null?void 0:u.weekDay),children:_.toLocaleDateString(p,{weekday:"short"})},_.toString()))})}),x.jsx(Y_,{zip:C,range:y,styles:u,date:b||null,dispatch:E,markRange:d,markToday:s,rangeMode:l,stateDate:S.date,labelRange:n,stateRange:S.range,RenderOnDay:e,direction:S.direction,disabledDate:r,onKeyDown:E.onKeyDown})]})]},A)})}),x.jsx("footer",{className:"mt-2 text-center text-primary",children:x.jsx("button",{className:"transition-transform duration-300 hover:scale-105",type:"button",onClick:E.setToday,children:m.calendarToday})})]})})},Av=({children:e,title:t,titleClassName:n="",as:r="div",container:o="",header:s=null,className:i="",...a})=>x.jsxs(mo,{...a,as:r,"data-componen":"card",className:Me("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow",o),children:[t?x.jsx("header",{className:Me("mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium",n),children:t}):s,x.jsx("div",{className:Me("min-w-full px-8",i),children:e})]}),Ov=e=>{const t=e.Icon??Cy,n=Tt();return x.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-4 px-8 py-12",children:[x.jsx(t,{size:64,className:"text-disabled"}),x.jsx("p",{className:"text-disabled",children:n.emptyDataMessage})]})};function qt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function q_(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _v(...e){return t=>e.forEach(n=>q_(n,t))}function Lr(...e){return P.useCallback(_v(...e),e)}function Dv(e,t=[]){let n=[];function r(s,i){const a=P.createContext(i),l=n.length;n=[...n,i];function c(d){const{scope:f,children:h,...m}=d,p=(f==null?void 0:f[e][l])||a,v=P.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:v,children:h})}function u(d,f){const h=(f==null?void 0:f[e][l])||a,m=P.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const o=()=>{const s=n.map(i=>P.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,K_(o,...t)]}function K_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Vo=P.forwardRef((e,t)=>{const{children:n,...r}=e,o=P.Children.toArray(n),s=o.find(X_);if(s){const i=s.props.children,a=o.map(l=>l===s?P.Children.count(i)>1?P.Children.only(null):P.isValidElement(i)?i.props.children:null:l);return x.jsx(Yu,{...r,ref:t,children:P.isValidElement(i)?P.cloneElement(i,void 0,a):null})}return x.jsx(Yu,{...r,ref:t,children:n})});Vo.displayName="Slot";var Yu=P.forwardRef((e,t)=>{const{children:n,...r}=e;if(P.isValidElement(n)){const o=J_(n);return P.cloneElement(n,{...Q_(r,n.props),ref:t?_v(t,o):o})}return P.Children.count(n)>1?P.Children.only(null):null});Yu.displayName="SlotClone";var Z_=({children:e})=>x.jsx(x.Fragment,{children:e});function X_(e){return P.isValidElement(e)&&e.type===Z_}function Q_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function J_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function eD(e){const t=e+"CollectionProvider",[n,r]=Dv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:m,children:p}=h,v=w.useRef(null),b=w.useRef(new Map).current;return x.jsx(o,{scope:m,itemMap:b,collectionRef:v,children:p})};i.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((h,m)=>{const{scope:p,children:v}=h,b=s(a,p),y=Lr(m,b.collectionRef);return x.jsx(Vo,{ref:y,children:v})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((h,m)=>{const{scope:p,children:v,...b}=h,y=w.useRef(null),g=Lr(m,y),T=s(c,p);return w.useEffect(()=>(T.itemMap.set(y,{ref:y,...b}),()=>void T.itemMap.delete(y))),x.jsx(Vo,{[u]:"",ref:g,children:v})});d.displayName=c;function f(h){const m=s(e+"CollectionConsumer",h);return w.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const b=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((T,S)=>b.indexOf(T.ref.current)-b.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:l,ItemSlot:d},f,r]}var tD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],En=tD.reduce((e,t)=>{const n=P.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Vo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Mv(e,t){e&&Ss.flushSync(()=>e.dispatchEvent(t))}function jn(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e);P.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rD="DismissableLayer",qu="dismissableLayer.update",oD="dismissableLayer.pointerDownOutside",sD="dismissableLayer.focusOutside",Nv,Lv=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fv=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=P.useContext(Lv),[u,d]=P.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),m=Lr(t,C=>d(C)),p=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(v),y=u?p.indexOf(u):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,T=y>=b,S=aD(C=>{const I=C.target,A=[...c.branches].some(O=>O.contains(I));!T||A||(o==null||o(C),i==null||i(C),C.defaultPrevented||a==null||a())},f),E=lD(C=>{const I=C.target;[...c.branches].some(O=>O.contains(I))||(s==null||s(C),i==null||i(C),C.defaultPrevented||a==null||a())},f);return nD(C=>{y===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),P.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Nv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),$v(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Nv)}},[u,f,n,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),$v())},[u,c]),P.useEffect(()=>{const C=()=>h({});return document.addEventListener(qu,C),()=>document.removeEventListener(qu,C)},[]),x.jsx(En.div,{...l,ref:m,style:{pointerEvents:g?T?"auto":"none":void 0,...e.style},onFocusCapture:qt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:qt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:qt(e.onPointerDownCapture,S.onPointerDownCapture)})});Fv.displayName=rD;var iD="DismissableLayerBranch",Vv=P.forwardRef((e,t)=>{const n=P.useContext(Lv),r=P.useRef(null),o=Lr(t,r);return P.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(En.div,{...e,ref:o})});Vv.displayName=iD;function aD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Rv(oD,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lD(e,t=globalThis==null?void 0:globalThis.document){const n=jn(e),r=P.useRef(!1);return P.useEffect(()=>{const o=s=>{s.target&&!r.current&&Rv(sD,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $v(){const e=new CustomEvent(qu);document.dispatchEvent(e)}function Rv(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Mv(o,s):o.dispatchEvent(s)}var cD=Fv,uD=Vv,ka=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},dD="Portal",Bv=P.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=P.useState(!1);ka(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?xs.createPortal(x.jsx(En.div,{...r,ref:t}),i):null});Bv.displayName=dD;function fD(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var jv=e=>{const{present:t,children:n}=e,r=hD(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),s=Lr(r.ref,pD(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:s}):null};jv.displayName="Presence";function hD(e){const[t,n]=P.useState(),r=P.useRef({}),o=P.useRef(e),s=P.useRef("none"),i=e?"mounted":"unmounted",[a,l]=fD(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=Ia(r.current);s.current=a==="mounted"?c:"none"},[a]),ka(()=>{const c=r.current,u=o.current;if(u!==e){const f=s.current,h=Ia(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ka(()=>{if(t){const c=d=>{const h=Ia(r.current).includes(d.animationName);d.target===t&&h&&Ss.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=Ia(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ia(e){return(e==null?void 0:e.animationName)||"none"}function pD(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mD({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=gD({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=jn(n),l=P.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function gD({defaultProp:e,onChange:t}){const n=P.useState(e),[r]=n,o=P.useRef(r),s=jn(t);return P.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var yD="VisuallyHidden",Ku=P.forwardRef((e,t)=>x.jsx(En.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ku.displayName=yD;var Zu="ToastProvider",[Xu,vD,bD]=eD("Toast"),[Wv,mB]=Dv("Toast",[bD]),[wD,Aa]=Wv(Zu),zv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=P.useState(null),[c,u]=P.useState(0),d=P.useRef(!1),f=P.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Zu}\`. Expected non-empty \`string\`.`),x.jsx(Xu.Provider,{scope:t,children:x.jsx(wD,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:P.useCallback(()=>u(h=>h+1),[]),onToastRemove:P.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};zv.displayName=Zu;var Hv="ToastViewport",xD=["F8"],Qu="toast.viewportPause",Ju="toast.viewportResume",Uv=P.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=xD,label:o="Notifications ({hotkey})",...s}=e,i=Aa(Hv,n),a=vD(n),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),f=Lr(t,d,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;P.useEffect(()=>{const v=b=>{var g;r.every(T=>b[T]||b.code===T)&&((g=d.current)==null||g.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),P.useEffect(()=>{const v=l.current,b=d.current;if(m&&v&&b){const y=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(Qu);b.dispatchEvent(E),i.isClosePausedRef.current=!0}},g=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Ju);b.dispatchEvent(E),i.isClosePausedRef.current=!1}},T=E=>{!v.contains(E.relatedTarget)&&g()},S=()=>{v.contains(document.activeElement)||g()};return v.addEventListener("focusin",y),v.addEventListener("focusout",T),v.addEventListener("pointermove",y),v.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",g),()=>{v.removeEventListener("focusin",y),v.removeEventListener("focusout",T),v.removeEventListener("pointermove",y),v.removeEventListener("pointerleave",S),window.removeEventListener("blur",y),window.removeEventListener("focus",g)}}},[m,i.isClosePausedRef]);const p=P.useCallback(({tabbingDirection:v})=>{const y=a().map(g=>{const T=g.ref.current,S=[T,...LD(T)];return v==="forwards"?S:S.reverse()});return(v==="forwards"?y.reverse():y).flat()},[a]);return P.useEffect(()=>{const v=d.current;if(v){const b=y=>{var S,E,C;const g=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!g){const I=document.activeElement,A=y.shiftKey;if(y.target===v&&A){(S=c.current)==null||S.focus();return}const _=p({tabbingDirection:A?"backwards":"forwards"}),V=_.findIndex(k=>k===I);nd(_.slice(V+1))?y.preventDefault():A?(E=c.current)==null||E.focus():(C=u.current)==null||C.focus()}};return v.addEventListener("keydown",b),()=>v.removeEventListener("keydown",b)}},[a,p]),x.jsxs(uD,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&x.jsx(ed,{ref:c,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"forwards"});nd(v)}}),x.jsx(Xu.Slot,{scope:n,children:x.jsx(En.ol,{tabIndex:-1,...s,ref:f})}),m&&x.jsx(ed,{ref:u,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"backwards"});nd(v)}})]})});Uv.displayName=Hv;var Gv="ToastFocusProxy",ed=P.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Aa(Gv,n);return x.jsx(Ku,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});ed.displayName=Gv;var Oa="Toast",SD="toast.swipeStart",TD="toast.swipeMove",ED="toast.swipeCancel",CD="toast.swipeEnd",Yv=P.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,l]=mD({prop:r,defaultProp:o,onChange:s});return x.jsx(jv,{present:n||a,children:x.jsx(ID,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:jn(e.onPause),onResume:jn(e.onResume),onSwipeStart:qt(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qt(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:qt(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:qt(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Yv.displayName=Oa;var[PD,kD]=Wv(Oa,{onClose(){}}),ID=P.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...m}=e,p=Aa(Oa,n),[v,b]=P.useState(null),y=Lr(t,k=>b(k)),g=P.useRef(null),T=P.useRef(null),S=o||p.duration,E=P.useRef(0),C=P.useRef(S),I=P.useRef(0),{onToastAdd:A,onToastRemove:O}=p,L=jn(()=>{var M;(v==null?void 0:v.contains(document.activeElement))&&((M=p.viewport)==null||M.focus()),i()}),_=P.useCallback(k=>{!k||k===1/0||(window.clearTimeout(I.current),E.current=new Date().getTime(),I.current=window.setTimeout(L,k))},[L]);P.useEffect(()=>{const k=p.viewport;if(k){const M=()=>{_(C.current),c==null||c()},F=()=>{const N=new Date().getTime()-E.current;C.current=C.current-N,window.clearTimeout(I.current),l==null||l()};return k.addEventListener(Qu,F),k.addEventListener(Ju,M),()=>{k.removeEventListener(Qu,F),k.removeEventListener(Ju,M)}}},[p.viewport,S,l,c,_]),P.useEffect(()=>{s&&!p.isClosePausedRef.current&&_(S)},[s,S,p.isClosePausedRef,_]),P.useEffect(()=>(A(),()=>O()),[A,O]);const V=P.useMemo(()=>v?Jv(v):null,[v]);return p.viewport?x.jsxs(x.Fragment,{children:[V&&x.jsx(AD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),x.jsx(PD,{scope:n,onClose:L,children:Ss.createPortal(x.jsx(Xu.ItemSlot,{scope:n,children:x.jsx(cD,{asChild:!0,onEscapeKeyDown:qt(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||L(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(En.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qt(e.onKeyDown,k=>{k.key==="Escape"&&(a==null||a(k.nativeEvent),k.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:qt(e.onPointerDown,k=>{k.button===0&&(g.current={x:k.clientX,y:k.clientY})}),onPointerMove:qt(e.onPointerMove,k=>{if(!g.current)return;const M=k.clientX-g.current.x,F=k.clientY-g.current.y,N=!!T.current,R=["left","right"].includes(p.swipeDirection),z=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,D=R?z(0,M):0,B=R?0:z(0,F),Z=k.pointerType==="touch"?10:2,oe={x:D,y:B},te={originalEvent:k,delta:oe};N?(T.current=oe,_a(TD,d,te,{discrete:!1})):eb(oe,p.swipeDirection,Z)?(T.current=oe,_a(SD,u,te,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(M)>Z||Math.abs(F)>Z)&&(g.current=null)}),onPointerUp:qt(e.onPointerUp,k=>{const M=T.current,F=k.target;if(F.hasPointerCapture(k.pointerId)&&F.releasePointerCapture(k.pointerId),T.current=null,g.current=null,M){const N=k.currentTarget,R={originalEvent:k,delta:M};eb(M,p.swipeDirection,p.swipeThreshold)?_a(CD,h,R,{discrete:!0}):_a(ED,f,R,{discrete:!0}),N.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),AD=e=>{const{__scopeToast:t,children:n,...r}=e,o=Aa(Oa,t),[s,i]=P.useState(!1),[a,l]=P.useState(!1);return MD(()=>i(!0)),P.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:x.jsx(Bv,{asChild:!0,children:x.jsx(Ku,{...r,children:s&&x.jsxs(x.Fragment,{children:[o.label," ",n]})})})},OD="ToastTitle",qv=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(En.div,{...r,ref:t})});qv.displayName=OD;var _D="ToastDescription",Kv=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(En.div,{...r,ref:t})});Kv.displayName=_D;var Zv="ToastAction",DD=P.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?x.jsx(Qv,{altText:n,asChild:!0,children:x.jsx(td,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Zv}\`. Expected non-empty \`string\`.`),null)});DD.displayName=Zv;var Xv="ToastClose",td=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=kD(Xv,n);return x.jsx(Qv,{asChild:!0,children:x.jsx(En.button,{type:"button",...r,ref:t,onClick:qt(e.onClick,o.onClose)})})});td.displayName=Xv;var Qv=P.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return x.jsx(En.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Jv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),ND(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Jv(r))}}),t}function _a(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Mv(o,s):o.dispatchEvent(s)}var eb=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function MD(e=()=>{}){const t=jn(e);ka(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function ND(e){return e.nodeType===e.ELEMENT_NODE}function LD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var FD=zv,VD=Uv,$D=Yv,RD=qv,BD=Kv,jD=td;const WD=e=>{const[t,n]=w.useState(!1),r=()=>n(!0),o=()=>n(!1);return w.useEffect(()=>{const s=e.current;if(s)return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",o),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",o)}},[]),t},zD=po("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-sm supports-[backdrop-filter]:backdrop-blur-xl",{variants:{theme:{warn:"bg-warn-notification/90 text-warn-hover border-warn/50",info:"bg-info-notification supports-[backdrop-filter]:bg-info-notification/50 supports-[backdrop-filter]:bg-info/20 text-info border-info/50",danger:"bg-danger-notification supports-[backdrop-filter]:bg-danger-notification/60 text-danger border-danger/50",success:"bg-success-notification supports-[backdrop-filter]:bg-success-notification/50 text-success border-success/50",default:"border-card-border bg-card-background text-foreground"}},defaultVariants:{theme:"default"}}),tb=w.createContext(()=>{throw new Error("Not implemented")}),HD=()=>w.useContext(tb),nb={0:{opacity:1,y:[10,15],scale:[1,.98]},1:{opacity:1,y:[15,20],scale:[1,.97]},2:{opacity:1,y:[20,25],scale:[1,.96]},default:{opacity:1,y:[25,30],scale:[1,.95]}},UD=w.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,s=t.hover?"hover":t.isLast?"isLast":"other",i=zD({theme:t.theme||"default"});return x.jsx($D,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:x.jsx(at.li,{layout:!0,layoutScroll:!0,animate:s,"data-index":t.index,initial:{y:-100,zIndex:-1},className:"text-select pointer-events-auto absolute right-0 top-0 w-80",variants:{isLast:{y:10,scale:1,animationDuration:"300ms",opacity:1},hover:{y:0,position:"static",scale:1,opacity:1},other:nb[t.reversedIndex]||nb.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:x.jsxs("div",{className:i,children:[x.jsxs("div",{className:"flex flex-col p-4",children:[t.title?x.jsx(RD,{className:"select-text truncate text-lg font-medium leading-relaxed",children:"Title"}):null,x.jsx(BD,{className:"select-text truncate",children:t.text})]}),r?x.jsx(jD,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:x.jsx(ku,{className:"h-5 w-5"})}):null]})})})});function GD({children:e,max:t=5,duration:n=5e3}){const r=w.useRef(null),o=WD(r),[s,i]=w.useState([]),a=w.useCallback(()=>i([]),[]);w.useEffect(()=>()=>a(),[a]);const l=w.useCallback((c,u)=>{const d=window.crypto.randomUUID();return i(h=>{const m=[...h,{...u,id:d,text:c}];return m.length>t?m.slice(m.length-t,m.length+1):m}),{clear:a,close:()=>i(h=>h.filter(m=>m.id!==d))}},[t]);return x.jsxs(FD,{duration:n,swipeThreshold:150,children:[x.jsx(tb.Provider,{value:l,children:e}),x.jsx(er,{presenceAffectsLayout:!0,mode:"popLayout",children:s.map((c,u,d)=>{const f=()=>i(h=>h.filter(m=>m.id!==c.id));return w.createElement(UD,{...c,key:c.id,hover:o,index:u,onClose:f,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})}),x.jsx(VD,{ref:r,"data-items":s.length,style:{justifyContent:"start",height:`${(o?s.length:Math.min(1,s.length))*7}rem`},className:"fixed right-4 top-10 flex w-80 list-none flex-col-reverse items-end gap-4 overflow-y-clip overflow-x-visible data-[items=true]:pb-8 max-sm:top-20"})]})}const YD=e=>x.jsxs("div",{className:"divide-y divide-card-border bg-card-background shadow border border-card-border rounded-card",children:[x.jsxs("header",{className:"p-6 items-start flex gap-4",children:[x.jsx("div",{className:Me("size-10 p-8 rounded-card flex items-center justify-center aspect-square bg-primary",e.iconContainer),children:x.jsx("div",{children:x.jsx(e.Icon,{className:"size-10 aspect-square text-primary-foreground"})})}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("header",{children:x.jsx("h3",{className:"text-base leading-none",children:e.title})}),x.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?x.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),rb=(e,t)=>{const[n,r]=w.useState(()=>t||e);return w.useEffect(()=>{r(e)},[e]),[n,r]},ob=w.createContext(""),qD=e=>{const[t,n]=rb(e.active),r=_r(0),o=_r(0),s=w.useRef(null),i=e.useHash?"a":"button";w.useEffect(()=>{const u=s.current;if(u===null)return;const d=p=>{if(!p)return;const v=p.getBoundingClientRect();o.set(v.width),r.set(p.offsetLeft)},f=()=>{const p=u.querySelector("li[data-active=true]");return void d(p)};window.addEventListener("resize",f);let h=u.querySelector("li[data-active=true]");const m=window.location.hash.replace(/^#/,"");if(e.active===""&&m!==""&&(h=u.querySelector(`li[data-id="${m}"]`),n(m)),h===null){h=u.querySelector("li[data-id]");const p=h.getAttribute("data-id")||"";n(p)}return d(h),()=>window.removeEventListener("resize",f)},[]);const a=Ds(e.onChange);w.useEffect(()=>{a.current&&a.current(t)},[a,t]);const l=w.Children.toArray(e.children),c=u=>{const d=u.currentTarget,f=d.getBoundingClientRect();o.set(f.width),r.set(d.offsetLeft),n(d.dataset.id||"")};return x.jsx(ob.Provider,{value:t,children:x.jsx(Av,{className:e.className,container:"pt-0 max-w-full w-full min-w-0",header:x.jsx("header",{ref:s,className:"relative mb-2 overflow-x-auto border-b border-card-border",children:x.jsx("nav",{className:"min-w-0",children:x.jsx("ul",{className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:l.map(u=>{const d=u.props;return x.jsx("li",{"data-id":d.id,"data-active":t===d.id,className:"w-full border-b-2 transition-all border-card-border data-[active=true]:border-primary data-[active=true]:text-primary",children:x.jsx(i,{"data-id":d.id,onClick:c,"aria-current":"page",href:e.useHash?`#${d.id}`:void 0,className:"block w-full whitespace-nowrap px-10 py-4",children:d.title})},`tab-header-${d.id}`)})})})}),children:e.children})})},KD=()=>w.useContext(ob),ZD=e=>{const t=KD();return x.jsx(w.Fragment,{children:e.id===t?e.children:null})};function sr(e){return sb(e)?(e.nodeName||"").toLowerCase():"#document"}function Rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wn(e){var t;return(t=(sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sb(e){return e instanceof Node||e instanceof Rt(e).Node}function Ge(e){return e instanceof Element||e instanceof Rt(e).Element}function gt(e){return e instanceof HTMLElement||e instanceof Rt(e).HTMLElement}function rd(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rt(e).ShadowRoot}function si(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function XD(e){return["table","td","th"].includes(sr(e))}function Da(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function od(e){const t=sd(),n=Ge(e)?Kt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function QD(e){let t=zn(e);for(;gt(t)&&!ir(t);){if(od(t))return t;if(Da(t))return null;t=zn(t)}return null}function sd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ir(e){return["html","body","#document"].includes(sr(e))}function Kt(e){return Rt(e).getComputedStyle(e)}function Ma(e){return Ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zn(e){if(sr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rd(e)&&e.host||Wn(e);return rd(t)?t.host:t}function ib(e){const t=zn(e);return ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&si(t)?t:ib(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ib(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Rt(o);if(s){const a=id(i);return t.concat(i,i.visualViewport||[],si(o)?o:[],a&&n?ar(a):[])}return t.concat(o,ar(o,[],n))}function id(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function un(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function ct(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rd(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ad(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ab(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function lb(e){return e.mozInputSource===0&&e.isTrusted?!0:ud()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ld(e){return JD()?!1:!ud()&&e.width===0&&e.height===0||ud()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function cd(){return/apple/i.test(navigator.vendor)}function ud(){const e=/android/i;return e.test(ad())||e.test(ab())}function cb(){return ad().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function JD(){return ab().includes("jsdom/")}function $o(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function eM(e){return"nativeEvent"in e}function tM(e){return e.matches("html,body")}function Et(e){return(e==null?void 0:e.ownerDocument)||document}function dd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Cn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const nM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fd(e){return gt(e)&&e.matches(nM)}function It(e){e.preventDefault(),e.stopPropagation()}function ub(e){return e?e.getAttribute("role")==="combobox"&&fd(e):!1}const Pn=Math.min,Zt=Math.max,Na=Math.round,Ro=Math.floor,lr=e=>({x:e,y:e}),rM={left:"right",right:"left",bottom:"top",top:"bottom"},oM={start:"end",end:"start"};function hd(e,t,n){return Zt(e,Pn(t,n))}function Bo(e,t){return typeof e=="function"?e(t):e}function cr(e){return e.split("-")[0]}function jo(e){return e.split("-")[1]}function db(e){return e==="x"?"y":"x"}function pd(e){return e==="y"?"height":"width"}function Fr(e){return["top","bottom"].includes(cr(e))?"y":"x"}function md(e){return db(Fr(e))}function sM(e,t,n){n===void 0&&(n=!1);const r=jo(e),o=md(e),s=pd(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=La(i)),[i,La(i)]}function iM(e){const t=La(e);return[gd(e),t,gd(t)]}function gd(e){return e.replace(/start|end/g,t=>oM[t])}function aM(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function lM(e,t,n,r){const o=jo(e);let s=aM(cr(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(gd)))),s}function La(e){return e.replace(/left|right|bottom|top/g,t=>rM[t])}function cM(e){return{top:0,right:0,bottom:0,left:0,...e}}function fb(e){return typeof e!="number"?cM(e):{top:e,right:e,bottom:e,left:e}}function Fa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
170
170
  * tabbable 6.2.0
171
171
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
172
- */var lM=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Fa=lM.join(","),hb=typeof Element>"u",Wo=hb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Va=!hb&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},$a=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},cM=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},uM=function(t,n,r){if($a(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Fa));return n&&Wo.call(t,Fa)&&o.unshift(t),o=o.filter(r),o},dM=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!$a(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Wo.call(i,Fa);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!$a(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&f){var h=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},pb=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},mb=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||cM(t))&&!pb(t)?0:t.tabIndex},fM=function(t,n){var r=mb(t);return r<0&&n&&!pb(t)?0:r},hM=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},gb=function(t){return t.tagName==="INPUT"},pM=function(t){return gb(t)&&t.type==="hidden"},mM=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},gM=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},yM=function(t){if(!t.name)return!0;var n=t.form||Va(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=gM(o,t.form);return!s||s===t},vM=function(t){return gb(t)&&t.type==="radio"},bM=function(t){return vM(t)&&!yM(t)},wM=function(t){var n,r=t&&Va(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=Va(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},yb=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},xM=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Wo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Wo.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=Va(t);if(l&&!l.shadowRoot&&o(l)===!0)return yb(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(wM(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return yb(t);return!1},SM=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Wo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},TM=function(t,n){return!(n.disabled||$a(n)||pM(n)||xM(n,t)||mM(n)||SM(n))},md=function(t,n){return!(bM(n)||mb(n)<0||!TM(t,n))},EM=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},CM=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=fM(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(hM).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},si=function(t,n){n=n||{};var r;return n.getShadowRoot?r=dM([t],n.includeContainer,{filter:md.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:EM}):r=uM(t,n.includeContainer,md.bind(null,n)),CM(r)},PM=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Wo.call(t,Fa)===!1?!1:md(n,t)};function vb(e,t,n){let{reference:r,floating:o}=e;const s=Fr(t),i=hd(t),a=fd(i),l=cr(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(jo(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const kM=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=vb(c,r,l),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:y,fn:b}=a[p],{x:v,y:g,data:T,reset:S}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=g??d,h={...h,[y]:{...h[y],...T}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=vb(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function gd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bo(t,e),m=fb(h),y=a[f?d==="floating"?"reference":"floating":d],b=La(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(g))?await(s.getScale==null?void 0:s.getScale(g))||{x:1,y:1}:{x:1,y:1},S=La(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:g,strategy:l}):v);return{top:(b.top-S.top+m.top)/T.y,bottom:(S.bottom-b.bottom+m.bottom)/T.y,left:(b.left-S.left+m.left)/T.x,right:(S.right-b.right+m.right)/T.x}}const IM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Bo(e,t)||{};if(c==null)return{};const d=fb(u),f={x:n,y:r},h=hd(o),m=fd(h),p=await i.getDimensions(c),y=h==="y",b=y?"top":"left",v=y?"bottom":"right",g=y?"clientHeight":"clientWidth",T=s.reference[m]+s.reference[h]-f[h]-s.floating[m],S=f[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let C=E?E[g]:0;(!C||!await(i.isElement==null?void 0:i.isElement(E)))&&(C=a.floating[g]||s.floating[m]);const I=T/2-S/2,A=C/2-p[m]/2-1,O=Pn(d[b],A),F=Pn(d[v],A),_=O,V=C-p[m]-F,k=C/2-p[m]/2+I,M=dd(_,k,V),L=!l.arrow&&jo(o)!=null&&k!==M&&s.reference[m]/2-(k<_?O:F)-p[m]/2<0,N=L?k<_?k-_:k-V:0;return{[h]:f[h]+N,data:{[h]:M,centerOffset:k-M-N,...L&&{alignmentOffset:N}},reset:L}}}),AM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Bo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=cr(o),v=Fr(a),g=cr(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(g||!p?[Na(a)]:oM(a)),E=m!=="none";!f&&E&&S.push(...iM(a,p,m,T));const C=[a,...S],I=await gd(t,y),A=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(I[b]),d){const k=rM(o,i,T);A.push(I[k[0]],I[k[1]])}if(O=[...O,{placement:o,overflows:A}],!A.every(k=>k<=0)){var F,_;const k=(((F=s.flip)==null?void 0:F.index)||0)+1,M=C[k];if(M)return{data:{index:k,overflows:O},reset:{placement:M}};let L=(_=O.filter(N=>N.overflows[0]<=0).sort((N,R)=>N.overflows[1]-R.overflows[1])[0])==null?void 0:_.placement;if(!L)switch(h){case"bestFit":{var V;const N=(V=O.filter(R=>{if(E){const z=Fr(R.placement);return z===v||z==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,D)=>z+D,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:V[0];N&&(L=N);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};async function OM(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=cr(n),a=jo(n),l=Fr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const _M=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await OM(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},DM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...l}=Bo(e,t),c={x:n,y:r},u=await gd(t,l),d=Fr(cr(o)),f=db(d);let h=c[f],m=c[d];if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=h+u[y],g=h-u[b];h=dd(v,h,g)}if(i){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=m+u[y],g=m-u[b];m=dd(v,m,g)}const p=a.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},MM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=Bo(e,t),l=await gd(t,a),c=cr(n),u=jo(n),d=Fr(n)==="y",{width:f,height:h}=r.floating;let m,p;c==="top"||c==="bottom"?(m=c,p=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(p=c,m=u==="end"?"top":"bottom");const y=h-l.top-l.bottom,b=f-l.left-l.right,v=Pn(h-l[m],y),g=Pn(f-l[p],b),T=!t.middlewareData.shift;let S=v,E=g;if(d?E=u||T?Pn(g,b):b:S=u||T?Pn(v,y):y,T&&!u){const I=Zt(l.left,0),A=Zt(l.right,0),O=Zt(l.top,0),F=Zt(l.bottom,0);d?E=f-2*(I!==0||A!==0?I+A:Zt(l.left,l.right)):S=h-2*(O!==0||F!==0?O+F:Zt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:S});const C=await o.getDimensions(s.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function bb(e){const t=Kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ma(n)!==s||Ma(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function yd(e){return Ge(e)?e:e.contextElement}function zo(e){const t=yd(e);if(!gt(t))return lr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=bb(t);let i=(s?Ma(n.width):n.width)/r,a=(s?Ma(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const NM=lr(0);function wb(e){const t=Rt(e);return!rd()||!t.visualViewport?NM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rt(e)?!1:t}function Vr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=yd(e);let i=lr(1);t&&(r?Ge(r)&&(i=zo(r)):i=zo(e));const a=LM(s,n,r)?wb(s):lr(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Rt(s),h=r&&Ge(r)?Rt(r):r;let m=f,p=od(m);for(;p&&r&&h!==m;){const y=zo(p),b=p.getBoundingClientRect(),v=Kt(p),g=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,T=b.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=g,c+=T,m=Rt(p),p=od(m)}}return La({width:u,height:d,x:l,y:c})}function FM(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Wn(r),a=t?_a(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=lr(1);const u=lr(0),d=gt(r);if((d||!d&&!s)&&((sr(r)!=="body"||oi(i))&&(l=Da(r)),gt(r))){const f=Vr(r);c=zo(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function VM(e){return Array.from(e.getClientRects())}function xb(e){return Vr(Wn(e)).left+Da(e).scrollLeft}function $M(e){const t=Wn(e),n=Da(e),r=e.ownerDocument.body,o=Zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+xb(e);const a=-n.scrollTop;return Kt(r).direction==="rtl"&&(i+=Zt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function RM(e,t){const n=Rt(e),r=Wn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=rd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function BM(e,t){const n=Vr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=gt(e)?zo(e):lr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Sb(e,t,n){let r;if(t==="viewport")r=RM(e,n);else if(t==="document")r=$M(Wn(e));else if(Ge(t))r=BM(t,n);else{const o=wb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return La(r)}function Tb(e,t){const n=zn(e);return n===t||!Ge(n)||ir(n)?!1:Kt(n).position==="fixed"||Tb(n,t)}function jM(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>Ge(a)&&sr(a)!=="body"),o=null;const s=Kt(e).position==="fixed";let i=s?zn(e):e;for(;Ge(i)&&!ir(i);){const a=Kt(i),l=nd(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||oi(i)&&!l&&Tb(e,i))?r=r.filter(u=>u!==i):o=a,i=zn(i)}return t.set(e,r),r}function WM(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?_a(t)?[]:jM(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Sb(t,u,o);return c.top=Zt(d.top,c.top),c.right=Pn(d.right,c.right),c.bottom=Pn(d.bottom,c.bottom),c.left=Zt(d.left,c.left),c},Sb(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zM(e){const{width:t,height:n}=bb(e);return{width:t,height:n}}function HM(e,t,n){const r=gt(t),o=Wn(t),s=n==="fixed",i=Vr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=lr(0);if(r||!r&&!s)if((sr(t)!=="body"||oi(o))&&(a=Da(t)),r){const d=Vr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=xb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function vd(e){return Kt(e).position==="static"}function Eb(e,t){return!gt(e)||Kt(e).position==="fixed"?null:t?t(e):e.offsetParent}function Cb(e,t){const n=Rt(e);if(_a(e))return n;if(!gt(e)){let o=zn(e);for(;o&&!ir(o);){if(Ge(o)&&!vd(o))return o;o=zn(o)}return n}let r=Eb(e,t);for(;r&&KD(r)&&vd(r);)r=Eb(r,t);return r&&ir(r)&&vd(r)&&!nd(r)?n:r||ZD(e)||n}const UM=async function(e){const t=this.getOffsetParent||Cb,n=this.getDimensions,r=await n(e.floating);return{reference:HM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GM(e){return Kt(e).direction==="rtl"}const YM={convertOffsetParentRelativeRectToViewportRelativeRect:FM,getDocumentElement:Wn,getClippingRect:WM,getOffsetParent:Cb,getElementRects:UM,getClientRects:VM,getDimensions:zM,getScale:zo,isElement:Ge,isRTL:GM};function qM(e,t){let n=null,r;const o=Wn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Ro(u),m=Ro(o.clientWidth-(c+d)),p=Ro(o.clientHeight-(u+f)),y=Ro(c),v={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:Zt(0,Pn(1,l))||1};let g=!0;function T(S){const E=S[0].intersectionRatio;if(E!==l){if(!g)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}g=!1}try{n=new IntersectionObserver(T,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,v)}n.observe(e)}return i(!0),s}function ii(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=yd(e),u=o||s?[...c?ar(c):[],...ar(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=c&&a?qM(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,p=l?Vr(e):null;l&&y();function y(){const b=Vr(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const KM=_M,ZM=DM,XM=AM,QM=MM,Pb=IM,JM=(e,t,n)=>{const r=new Map,o={platform:YM,...n},s={...o.platform,_c:r};return kM(e,t,{...o,platform:s})};var Ra=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ba(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ba(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ba(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function kb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ib(e,t){const n=kb(e);return Math.round(t*n)/n}function Ab(e){const t=P.useRef(e);return Ra(()=>{t.current=e}),t}function eN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=P.useState(r);Ba(f,r)||h(r);const[m,p]=P.useState(null),[y,b]=P.useState(null),v=P.useCallback(N=>{N!==E.current&&(E.current=N,p(N))},[]),g=P.useCallback(N=>{N!==C.current&&(C.current=N,b(N))},[]),T=s||m,S=i||y,E=P.useRef(null),C=P.useRef(null),I=P.useRef(u),A=l!=null,O=Ab(l),F=Ab(o),_=P.useCallback(()=>{if(!E.current||!C.current)return;const N={placement:t,strategy:n,middleware:f};F.current&&(N.platform=F.current),JM(E.current,C.current,N).then(R=>{const z={...R,isPositioned:!0};V.current&&!Ba(I.current,z)&&(I.current=z,Ss.flushSync(()=>{d(z)}))})},[f,t,n,F]);Ra(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[c]);const V=P.useRef(!1);Ra(()=>(V.current=!0,()=>{V.current=!1}),[]),Ra(()=>{if(T&&(E.current=T),S&&(C.current=S),T&&S){if(O.current)return O.current(T,S,_);_()}},[T,S,_,O,A]);const k=P.useMemo(()=>({reference:E,floating:C,setReference:v,setFloating:g}),[v,g]),M=P.useMemo(()=>({reference:T,floating:S}),[T,S]),L=P.useMemo(()=>{const N={position:n,left:0,top:0};if(!M.floating)return N;const R=Ib(M.floating,u.x),z=Ib(M.floating,u.y);return a?{...N,transform:"translate("+R+"px, "+z+"px)",...kb(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:z}},[n,a,M.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:_,refs:k,elements:M,floatingStyles:L}),[u,_,k,M,L])}const tN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pb({element:r.current,padding:o}).fn(n):{}:r?Pb({element:r,padding:o}).fn(n):{}}}},ai=(e,t)=>({...KM(e),options:[e,t]}),bd=(e,t)=>({...ZM(e),options:[e,t]}),wd=(e,t)=>({...XM(e),options:[e,t]}),Ob=(e,t)=>({...QM(e),options:[e,t]}),_b=(e,t)=>({...tN(e),options:[e,t]});function xd(e){return P.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Db={...P},nN=Db.useInsertionEffect||(e=>e());function bt(e){const t=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nN(()=>{t.current=e}),P.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Sd="ArrowUp",li="ArrowDown",Ho="ArrowLeft",Uo="ArrowRight";function ja(e,t,n){return Math.floor(e/t)!==n}function ci(e,t){return t<0||t>=e.current.length}function Td(e,t){return Nt(e,{disabledIndices:t})}function Mb(e,t){return Nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&Wa(i,a,o));return a}function rN(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Sd){if(u&&It(n),c===-1)d=l;else if(d=Nt(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const f=c%s,h=l%s,m=l-(h-f);h===f?d=l:d=h>f?m:m-s}ci(e,d)&&(d=c)}if(n.key===li&&(u&&It(n),c===-1?d=a:(d=Nt(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=Nt(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),ci(e,d)&&(d=c)),r==="both"){const f=Ro(c/s);n.key===Uo&&(u&&It(n),c%s!==s-1?(d=Nt(e,{startingIndex:c,disabledIndices:i}),o&&ja(d,s,f)&&(d=Nt(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=Nt(e,{startingIndex:c-c%s-1,disabledIndices:i})),ja(d,s,f)&&(d=c)),n.key===Ho&&(u&&It(n),c%s!==0?(d=Nt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&ja(d,s,f)&&(d=Nt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=Nt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),ja(d,s,f)&&(d=c));const h=Ro(l/s)===f;ci(e,d)&&(o&&h?d=n.key===Ho?l:Nt(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function oN(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let f=0;f<l;f++)u.push(o+d+f*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function sN(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function iN(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Wa(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let Nb=0;function ur(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Nb);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Nb=requestAnimationFrame(s)}var _e=typeof document<"u"?w.useLayoutEffect:w.useEffect;function aN(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function lN(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const Lb=P.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function cN(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=P.useState(()=>new Map),i=P.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=P.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return _e(()=>{const l=new Map(o);Array.from(l.keys()).sort(aN).forEach((u,d)=>{l.set(u,d)}),lN(o,l)||s(l)},[o]),P.createElement(Lb.Provider,{value:P.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Fb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=P.useContext(Lb),[a,l]=P.useState(null),c=P.useRef(null),u=P.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var f;const h=t!==void 0;i.current[a]=h?t:(f=d==null?void 0:d.textContent)!=null?f:null}},[a,s,i,t]);return _e(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),_e(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),P.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(this,arguments)}let Vb=!1,uN=0;const $b=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+uN++;function dN(){const[e,t]=P.useState(()=>Vb?$b():void 0);return _e(()=>{e==null&&t($b())},[]),P.useEffect(()=>{Vb=!0},[]),e}const Yo=Db.useId||dN;let ui;process.env.NODE_ENV!=="production"&&(ui=new Set);function za(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ui)!=null&&e.has(o))){var s;(s=ui)==null||s.add(o),console.warn(o)}}function fN(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ui)!=null&&e.has(o))){var s;(s=ui)==null||s.add(o),console.error(o)}}const Rb=P.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:f,style:{transform:h,...m}={},...p}=t;process.env.NODE_ENV!=="production"&&(n||za("The `ref` prop is required for `FloatingArrow`."));const y=Yo(),[b,v]=P.useState(!1);if(_e(()=>{if(!o)return;Kt(o).direction==="rtl"&&v(!0)},[o]),!o)return null;const g=c*2,T=g/2,S=i/2*(l/-8+1),E=a/2*l/4,[C,I]=r.split("-"),A=!!f,O=C==="top"||C==="bottom",F=u&&I==="end"?"bottom":"top";let _=u&&I==="end"?"right":"left";u&&b&&(_=I==="end"?"left":"right");const V=(s==null?void 0:s.x)!=null?u||s.x:"",k=(s==null?void 0:s.y)!=null?u||s.y:"",M=f||"M0,0"+(" H"+i)+(" L"+(i-S)+","+(a-E))+(" Q"+i/2+","+a+" "+S+","+(a-E))+" Z",L={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[C];return P.createElement("svg",Go({},p,{"aria-hidden":!0,ref:n,width:A?i:i+g,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[_]:V,[F]:k,[C]:O||A?"100%":"calc(100% - "+g/2+"px)",transform:""+L+(h??""),...m}}),g>0&&P.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:g+(f?0:1),d:M}),P.createElement("path",{stroke:g&&!f?p.fill:"none",d:M}),P.createElement("clipPath",{id:y},P.createElement("rect",{x:-T,y:T*(A?-1:1),width:i+g,height:i})))});function Bb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const jb=P.createContext(null),Wb=P.createContext(null),dr=()=>{var e;return((e=P.useContext(jb))==null?void 0:e.id)||null},fr=()=>P.useContext(Wb);function hN(e){const t=Yo(),n=fr(),o=dr();return _e(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function pN(e){const{children:t,id:n}=e,r=dr();return P.createElement(jb.Provider,{value:P.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function mN(e){const{children:t}=e,n=P.useRef([]),r=P.useCallback(i=>{n.current=[...n.current,i]},[]),o=P.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=P.useState(()=>Bb())[0];return P.createElement(Wb.Provider,{value:P.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function hr(e){return"data-floating-ui-"+e}function At(e){const t=w.useRef(e);return _e(()=>{t.current=e}),t}const zb=hr("safe-polygon");function Ed(e,t,n){return n&&!$o(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Hb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,h=fr(),m=dr(),p=At(c),y=At(l),b=At(n),v=P.useRef(),g=P.useRef(-1),T=P.useRef(),S=P.useRef(-1),E=P.useRef(!0),C=P.useRef(!1),I=P.useRef(()=>{}),A=P.useCallback(()=>{var M;const L=(M=o.current.openEvent)==null?void 0:M.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[o]);P.useEffect(()=>{if(!a)return;function M(L){let{open:N}=L;N||(clearTimeout(g.current),clearTimeout(S.current),E.current=!0)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[a,s]),P.useEffect(()=>{if(!a||!p.current||!n)return;function M(N){A()&&r(!1,N,"hover")}const L=Et(i.floating).documentElement;return L.addEventListener("mouseleave",M),()=>{L.removeEventListener("mouseleave",M)}},[i.floating,n,r,a,p,A]);const O=P.useCallback(function(M,L,N){L===void 0&&(L=!0),N===void 0&&(N="hover");const R=Ed(y.current,"close",v.current);R&&!T.current?(clearTimeout(g.current),g.current=window.setTimeout(()=>r(!1,M,N),R)):L&&(clearTimeout(g.current),r(!1,M,N))},[y,r]),F=bt(()=>{I.current(),T.current=void 0}),_=bt(()=>{if(C.current){const M=Et(i.floating).body;M.style.pointerEvents="",M.removeAttribute(zb),C.current=!1}});P.useEffect(()=>{if(!a)return;function M(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function L(D){if(clearTimeout(g.current),E.current=!1,u&&!$o(v.current)||d>0&&!Ed(y.current,"open"))return;const B=Ed(y.current,"open",v.current);B?g.current=window.setTimeout(()=>{b.current||r(!0,D,"hover")},B):r(!0,D,"hover")}function N(D){if(M())return;I.current();const B=Et(i.floating);if(clearTimeout(S.current),p.current&&o.current.floatingContext){n||clearTimeout(g.current),T.current=p.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){_(),F(),O(D,!0,"safe-polygon")}});const oe=T.current;B.addEventListener("mousemove",oe),I.current=()=>{B.removeEventListener("mousemove",oe)};return}(v.current==="touch"?!ct(i.floating,D.relatedTarget):!0)&&O(D)}function R(D){M()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){_(),F(),O(D)}})(D))}if(Ge(i.domReference)){var z;const D=i.domReference;return n&&D.addEventListener("mouseleave",R),(z=i.floating)==null||z.addEventListener("mouseleave",R),f&&D.addEventListener("mousemove",L,{once:!0}),D.addEventListener("mouseenter",L),D.addEventListener("mouseleave",N),()=>{var B;n&&D.removeEventListener("mouseleave",R),(B=i.floating)==null||B.removeEventListener("mouseleave",R),f&&D.removeEventListener("mousemove",L),D.removeEventListener("mouseenter",L),D.removeEventListener("mouseleave",N)}}},[i,a,e,u,d,f,O,F,_,r,n,b,h,y,p,o]),_e(()=>{var M;if(a&&n&&(M=p.current)!=null&&M.__options.blockPointerEvents&&A()){const N=Et(i.floating).body;N.setAttribute(zb,""),N.style.pointerEvents="none",C.current=!0;const R=i.floating;if(Ge(i.domReference)&&R){var L;const z=i.domReference,D=h==null||(L=h.nodesRef.current.find(B=>B.id===m))==null||(L=L.context)==null?void 0:L.elements.floating;return D&&(D.style.pointerEvents=""),z.style.pointerEvents="auto",R.style.pointerEvents="auto",()=>{z.style.pointerEvents="",R.style.pointerEvents=""}}}},[a,n,m,i,h,p,A]),_e(()=>{n||(v.current=void 0,F(),_())},[n,F,_]),P.useEffect(()=>()=>{F(),clearTimeout(g.current),clearTimeout(S.current),_()},[a,i.domReference,F,_]);const V=P.useMemo(()=>{function M(L){v.current=L.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(L){const{nativeEvent:N}=L;function R(){!E.current&&!b.current&&r(!0,N,"hover")}u&&!$o(v.current)||n||d===0||(clearTimeout(S.current),v.current==="touch"?R():S.current=window.setTimeout(R,d))}}},[u,r,n,b,d]),k=P.useMemo(()=>({onMouseEnter(){clearTimeout(g.current)},onMouseLeave(M){O(M.nativeEvent,!1)}}),[O]);return P.useMemo(()=>a?{reference:V,floating:k}:{},[a,V,k])}function gN(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function $r(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function yN(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),$r(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let qo=new WeakMap,Ha=new WeakSet,Ua={},Cd=0;const vN=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ub=e=>e&&(e.host||Ub(e.parentNode)),bN=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ub(n);return e.contains(r)?r:null}).filter(n=>n!=null);function wN(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=bN(t,e),a=new Set,l=new Set(i),c=[];Ua[o]||(Ua[o]=new WeakMap);const u=Ua[o];i.forEach(d),f(t),a.clear();function d(h){!h||a.has(h)||(a.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,m=>{if(sr(m)!=="script")if(a.has(m))f(m);else{const p=s?m.getAttribute(s):null,y=p!==null&&p!=="false",b=(qo.get(m)||0)+1,v=(u.get(m)||0)+1;qo.set(m,b),u.set(m,v),c.push(m),b===1&&y&&Ha.add(m),v===1&&m.setAttribute(o,""),!y&&s&&m.setAttribute(s,"true")}})}return Cd++,()=>{c.forEach(h=>{const m=(qo.get(h)||0)-1,p=(u.get(h)||0)-1;qo.set(h,m),u.set(h,p),m||(!Ha.has(h)&&s&&h.removeAttribute(s),Ha.delete(h)),p||h.removeAttribute(o)}),Cd--,Cd||(qo=new WeakMap,qo=new WeakMap,Ha=new WeakSet,Ua={})}}function Gb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Et(e[0]).body;return wN(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ko=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yb(e,t){const n=si(e,Ko());t==="prev"&&n.reverse();const r=n.indexOf(un(Et(e)));return n.slice(r+1)[0]}function qb(){return Yb(document.body,"next")}function Kb(){return Yb(document.body,"prev")}function di(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ct(n,r)}function xN(e){si(e,Ko()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function SN(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function TN(e,t,n){const r=e.indexOf(t);function o(i){const a=hr("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||ct(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const Pd={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let EN;function Zb(e){e.key==="Tab"&&(e.target,clearTimeout(EN))}const Ga=P.forwardRef(function(t,n){const[r,o]=P.useState();_e(()=>(ad()&&o("button"),document.addEventListener("keydown",Zb),()=>{document.removeEventListener("keydown",Zb)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[hr("focus-guard")]:"",style:Pd};return P.createElement("span",Go({},t,s))}),Xb=P.createContext(null),Qb=hr("portal");function CN(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Yo(),o=Jb(),[s,i]=P.useState(null),a=P.useRef(null);return _e(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),_e(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Qb,""),l.appendChild(c),a.current=c,i(c)},[t,r]),_e(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Ge(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Qb,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Rr(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=CN({id:n,root:r}),[i,a]=P.useState(null),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),f=!!i&&!i.modal&&i.open&&o&&!!(r||s);return P.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function h(m){s&&di(m)&&(m.type==="focusin"?SN:xN)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,o,i==null?void 0:i.modal]),P.createElement(Xb.Provider,{value:P.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&P.createElement(Ga,{"data-type":"outside",ref:l,onFocus:h=>{if(di(h,s)){var m;(m=u.current)==null||m.focus()}else{const p=Kb()||(i==null?void 0:i.refs.domReference.current);p==null||p.focus()}}}),f&&s&&P.createElement("span",{"aria-owns":s.id,style:Pd}),s&&Ss.createPortal(t,s),f&&s&&P.createElement(Ga,{"data-type":"outside",ref:c,onFocus:h=>{if(di(h,s)){var m;(m=d.current)==null||m.focus()}else{const p=qb()||(i==null?void 0:i.refs.domReference.current);p==null||p.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const Jb=()=>P.useContext(Xb),e0=20;let Br=[];function kd(e){Br=Br.filter(n=>n.isConnected);let t=e;if(!(!t||sr(t)==="body")){if(!PM(t,Ko())){const n=si(t,Ko())[0];n&&(t=n)}Br.push(t),Br.length>e0&&(Br=Br.slice(-e0))}}function t0(){return Br.slice().reverse().find(e=>e.isConnected)}const PN=P.forwardRef(function(t,n){return P.createElement("button",Go({},t,{type:"button",ref:n,tabIndex:-1,style:Pd}))});function Zo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:m,onOpenChange:p,events:y,dataRef:b,floatingId:v,elements:{domReference:g,floating:T}}=t,S=typeof i=="number"&&i<0,E=ub(g)&&S,C=vN()?s:!0,I=At(o),A=At(i),O=At(a),F=fr(),_=Jb(),V=P.useRef(null),k=P.useRef(null),M=P.useRef(!1),L=P.useRef(!1),N=P.useRef(-1),R=_!=null,z=T==null?void 0:T.firstElementChild,D=(z==null?void 0:z.id)===v?z:T,B=bt(function(G){return G===void 0&&(G=D),G?si(G,Ko()):[]}),Z=bt(G=>{const $=B(G);return I.current.map(j=>g&&j==="reference"?g:D&&j==="floating"?D:$).filter(Boolean).flat()});P.useEffect(()=>{if(r||!c)return;function G(j){if(j.key==="Tab"){ct(D,un(Et(D)))&&B().length===0&&!E&&It(j);const H=Z(),Y=Cn(j);I.current[0]==="reference"&&Y===g&&(It(j),j.shiftKey?ur(H[H.length-1]):ur(H[1])),I.current[1]==="floating"&&Y===D&&j.shiftKey&&(It(j),ur(H[0]))}}const $=Et(D);return $.addEventListener("keydown",G),()=>{$.removeEventListener("keydown",G)}},[r,g,D,c,I,E,B,Z]),P.useEffect(()=>{if(r||!T)return;function G($){const j=Cn($),Y=B().indexOf(j);Y!==-1&&(N.current=Y)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,B]),P.useEffect(()=>{if(r||!d)return;function G(){L.current=!0,setTimeout(()=>{L.current=!1})}function $(j){const H=j.relatedTarget;queueMicrotask(()=>{const Y=!(ct(g,H)||ct(T,H)||ct(H,T)||ct(_==null?void 0:_.portalNode,H)||H!=null&&H.hasAttribute(hr("focus-guard"))||F&&($r(F.nodesRef.current,m).find(Q=>{var fe,U;return ct((fe=Q.context)==null?void 0:fe.elements.floating,H)||ct((U=Q.context)==null?void 0:U.elements.domReference,H)})||gN(F.nodesRef.current,m).find(Q=>{var fe,U;return((fe=Q.context)==null?void 0:fe.elements.floating)===H||((U=Q.context)==null?void 0:U.elements.domReference)===H})));if(l&&Y&&un(Et(D))===Et(D).body){gt(D)&&(D==null||D.focus());const Q=N.current,fe=B(),U=fe[Q]||fe[fe.length-1]||D;gt(U)&&U.focus()}(E||!c)&&H&&Y&&!L.current&&H!==t0()&&(M.current=!0,p(!1,j))})}if(T&&gt(g))return g.addEventListener("focusout",$),g.addEventListener("pointerdown",G),T.addEventListener("focusout",$),()=>{g.removeEventListener("focusout",$),g.removeEventListener("pointerdown",G),T.removeEventListener("focusout",$)}},[r,g,T,D,c,m,F,_,p,d,l,B,E]),P.useEffect(()=>{var G;if(r)return;const $=Array.from((_==null||(G=_.portalNode)==null?void 0:G.querySelectorAll("["+hr("portal")+"]"))||[]);if(T){const j=[T,...$,V.current,k.current,I.current.includes("reference")||E?g:null].filter(Y=>Y!=null),H=c||E?Gb(j,C,!C):Gb(j);return()=>{H()}}},[r,g,T,c,I,_,E,C]),_e(()=>{if(r||!gt(D))return;const G=Et(D),$=un(G);queueMicrotask(()=>{const j=Z(D),H=A.current,Y=(typeof H=="number"?j[H]:H.current)||D,Q=ct(D,$);!S&&!Q&&f&&ur(Y,{preventScroll:Y===D})})},[r,f,D,S,Z,A]),_e(()=>{if(r||!D)return;let G=!1;const $=Et(D),j=un($);let Y=b.current.openEvent;const Q=h.domReference.current;kd(j);function fe(U){let{open:Ae,reason:Ke,event:Be,nested:Ce}=U;Ae&&(Y=Be),Ke==="escape-key"&&h.domReference.current&&kd(h.domReference.current),Ke==="hover"&&Be.type==="mouseleave"&&(M.current=!0),Ke==="outside-press"&&(Ce?(M.current=!1,G=!0):M.current=!(lb(Be)||id(Be)))}return y.on("openchange",fe),()=>{y.off("openchange",fe);const U=un($),Ae=ct(T,U)||F&&$r(F.nodesRef.current,m).some(q=>{var ie;return ct((ie=q.context)==null?void 0:ie.elements.floating,U)});(Ae||Y&&["click","mousedown"].includes(Y.type))&&h.domReference.current&&kd(h.domReference.current);const Be=Q||j,Ce=si(Et(Be).body,Ko());queueMicrotask(()=>{let q=t0();!q&&gt(Be)&&T&&(q=TN(Ce,Be,T)),O.current&&!M.current&&gt(q)&&(!(q!==U&&U!==$.body)||Ae)&&q.focus({preventScroll:G})})}},[r,T,D,O,b,h,y,F,m]),_e(()=>{if(!r&&_)return _.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:p,refs:h}),()=>{_.setFocusManagerState(null)}},[r,_,c,f,p,h,d]),_e(()=>{if(r||!D||typeof MutationObserver!="function"||S)return;const G=()=>{const j=D.getAttribute("tabindex"),H=B(),Y=un(Et(T)),Q=H.indexOf(Y);Q!==-1&&(N.current=Q),I.current.includes("floating")||Y!==h.domReference.current&&H.length===0?j!=="0"&&D.setAttribute("tabindex","0"):j!=="-1"&&D.setAttribute("tabindex","-1")};G();const $=new MutationObserver(G);return $.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{$.disconnect()}},[r,T,D,h,I,B,S]);function oe(G){return r||!u||!c?null:P.createElement(PN,{ref:G==="start"?V:k,onClick:$=>p(!1,$.nativeEvent)},typeof u=="string"?u:"Dismiss")}const te=!r&&C&&(c?!E:!0)&&(R||c);return P.createElement(P.Fragment,null,te&&P.createElement(Ga,{"data-type":"inside",ref:_==null?void 0:_.beforeInsideRef,onFocus:G=>{if(c){const j=Z();ur(o[0]==="reference"?j[0]:j[j.length-1])}else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(M.current=!1,di(G,_.portalNode)){const j=qb()||g;j==null||j.focus()}else{var $;($=_.beforeOutsideRef.current)==null||$.focus()}}}),!E&&oe("start"),n,oe("end"),te&&P.createElement(Ga,{"data-type":"inside",ref:_==null?void 0:_.afterInsideRef,onFocus:G=>{if(c)ur(Z()[0]);else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(d&&(M.current=!0),di(G,_.portalNode)){const j=Kb()||g;j==null||j.focus()}else{var $;($=_.afterOutsideRef.current)==null||$.focus()}}}))}const Id=new Set,kN=P.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=Yo();return _e(()=>{if(!r)return;Id.add(s);const i=/iP(hone|ad|od)|iOS/.test(sd()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,f=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var h,m;const p=((h=window.visualViewport)==null?void 0:h.offsetLeft)||0,y=((m=window.visualViewport)==null?void 0:m.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(f-Math.floor(y))+"px",left:-(d-Math.floor(p))+"px",right:"0"})}return()=>{Id.delete(s),Id.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),P.createElement("div",Go({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function n0(e){return gt(e.target)&&e.target.tagName==="BUTTON"}function r0(e){return ud(e)}function fi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=P.useRef(),f=P.useRef(!1),h=P.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const p=d.current;m.button===0&&a!=="click"&&($o(p,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const p=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}$o(p,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){d.current=void 0,!(m.defaultPrevented||!u||n0(m))&&(m.key===" "&&!r0(s)&&(m.preventDefault(),f.current=!0),m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||n0(m)||r0(s)||m.key===" "&&f.current&&(f.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return P.useMemo(()=>i?{reference:h}:{},[i,h])}function IN(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,f=i.x,h=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),f-=n||0,h-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,f=a&&t.x!=null?t.x:f,h=l&&t.y!=null?t.y:h):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:f,y:h,top:h,right:f+u,bottom:h+d,left:f}}}}function o0(e){return e!=null&&e.clientX!=null}function AN(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=P.useRef(!1),f=P.useRef(null),[h,m]=P.useState(),[p,y]=P.useState([]),b=bt((E,C)=>{d.current||r.current.openEvent&&!o0(r.current.openEvent)||i.setPositionReference(IN(s,{x:E,y:C,axis:l,dataRef:r,pointerType:h}))}),v=bt(E=>{c!=null||u!=null||(n?f.current||y([]):b(E.clientX,E.clientY))}),g=$o(h)?o:n,T=P.useCallback(()=>{if(!g||!a||c!=null||u!=null)return;const E=Rt(o);function C(I){const A=Cn(I);ct(o,A)?(E.removeEventListener("mousemove",C),f.current=null):b(I.clientX,I.clientY)}if(!r.current.openEvent||o0(r.current.openEvent)){E.addEventListener("mousemove",C);const I=()=>{E.removeEventListener("mousemove",C),f.current=null};return f.current=I,I}i.setPositionReference(s)},[g,a,c,u,o,r,i,s,b]);P.useEffect(()=>T(),[T,p]),P.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),P.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),_e(()=>{a&&(c!=null||u!=null)&&(d.current=!1,b(c,u))},[a,c,u,b]);const S=P.useMemo(()=>{function E(C){let{pointerType:I}=C;m(I)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:v,onMouseEnter:v}},[v]);return P.useMemo(()=>a?{reference:S}:{},[a,S])}const ON={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},_N={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},s0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function jr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:m}=t,p=fr(),y=bt(typeof l=="function"?l:()=>!1),b=typeof l=="function"?y:l,v=P.useRef(!1),g=P.useRef(!1),{escapeKey:T,outsidePress:S}=s0(h),{escapeKey:E,outsidePress:C}=s0(m),I=bt(k=>{var M;if(!n||!i||!a||k.key!=="Escape")return;const L=(M=s.current.floatingContext)==null?void 0:M.nodeId,N=p?$r(p.nodesRef.current,L):[];if(!T&&(k.stopPropagation(),N.length>0)){let R=!0;if(N.forEach(z=>{var D;if((D=z.context)!=null&&D.open&&!z.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,QD(k)?k.nativeEvent:k,"escape-key")}),A=bt(k=>{var M;const L=()=>{var N;I(k),(N=Cn(k))==null||N.removeEventListener("keydown",L)};(M=Cn(k))==null||M.addEventListener("keydown",L)}),O=bt(k=>{var M;const L=v.current;v.current=!1;const N=g.current;if(g.current=!1,c==="click"&&N||L||typeof b=="function"&&!b(k))return;const R=Cn(k),z="["+hr("inert")+"]",D=Et(o.floating).querySelectorAll(z);let B=Ge(R)?R:null;for(;B&&!ir(B);){const G=zn(B);if(ir(G)||!Ge(G))break;B=G}if(D.length&&Ge(R)&&!JD(R)&&!ct(R,o.floating)&&Array.from(D).every(G=>!ct(B,G)))return;if(gt(R)&&V){const G=R.clientWidth>0&&R.scrollWidth>R.clientWidth,$=R.clientHeight>0&&R.scrollHeight>R.clientHeight;let j=$&&k.offsetX>R.clientWidth;if($&&Kt(R).direction==="rtl"&&(j=k.offsetX<=R.offsetWidth-R.clientWidth),j||G&&k.offsetY>R.clientHeight)return}const Z=(M=s.current.floatingContext)==null?void 0:M.nodeId,oe=p&&$r(p.nodesRef.current,Z).some(G=>{var $;return cd(k,($=G.context)==null?void 0:$.elements.floating)});if(cd(k,o.floating)||cd(k,o.domReference)||oe)return;const te=p?$r(p.nodesRef.current,Z):[];if(te.length>0){let G=!0;if(te.forEach($=>{var j;if((j=$.context)!=null&&j.open&&!$.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,k,"outside-press")}),F=bt(k=>{var M;const L=()=>{var N;O(k),(N=Cn(k))==null||N.removeEventListener(c,L)};(M=Cn(k))==null||M.addEventListener(c,L)});P.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=S;function k(N){r(!1,N,"ancestor-scroll")}const M=Et(o.floating);a&&M.addEventListener("keydown",E?A:I,E),b&&M.addEventListener(c,C?F:O,C);let L=[];return f&&(Ge(o.domReference)&&(L=ar(o.domReference)),Ge(o.floating)&&(L=L.concat(ar(o.floating))),!Ge(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(ar(o.reference.contextElement)))),L=L.filter(N=>{var R;return N!==((R=M.defaultView)==null?void 0:R.visualViewport)}),L.forEach(N=>{N.addEventListener("scroll",k,{passive:!0})}),()=>{a&&M.removeEventListener("keydown",E?A:I,E),b&&M.removeEventListener(c,C?F:O,C),L.forEach(N=>{N.removeEventListener("scroll",k)})}},[s,o,a,b,c,n,r,f,i,T,S,I,E,A,O,C,F]),P.useEffect(()=>{v.current=!1},[b,c]);const _=P.useMemo(()=>({onKeyDown:I,[ON[d]]:k=>{u&&r(!1,k.nativeEvent,"reference-press")}}),[I,r,u,d]),V=P.useMemo(()=>({onKeyDown:I,onMouseDown(){g.current=!0},onMouseUp(){g.current=!0},[_N[c]]:()=>{v.current=!0}}),[I,c]);return P.useMemo(()=>i?{reference:_,floating:V}:{},[i,_,V])}function DN(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Yo(),s=P.useRef({}),[i]=P.useState(()=>Bb()),a=dr()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Ge(h)&&fN("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=P.useState(r.reference),u=bt((h,m,p)=>{s.current.openEvent=h?m:void 0,i.emit("openchange",{open:h,event:m,reason:p,nested:a}),n==null||n(h,m,p)}),d=P.useMemo(()=>({setPositionReference:c}),[]),f=P.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return P.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}function Wr(e){e===void 0&&(e={});const{nodeId:t}=e,n=DN({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=P.useState(null),[a,l]=P.useState(null),u=(o==null?void 0:o.reference)||s,d=P.useRef(null),f=fr();_e(()=>{u&&(d.current=u)},[u]);const h=eN({...e,elements:{...o,...a&&{reference:a}}}),m=P.useCallback(g=>{const T=Ge(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),contextElement:g}:g;l(T),h.refs.setReference(T)},[h.refs]),p=P.useCallback(g=>{(Ge(g)||g===null)&&(d.current=g,i(g)),(Ge(h.refs.reference.current)||h.refs.reference.current===null||g!==null&&!Ge(g))&&h.refs.setReference(g)},[h.refs]),y=P.useMemo(()=>({...h.refs,setReference:p,setPositionReference:m,domReference:d}),[h.refs,p,m]),b=P.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),v=P.useMemo(()=>({...h,...r,refs:y,elements:b,nodeId:t}),[h,y,b,t,r]);return _e(()=>{r.dataRef.current.floatingContext=v;const g=f==null?void 0:f.nodesRef.current.find(T=>T.id===t);g&&(g.context=v)}),P.useMemo(()=>({...h,context:v,refs:y,elements:b}),[h,y,b,v])}function MN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=P.useRef(!1),u=P.useRef(),d=P.useRef(!0);P.useEffect(()=>{if(!a)return;const h=Rt(i.domReference);function m(){!n&&gt(i.domReference)&&i.domReference===un(Et(i.domReference))&&(c.current=!0)}function p(){d.current=!0}return h.addEventListener("blur",m),h.addEventListener("keydown",p,!0),()=>{h.removeEventListener("blur",m),h.removeEventListener("keydown",p,!0)}},[i.domReference,n,a]),P.useEffect(()=>{if(!a)return;function h(m){let{reason:p}=m;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),P.useEffect(()=>()=>{clearTimeout(u.current)},[]);const f=P.useMemo(()=>({onPointerDown(h){id(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const m=Cn(h.nativeEvent);if(l&&Ge(m))try{if(ad()&&cb())throw Error();if(!m.matches(":focus-visible"))return}catch{if(!d.current&&!ud(m))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const m=h.relatedTarget,p=h.nativeEvent,y=Ge(m)&&m.hasAttribute(hr("focus-guard"))&&m.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var b;const v=un(i.domReference?i.domReference.ownerDocument:document);!m&&v===i.domReference||ct((b=s.current.floatingContext)==null?void 0:b.refs.floating.current,v)||ct(i.domReference,v)||y||r(!1,p,"focus")})}}),[s,i.domReference,r,l]);return P.useMemo(()=>a?{reference:f}:{},[a,f])}const i0="active",a0="selected";function Ad(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[i0]:i,[a0]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[i0,a0].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var f,h=arguments.length,m=new Array(h),p=0;p<h;p++)m[p]=arguments[p];return(f=r.get(c))==null?void 0:f.map(y=>y(...m)).find(y=>y!==void 0)}}}else i[c]=u}),i),{})}}function zr(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=P.useCallback(a=>Ad(a,e,"reference"),t),s=P.useCallback(a=>Ad(a,e,"floating"),n),i=P.useCallback(a=>Ad(a,e,"item"),r);return P.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let l0=!1;function Ya(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function c0(e,t){return Ya(t,e===Sd||e===li,e===Ho||e===Uo)}function Od(e,t,n){return Ya(t,e===li,n?e===Ho:e===Uo)||e==="Enter"||e===" "||e===""}function NN(e,t,n){return Ya(t,n?e===Ho:e===Uo,e===li)}function u0(e,t,n){return Ya(t,n?e===Uo:e===Ho,e===Sd)}function _d(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:v=void 0,orientation:g="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:C,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||za("`useListNavigation` looping must be enabled to allow escaping."),m||za("`useListNavigation` must be virtual to allow escaping.")),g==="vertical"&&T>1&&za("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const A=dr(),O=fr(),F=bt(a),_=P.useRef(p),V=P.useRef(c??-1),k=P.useRef(null),M=P.useRef(!0),L=P.useRef(F),N=P.useRef(!!o.floating),R=P.useRef(n),z=P.useRef(!1),D=P.useRef(!1),B=At(v),Z=At(n),oe=At(S),te=At(o.floating),G=At(c),[$,j]=P.useState(),[H,Y]=P.useState(),Q=bt(function(q,ie,W){W===void 0&&(W=!1);function ee(ue){m?(j(ue.id),O==null||O.events.emit("virtualfocus",ue),E&&(E.current=ue)):ur(ue,{preventScroll:!0,sync:cb()&&ad()?l0||z.current:!1})}const ye=q.current[ie.current];ye&&ee(ye),requestAnimationFrame(()=>{const ue=q.current[ie.current]||ye;if(!ue)return;ye||ee(ue);const je=oe.current;je&&U&&(W||!M.current)&&(ue.scrollIntoView==null||ue.scrollIntoView(typeof je=="boolean"?{block:"nearest",inline:"nearest"}:je))})});_e(()=>{document.createElement("div").focus({get preventScroll(){return l0=!0,!1}})},[]),_e(()=>{l&&(n&&o.floating?_.current&&c!=null&&(D.current=!0,V.current=c,F(c)):N.current&&(V.current=-1,L.current(null)))},[l,n,o.floating,c,F]),_e(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(N.current&&(V.current=-1,Q(s,V)),(!R.current||!N.current)&&_.current&&(k.current!=null||_.current===!0&&k.current==null)){let q=0;const ie=()=>{s.current[0]==null?(q<2&&(q?requestAnimationFrame:queueMicrotask)(ie),q++):(V.current=k.current==null||Od(k.current,g,h)||f?Td(s,B.current):Mb(s,B.current),k.current=null,F(V.current))};ie()}}else ci(s,i)||(V.current=i,Q(s,V,D.current),D.current=!1)},[l,n,o.floating,i,G,f,s,g,h,F,Q,B]),_e(()=>{var q;if(!l||o.floating||!O||m||!N.current)return;const ie=O.nodesRef.current,W=(q=ie.find(ue=>ue.id===A))==null||(q=q.context)==null?void 0:q.elements.floating,ee=un(Et(o.floating)),ye=ie.some(ue=>ue.context&&ct(ue.context.elements.floating,ee));W&&!ye&&M.current&&W.focus({preventScroll:!0})},[l,o.floating,O,A,m]),_e(()=>{if(!l||!O||!m||A)return;function q(ie){Y(ie.id),E&&(E.current=ie)}return O.events.on("virtualfocus",q),()=>{O.events.off("virtualfocus",q)}},[l,O,m,A,E]),_e(()=>{L.current=F,N.current=!!o.floating}),_e(()=>{n||(k.current=null)},[n]),_e(()=>{R.current=n},[n]);const fe=i!=null,U=P.useMemo(()=>{function q(W){if(!n)return;const ee=s.current.indexOf(W);ee!==-1&&F(ee)}return{onFocus(W){let{currentTarget:ee}=W;q(ee)},onClick:W=>{let{currentTarget:ee}=W;return ee.focus({preventScroll:!0})},...y&&{onMouseMove(W){let{currentTarget:ee}=W;q(ee)},onPointerLeave(W){let{pointerType:ee}=W;!M.current||ee==="touch"||(V.current=-1,Q(s,V),F(null),m||ur(te.current,{preventScroll:!0}))}}}},[n,te,Q,y,s,F,m]),Ae=bt(q=>{if(M.current=!1,z.current=!0,!Z.current&&q.currentTarget===te.current)return;if(f&&u0(q.key,g,h)){It(q),r(!1,q.nativeEvent,"list-navigation"),gt(o.domReference)&&!m&&o.domReference.focus();return}const ie=V.current,W=Td(s,v),ee=Mb(s,v);if(q.key==="Home"&&(It(q),V.current=W,F(V.current)),q.key==="End"&&(It(q),V.current=ee,F(V.current)),T>1){const ye=C||Array.from({length:s.current.length},()=>({width:1,height:1})),ue=oN(ye,T,I),je=ue.findIndex(le=>le!=null&&!Wa(s.current,le,v)),ne=ue.reduce((le,Ne,tt)=>Ne!=null&&!Wa(s.current,Ne,v)?tt:le,-1);if(V.current=ue[rN({current:ue.map(le=>le!=null?s.current[le]:null)},{event:q,orientation:g,loop:d,cols:T,disabledIndices:iN([...v||s.current.map((le,Ne)=>Wa(s.current,Ne)?Ne:void 0),void 0],ue),minIndex:je,maxIndex:ne,prevIndex:sN(V.current>ee?W:V.current,ye,ue,T,q.key===li?"bl":q.key===Uo?"tr":"tl"),stopEvent:!0})],F(V.current),g==="both")return}if(c0(q.key,g)){if(It(q),n&&!m&&un(q.currentTarget.ownerDocument)===q.currentTarget){V.current=Od(q.key,g,h)?W:ee,F(V.current);return}Od(q.key,g,h)?d?V.current=ie>=ee?u&&ie!==s.current.length?-1:W:Nt(s,{startingIndex:ie,disabledIndices:v}):V.current=Math.min(ee,Nt(s,{startingIndex:ie,disabledIndices:v})):d?V.current=ie<=W?u&&ie!==-1?s.current.length:ee:Nt(s,{startingIndex:ie,decrement:!0,disabledIndices:v}):V.current=Math.max(W,Nt(s,{startingIndex:ie,decrement:!0,disabledIndices:v})),ci(s,V.current)?F(null):F(V.current)}}),Ke=P.useMemo(()=>m&&n&&fe&&{"aria-activedescendant":H||$},[m,n,fe,H,$]),Be=P.useMemo(()=>({"aria-orientation":g==="both"?void 0:g,...!ub(o.domReference)&&Ke,onKeyDown:Ae,onPointerMove(){M.current=!0}}),[Ke,Ae,o.domReference,g]),Ce=P.useMemo(()=>{function q(W){p==="auto"&&lb(W.nativeEvent)&&(_.current=!0)}function ie(W){_.current=p,p==="auto"&&id(W.nativeEvent)&&(_.current=!0)}return{...Ke,onKeyDown(W){M.current=!1;const ee=W.key.indexOf("Arrow")===0,ye=NN(W.key,g,h),ue=u0(W.key,g,h),je=c0(W.key,g),ne=(f?ye:je)||W.key==="Enter"||W.key.trim()==="";if(m&&n){const Ot=O==null?void 0:O.nodesRef.current.find(Wt=>Wt.parentId==null),Vt=O&&Ot?yN(O.nodesRef.current,Ot.id):null;if(ee&&Vt&&E){const Wt=new KeyboardEvent("keydown",{key:W.key,bubbles:!0});if(ye||ue){var le,Ne;const ro=((le=Vt.context)==null?void 0:le.elements.domReference)===W.currentTarget,bs=ue&&!ro?(Ne=Vt.context)==null?void 0:Ne.elements.domReference:ye?s.current.find(ws=>(ws==null?void 0:ws.id)===$):null;bs&&(It(W),bs.dispatchEvent(Wt),Y(void 0))}if(je&&Vt.context&&Vt.context.open&&Vt.parentId&&W.currentTarget!==Vt.context.elements.domReference){var tt;It(W),(tt=Vt.context.elements.domReference)==null||tt.dispatchEvent(Wt);return}}return Ae(W)}if(!(!n&&!b&&ee)){if(ne&&(k.current=f&&je?null:W.key),f){ye&&(It(W),n?(V.current=Td(s,B.current),F(V.current)):r(!0,W.nativeEvent,"list-navigation"));return}je&&(c!=null&&(V.current=c),It(W),!n&&b?r(!0,W.nativeEvent,"list-navigation"):Ae(W),n&&F(V.current))}},onFocus(){n&&!m&&F(null)},onPointerDown:ie,onMouseDown:q,onClick:q}},[$,Ke,Ae,B,p,s,f,F,r,n,b,g,h,c,O,m,E]);return P.useMemo(()=>l?{reference:Ce,floating:Be,item:U}:{},[l,Ce,Be,U])}const LN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Hr(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=LN.get(i))!=null?n:i,l=Yo(),u=dr()!=null,d=P.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),f=P.useMemo(()=>{const m={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?m:{...m,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),h=P.useCallback(m=>{let{active:p,selected:y}=m;const b={role:"option",...p&&{id:o+"-option"}};switch(i){case"select":return{...b,"aria-selected":p&&y};case"combobox":return{...b,...p&&{"aria-selected":!0}}}return{}},[o,i]);return P.useMemo(()=>s?{reference:d,floating:f,item:h}:{},[s,d,f,h])}const d0=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Xo(e,t){return typeof e=="function"?e(t):e}function FN(e,t){const[n,r]=P.useState(e);return e&&!n&&r(!0),P.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function VN(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=P.useState("unmounted"),c=FN(n,i);return!c&&a==="close"&&l("unmounted"),_e(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function f0(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=P.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,f=(u?i:i.close)||0,[h,m]=P.useState(()=>({...Xo(s,c),...Xo(n,c)})),{isMounted:p,status:y}=VN(e,{duration:i}),b=At(n),v=At(r),g=At(o),T=At(s);return _e(()=>{const S=Xo(b.current,c),E=Xo(g.current,c),C=Xo(T.current,c),I=Xo(v.current,c)||Object.keys(S).reduce((A,O)=>(A[O]="",A),{});if(y==="initial"&&m(A=>({transitionProperty:A.transitionProperty,...C,...S})),y==="open"&&m({transitionProperty:Object.keys(I).map(d0).join(","),transitionDuration:d+"ms",...C,...I}),y==="close"){const A=E||S;m({transitionProperty:Object.keys(A).map(d0).join(","),transitionDuration:f+"ms",...C,...A})}},[f,g,b,v,T,d,y,c]),{isMounted:p,styles:h}}function $N(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:h=null}=t,m=P.useRef(),p=P.useRef(""),y=P.useRef((n=h??i)!=null?n:-1),b=P.useRef(null),v=bt(a),g=bt(l),T=At(u),S=At(f);_e(()=>{r&&(clearTimeout(m.current),b.current=null,p.current="")},[r]),_e(()=>{if(r&&p.current===""){var O;y.current=(O=h??i)!=null?O:-1}},[r,h,i]);const E=bt(O=>{O?o.current.typing||(o.current.typing=O,g(O)):o.current.typing&&(o.current.typing=O,g(O))}),C=bt(O=>{function F(L,N,R){const z=T.current?T.current(N,R):N.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(R.toLocaleLowerCase()))===0);return z?L.indexOf(z):-1}const _=s.current;if(p.current.length>0&&p.current[0]!==" "&&(F(_,_,p.current)===-1?E(!1):O.key===" "&&It(O)),_==null||S.current.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;r&&O.key!==" "&&(It(O),E(!0)),_.every(L=>{var N,R;return L?((N=L[0])==null?void 0:N.toLocaleLowerCase())!==((R=L[1])==null?void 0:R.toLocaleLowerCase()):!0})&&p.current===O.key&&(p.current="",y.current=b.current),p.current+=O.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",y.current=b.current,E(!1)},d);const k=y.current,M=F(_,[..._.slice((k||0)+1),..._.slice(0,(k||0)+1)],p.current);M!==-1?(v(M),b.current=M):O.key!==" "&&(p.current="",E(!1))}),I=P.useMemo(()=>({onKeyDown:C}),[C]),A=P.useMemo(()=>({onKeyDown:C,onKeyUp(O){O.key===" "&&E(!1)}}),[C,E]);return P.useMemo(()=>c?{reference:I,floating:A}:{},[c,I,A])}function h0(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function RN(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function p0(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,f){const h=performance.now(),m=h-l;if(i===null||a===null||m===0)return i=d,a=f,l=h,null;const p=d-i,y=f-a,v=Math.sqrt(p*p+y*y)/m;return i=d,a=f,l=h,v}const u=d=>{let{x:f,y:h,placement:m,elements:p,onClose:y,nodeId:b,tree:v}=d;return function(T){function S(){clearTimeout(o),y()}if(clearTimeout(o),!p.domReference||!p.floating||m==null||f==null||h==null)return;const{clientX:E,clientY:C}=T,I=[E,C],A=Cn(T),O=T.type==="mouseleave",F=ct(p.floating,A),_=ct(p.domReference,A),V=p.domReference.getBoundingClientRect(),k=p.floating.getBoundingClientRect(),M=m.split("-")[0],L=f>k.right-k.width/2,N=h>k.bottom-k.height/2,R=RN(I,V),z=k.width>V.width,D=k.height>V.height,B=(z?V:k).left,Z=(z?V:k).right,oe=(D?V:k).top,te=(D?V:k).bottom;if(F&&(s=!0,!O))return;if(_&&(s=!1),_&&!O){s=!0;return}if(O&&Ge(T.relatedTarget)&&ct(p.floating,T.relatedTarget)||v&&$r(v.nodesRef.current,b).some(j=>{let{context:H}=j;return H==null?void 0:H.open}))return;if(M==="top"&&h>=V.bottom-1||M==="bottom"&&h<=V.top+1||M==="left"&&f>=V.right-1||M==="right"&&f<=V.left+1)return S();let G=[];switch(M){case"top":G=[[B,V.top+1],[B,k.bottom-1],[Z,k.bottom-1],[Z,V.top+1]];break;case"bottom":G=[[B,k.top+1],[B,V.bottom-1],[Z,V.bottom-1],[Z,k.top+1]];break;case"left":G=[[k.right-1,te],[k.right-1,oe],[V.left+1,oe],[V.left+1,te]];break;case"right":G=[[V.right-1,te],[V.right-1,oe],[k.left+1,oe],[k.left+1,te]];break}function $(j){let[H,Y]=j;switch(M){case"top":{const Q=[z?H+t/2:L?H+t*4:H-t*4,Y+t+1],fe=[z?H-t/2:L?H+t*4:H-t*4,Y+t+1],U=[[k.left,L||z?k.bottom-t:k.top],[k.right,L?z?k.bottom-t:k.top:k.bottom-t]];return[Q,fe,...U]}case"bottom":{const Q=[z?H+t/2:L?H+t*4:H-t*4,Y-t],fe=[z?H-t/2:L?H+t*4:H-t*4,Y-t],U=[[k.left,L||z?k.top+t:k.bottom],[k.right,L?z?k.top+t:k.bottom:k.top+t]];return[Q,fe,...U]}case"left":{const Q=[H+t+1,D?Y+t/2:N?Y+t*4:Y-t*4],fe=[H+t+1,D?Y-t/2:N?Y+t*4:Y-t*4];return[...[[N||D?k.right-t:k.left,k.top],[N?D?k.right-t:k.left:k.right-t,k.bottom]],Q,fe]}case"right":{const Q=[H-t,D?Y+t/2:N?Y+t*4:Y-t*4],fe=[H-t,D?Y-t/2:N?Y+t*4:Y-t*4],U=[[N||D?k.left+t:k.right,k.top],[N?D?k.left+t:k.right:k.left+t,k.bottom]];return[Q,fe,...U]}}}if(!h0([E,C],G)){if(s&&!R)return S();if(!O&&r){const j=c(T.clientX,T.clientY);if(j!==null&&j<.1)return S()}h0([E,C],$([f,h]))?!s&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Qo=e=>{const t=w.useId(),[n,r]=w.useState(e.open),o=w.useRef(null),s=w.useMemo(()=>[ai(10),wd({fallbackAxisSideDirection:"end"}),bd(),_b({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Wr({open:n,middleware:s,transform:!0,whileElementsMounted:ii,onOpenChange:(m,p)=>{var b;const y=p==null?void 0:p.relatedTarget;y&&y.dataset.floating==="true"&&!m||(r(m),(b=e.onChange)==null||b.call(e,m))}}),c=fi(l),u=jr(l),d=Hr(l),{getReferenceProps:f,getFloatingProps:h}=zr([c,u,d]);return x.jsxs(w.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(Rr,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(Zo,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...h(),children:[x.jsx(Rb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},BN=e=>{const t=w.useRef(null),n=w.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=w.useState(!1),{context:a,refs:l}=Wr({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=fi(a),u=Hr(a),d=jr(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=zr([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(go,{...h(e),as:at.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:x.jsx(at.span,{layoutId:o,children:e.trigger})}),x.jsx(er,{children:s?x.jsx(Rr,{root:t,children:x.jsx(Zo,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(at.div,{...f(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},m0=300,jN=500,g0=(e="")=>Me("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary focus:bg-primary aria-expanded:opacity-80","focus:text-primary-foreground hover:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),Dd=w.createContext({isOpen:!1,activeIndex:null,getItemProps:()=>({}),setActiveIndex:()=>{},setHasFocusInside:()=>{}}),y0=w.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const[l,c]=w.useState(!1),[u,d]=w.useState(!1),[f,h]=w.useState(null),m=w.useRef([]),p=w.useRef([]),y=w.useContext(Dd),b=dr(),v=fr(),g=hN(),T=Fb(),S=b!==null,{floatingStyles:E,refs:C,context:I}=Wr({nodeId:g,open:l,transform:!0,strategy:"absolute",onOpenChange:c,whileElementsMounted:ii,placement:S?"right":"bottom-start",middleware:[ai({mainAxis:S?0:4,alignmentAxis:S?-4:0}),wd(),bd()]}),A=Hr(I,{role:"menu",enabled:!0}),O=jr(I,{bubbles:!0}),F=Hb(I,{move:!1,enabled:n,delay:{open:m0},handleClose:p0({blockPointerEvents:!0})}),_=fi(I,{event:"mousedown",toggle:!S,ignoreMouse:S,keyboardHandlers:!0}),V=_d(I,{loop:!0,listRef:m,activeIndex:f,nested:S,onNavigate:h}),k=$N(I,{activeIndex:f,listRef:p,resetMs:jN,onMatch:l?h:void 0}),{getReferenceProps:M,getFloatingProps:L,getItemProps:N}=zr([F,_,A,O,V,k]);w.useEffect(()=>{if(!v)return;function z(){c(!1)}function D(B){B.nodeId!==g&&B.parentId===b&&c(!1)}return v.events.on("click",z),v.events.on("menuopen",D),()=>{v.events.off("click",z),v.events.off("menuopen",D)}},[v,g,b]),w.useEffect(()=>{l&&v&&v.events.emit("menuopen",{parentId:b,nodeId:g})},[v,l,g,b]);const R=r?i.className:Me(g0(i.className));return x.jsxs(pN,{id:g,children:[x.jsx(w.Fragment,{children:i.asChild?x.jsx(Vo,{children:s,ref:xd([C.setReference,T.ref,a]),tabIndex:S?y.activeIndex===T.index?0:-1:void 0,"data-open":l?"":void 0,"data-nested":S?"":void 0,role:S?"menuitem":void 0,"data-focus-inside":u?"":void 0,className:R,...M(y.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),d(!1),y.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",className:R,"data-open":l?"":void 0,"data-nested":S?"":void 0,role:S?"menuitem":void 0,"data-focus-inside":u?"":void 0,ref:xd([C.setReference,T.ref,a]),tabIndex:S?y.activeIndex===T.index?0:-1:void 0,...M(y.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),d(!1),y.setHasFocusInside(!0)}})),children:[s,S&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(Tu,{size:14})]})]})}),x.jsx(Dd.Provider,{value:{activeIndex:f,setActiveIndex:h,getItemProps:N,setHasFocusInside:d,isOpen:l},children:x.jsx(cN,{elementsRef:m,labelsRef:p,children:l&&x.jsx(Rr,{preserveTabOrder:!0,children:x.jsx(Zo,{context:I,modal:!1,initialFocus:S?-1:0,returnFocus:!S,children:x.jsx(t,{...L(),ref:C.setFloating,style:{...i.style,...E},className:Me("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),WN=w.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=w.useContext(Dd),a=Fb({label:r?null:typeof e=="string"?e:t}),l=fr(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,type:"button",role:"menuitem",disabled:r,"data-active":c,"data-open":i.isOpen,tabIndex:c?0:-1,ref:xd([a.ref,s]),className:g0(`${o.className??""} ${c?"bg-primary text-primary-foreground":""}`),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),zN=w.forwardRef((e,t)=>dr()!==null?x.jsx(y0,{...e,isParent:!1,ref:t}):x.jsx(mN,{children:x.jsx(y0,{...e,isParent:!0,ref:t})}));var kn=function(){return kn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},kn.apply(this,arguments)};function v0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Jo(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function l(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function es(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function b0(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Md(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var qa="right-scroll-bar-position",Ka="width-before-scroll-bar",HN="with-scroll-bars-hidden",UN="--removed-body-scroll-bar-size";function Nd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GN(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var YN=typeof window<"u"?P.useLayoutEffect:P.useEffect,w0=new WeakMap;function qN(e,t){var n=GN(null,function(r){return e.forEach(function(o){return Nd(o,r)})});return YN(function(){var r=w0.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Nd(a,null)}),s.forEach(function(a){o.has(a)||Nd(a,i)})}w0.set(n,e)},[e]),n}function KN(e){return e}function ZN(e,t){t===void 0&&(t=KN);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function XN(e){e===void 0&&(e={});var t=ZN(null);return t.options=kn({async:!0,ssr:!1},e),t}var x0=function(e){var t=e.sideCar,n=v0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,kn({},n))};x0.isSideCarExport=!0;function QN(e,t){return e.useMedium(t),x0}var S0=XN(),Ld=function(){},Za=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:Ld,onWheelCapture:Ld,onTouchMoveCapture:Ld}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,v=e.gapMode,g=v0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=qN([n,t]),E=kn(kn({},g),o);return P.createElement(P.Fragment,null,u&&P.createElement(T,{sideCar:S0,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:v}),i?P.cloneElement(P.Children.only(a),kn(kn({},E),{ref:S})):P.createElement(b,kn({},E,{className:l,ref:S}),a))});Za.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Za.classNames={fullWidth:Ka,zeroRight:qa};var JN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=JN();return t&&e.setAttribute("nonce",t),e}function tL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eL())&&(tL(t,n),nL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oL=function(){var e=rL();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T0=function(){var e=oL(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sL={left:0,top:0,right:0,gap:0},Fd=function(e){return parseInt(e||"",10)||0},iL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fd(n),Fd(r),Fd(o)]},aL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sL;var t=iL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},lL=T0(),ts="data-scroll-locked",cL=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
173
- .`.concat(HN,` {
172
+ */var uM=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Va=uM.join(","),hb=typeof Element>"u",Wo=hb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$a=!hb&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ra=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},dM=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},fM=function(t,n,r){if(Ra(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Va));return n&&Wo.call(t,Va)&&o.unshift(t),o=o.filter(r),o},hM=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ra(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Wo.call(i,Va);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Ra(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&f){var h=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},pb=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},mb=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||dM(t))&&!pb(t)?0:t.tabIndex},pM=function(t,n){var r=mb(t);return r<0&&n&&!pb(t)?0:r},mM=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},gb=function(t){return t.tagName==="INPUT"},gM=function(t){return gb(t)&&t.type==="hidden"},yM=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},vM=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},bM=function(t){if(!t.name)return!0;var n=t.form||$a(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=vM(o,t.form);return!s||s===t},wM=function(t){return gb(t)&&t.type==="radio"},xM=function(t){return wM(t)&&!bM(t)},SM=function(t){var n,r=t&&$a(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=$a(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},yb=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},TM=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Wo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Wo.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=$a(t);if(l&&!l.shadowRoot&&o(l)===!0)return yb(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(SM(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return yb(t);return!1},EM=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Wo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},CM=function(t,n){return!(n.disabled||Ra(n)||gM(n)||TM(n,t)||yM(n)||EM(n))},yd=function(t,n){return!(xM(n)||mb(n)<0||!CM(t,n))},PM=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},kM=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=pM(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(mM).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},ii=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hM([t],n.includeContainer,{filter:yd.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:PM}):r=fM(t,n.includeContainer,yd.bind(null,n)),kM(r)},IM=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Wo.call(t,Va)===!1?!1:yd(n,t)};function vb(e,t,n){let{reference:r,floating:o}=e;const s=Fr(t),i=md(t),a=pd(i),l=cr(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(jo(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const AM=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=vb(c,r,l),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:v,fn:b}=a[p],{x:y,y:g,data:T,reset:S}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=y??u,d=g??d,h={...h,[v]:{...h[v],...T}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=vb(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function vd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bo(t,e),m=fb(h),v=a[f?d==="floating"?"reference":"floating":d],b=Fa(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(g))?await(s.getScale==null?void 0:s.getScale(g))||{x:1,y:1}:{x:1,y:1},S=Fa(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:g,strategy:l}):y);return{top:(b.top-S.top+m.top)/T.y,bottom:(S.bottom-b.bottom+m.bottom)/T.y,left:(b.left-S.left+m.left)/T.x,right:(S.right-b.right+m.right)/T.x}}const OM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Bo(e,t)||{};if(c==null)return{};const d=fb(u),f={x:n,y:r},h=md(o),m=pd(h),p=await i.getDimensions(c),v=h==="y",b=v?"top":"left",y=v?"bottom":"right",g=v?"clientHeight":"clientWidth",T=s.reference[m]+s.reference[h]-f[h]-s.floating[m],S=f[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let C=E?E[g]:0;(!C||!await(i.isElement==null?void 0:i.isElement(E)))&&(C=a.floating[g]||s.floating[m]);const I=T/2-S/2,A=C/2-p[m]/2-1,O=Pn(d[b],A),L=Pn(d[y],A),_=O,V=C-p[m]-L,k=C/2-p[m]/2+I,M=hd(_,k,V),F=!l.arrow&&jo(o)!=null&&k!==M&&s.reference[m]/2-(k<_?O:L)-p[m]/2<0,N=F?k<_?k-_:k-V:0;return{[h]:f[h]+N,data:{[h]:M,centerOffset:k-M-N,...F&&{alignmentOffset:N}},reset:F}}}),_M=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...v}=Bo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=cr(o),y=Fr(a),g=cr(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(g||!p?[La(a)]:iM(a)),E=m!=="none";!f&&E&&S.push(...lM(a,p,m,T));const C=[a,...S],I=await vd(t,v),A=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(I[b]),d){const k=sM(o,i,T);A.push(I[k[0]],I[k[1]])}if(O=[...O,{placement:o,overflows:A}],!A.every(k=>k<=0)){var L,_;const k=(((L=s.flip)==null?void 0:L.index)||0)+1,M=C[k];if(M)return{data:{index:k,overflows:O},reset:{placement:M}};let F=(_=O.filter(N=>N.overflows[0]<=0).sort((N,R)=>N.overflows[1]-R.overflows[1])[0])==null?void 0:_.placement;if(!F)switch(h){case"bestFit":{var V;const N=(V=O.filter(R=>{if(E){const z=Fr(R.placement);return z===y||z==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,D)=>z+D,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:V[0];N&&(F=N);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function DM(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=cr(n),a=jo(n),l=Fr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const MM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await DM(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},NM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:b,y}=v;return{x:b,y}}},...l}=Bo(e,t),c={x:n,y:r},u=await vd(t,l),d=Fr(cr(o)),f=db(d);let h=c[f],m=c[d];if(s){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=h+u[v],g=h-u[b];h=hd(y,h,g)}if(i){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=m+u[v],g=m-u[b];m=hd(y,m,g)}const p=a.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},LM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=Bo(e,t),l=await vd(t,a),c=cr(n),u=jo(n),d=Fr(n)==="y",{width:f,height:h}=r.floating;let m,p;c==="top"||c==="bottom"?(m=c,p=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(p=c,m=u==="end"?"top":"bottom");const v=h-l.top-l.bottom,b=f-l.left-l.right,y=Pn(h-l[m],v),g=Pn(f-l[p],b),T=!t.middlewareData.shift;let S=y,E=g;if(d?E=u||T?Pn(g,b):b:S=u||T?Pn(y,v):v,T&&!u){const I=Zt(l.left,0),A=Zt(l.right,0),O=Zt(l.top,0),L=Zt(l.bottom,0);d?E=f-2*(I!==0||A!==0?I+A:Zt(l.left,l.right)):S=h-2*(O!==0||L!==0?O+L:Zt(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:S});const C=await o.getDimensions(s.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function bb(e){const t=Kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Na(n)!==s||Na(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function bd(e){return Ge(e)?e:e.contextElement}function zo(e){const t=bd(e);if(!gt(t))return lr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=bb(t);let i=(s?Na(n.width):n.width)/r,a=(s?Na(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const FM=lr(0);function wb(e){const t=Rt(e);return!sd()||!t.visualViewport?FM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function VM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rt(e)?!1:t}function Vr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=bd(e);let i=lr(1);t&&(r?Ge(r)&&(i=zo(r)):i=zo(e));const a=VM(s,n,r)?wb(s):lr(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Rt(s),h=r&&Ge(r)?Rt(r):r;let m=f,p=id(m);for(;p&&r&&h!==m;){const v=zo(p),b=p.getBoundingClientRect(),y=Kt(p),g=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,T=b.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=g,c+=T,m=Rt(p),p=id(m)}}return Fa({width:u,height:d,x:l,y:c})}function $M(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Wn(r),a=t?Da(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=lr(1);const u=lr(0),d=gt(r);if((d||!d&&!s)&&((sr(r)!=="body"||si(i))&&(l=Ma(r)),gt(r))){const f=Vr(r);c=zo(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function RM(e){return Array.from(e.getClientRects())}function xb(e){return Vr(Wn(e)).left+Ma(e).scrollLeft}function BM(e){const t=Wn(e),n=Ma(e),r=e.ownerDocument.body,o=Zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+xb(e);const a=-n.scrollTop;return Kt(r).direction==="rtl"&&(i+=Zt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function jM(e,t){const n=Rt(e),r=Wn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=sd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function WM(e,t){const n=Vr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=gt(e)?zo(e):lr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Sb(e,t,n){let r;if(t==="viewport")r=jM(e,n);else if(t==="document")r=BM(Wn(e));else if(Ge(t))r=WM(t,n);else{const o=wb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Fa(r)}function Tb(e,t){const n=zn(e);return n===t||!Ge(n)||ir(n)?!1:Kt(n).position==="fixed"||Tb(n,t)}function zM(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>Ge(a)&&sr(a)!=="body"),o=null;const s=Kt(e).position==="fixed";let i=s?zn(e):e;for(;Ge(i)&&!ir(i);){const a=Kt(i),l=od(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||si(i)&&!l&&Tb(e,i))?r=r.filter(u=>u!==i):o=a,i=zn(i)}return t.set(e,r),r}function HM(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Da(t)?[]:zM(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Sb(t,u,o);return c.top=Zt(d.top,c.top),c.right=Pn(d.right,c.right),c.bottom=Pn(d.bottom,c.bottom),c.left=Zt(d.left,c.left),c},Sb(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UM(e){const{width:t,height:n}=bb(e);return{width:t,height:n}}function GM(e,t,n){const r=gt(t),o=Wn(t),s=n==="fixed",i=Vr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=lr(0);if(r||!r&&!s)if((sr(t)!=="body"||si(o))&&(a=Ma(t)),r){const d=Vr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=xb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function wd(e){return Kt(e).position==="static"}function Eb(e,t){return!gt(e)||Kt(e).position==="fixed"?null:t?t(e):e.offsetParent}function Cb(e,t){const n=Rt(e);if(Da(e))return n;if(!gt(e)){let o=zn(e);for(;o&&!ir(o);){if(Ge(o)&&!wd(o))return o;o=zn(o)}return n}let r=Eb(e,t);for(;r&&XD(r)&&wd(r);)r=Eb(r,t);return r&&ir(r)&&wd(r)&&!od(r)?n:r||QD(e)||n}const YM=async function(e){const t=this.getOffsetParent||Cb,n=this.getDimensions,r=await n(e.floating);return{reference:GM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qM(e){return Kt(e).direction==="rtl"}const KM={convertOffsetParentRelativeRectToViewportRelativeRect:$M,getDocumentElement:Wn,getClippingRect:HM,getOffsetParent:Cb,getElementRects:YM,getClientRects:RM,getDimensions:UM,getScale:zo,isElement:Ge,isRTL:qM};function ZM(e,t){let n=null,r;const o=Wn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Ro(u),m=Ro(o.clientWidth-(c+d)),p=Ro(o.clientHeight-(u+f)),v=Ro(c),y={rootMargin:-h+"px "+-m+"px "+-p+"px "+-v+"px",threshold:Zt(0,Pn(1,l))||1};let g=!0;function T(S){const E=S[0].intersectionRatio;if(E!==l){if(!g)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}g=!1}try{n=new IntersectionObserver(T,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,y)}n.observe(e)}return i(!0),s}function ai(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=bd(e),u=o||s?[...c?ar(c):[],...ar(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=c&&a?ZM(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,p=l?Vr(e):null;l&&v();function v(){const b=Vr(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,m=requestAnimationFrame(v)}return n(),()=>{var b;u.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const XM=MM,QM=NM,JM=_M,eN=LM,Pb=OM,tN=(e,t,n)=>{const r=new Map,o={platform:KM,...n},s={...o.platform,_c:r};return AM(e,t,{...o,platform:s})};var Ba=typeof document<"u"?w.useLayoutEffect:w.useEffect;function ja(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ja(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ja(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function kb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ib(e,t){const n=kb(e);return Math.round(t*n)/n}function Ab(e){const t=P.useRef(e);return Ba(()=>{t.current=e}),t}function nN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=P.useState(r);ja(f,r)||h(r);const[m,p]=P.useState(null),[v,b]=P.useState(null),y=P.useCallback(N=>{N!==E.current&&(E.current=N,p(N))},[]),g=P.useCallback(N=>{N!==C.current&&(C.current=N,b(N))},[]),T=s||m,S=i||v,E=P.useRef(null),C=P.useRef(null),I=P.useRef(u),A=l!=null,O=Ab(l),L=Ab(o),_=P.useCallback(()=>{if(!E.current||!C.current)return;const N={placement:t,strategy:n,middleware:f};L.current&&(N.platform=L.current),tN(E.current,C.current,N).then(R=>{const z={...R,isPositioned:!0};V.current&&!ja(I.current,z)&&(I.current=z,Ss.flushSync(()=>{d(z)}))})},[f,t,n,L]);Ba(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[c]);const V=P.useRef(!1);Ba(()=>(V.current=!0,()=>{V.current=!1}),[]),Ba(()=>{if(T&&(E.current=T),S&&(C.current=S),T&&S){if(O.current)return O.current(T,S,_);_()}},[T,S,_,O,A]);const k=P.useMemo(()=>({reference:E,floating:C,setReference:y,setFloating:g}),[y,g]),M=P.useMemo(()=>({reference:T,floating:S}),[T,S]),F=P.useMemo(()=>{const N={position:n,left:0,top:0};if(!M.floating)return N;const R=Ib(M.floating,u.x),z=Ib(M.floating,u.y);return a?{...N,transform:"translate("+R+"px, "+z+"px)",...kb(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:z}},[n,a,M.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:_,refs:k,elements:M,floatingStyles:F}),[u,_,k,M,F])}const rN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pb({element:r.current,padding:o}).fn(n):{}:r?Pb({element:r,padding:o}).fn(n):{}}}},li=(e,t)=>({...XM(e),options:[e,t]}),xd=(e,t)=>({...QM(e),options:[e,t]}),Sd=(e,t)=>({...JM(e),options:[e,t]}),Ob=(e,t)=>({...eN(e),options:[e,t]}),_b=(e,t)=>({...rN(e),options:[e,t]});function Td(e){return P.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Db={...P},oN=Db.useInsertionEffect||(e=>e());function bt(e){const t=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oN(()=>{t.current=e}),P.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ed="ArrowUp",ci="ArrowDown",Ho="ArrowLeft",Uo="ArrowRight";function Wa(e,t,n){return Math.floor(e/t)!==n}function ui(e,t){return t<0||t>=e.current.length}function Cd(e,t){return Nt(e,{disabledIndices:t})}function Mb(e,t){return Nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&za(i,a,o));return a}function sN(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===Ed){if(u&&It(n),c===-1)d=l;else if(d=Nt(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const f=c%s,h=l%s,m=l-(h-f);h===f?d=l:d=h>f?m:m-s}ui(e,d)&&(d=c)}if(n.key===ci&&(u&&It(n),c===-1?d=a:(d=Nt(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=Nt(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),ui(e,d)&&(d=c)),r==="both"){const f=Ro(c/s);n.key===Uo&&(u&&It(n),c%s!==s-1?(d=Nt(e,{startingIndex:c,disabledIndices:i}),o&&Wa(d,s,f)&&(d=Nt(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=Nt(e,{startingIndex:c-c%s-1,disabledIndices:i})),Wa(d,s,f)&&(d=c)),n.key===Ho&&(u&&It(n),c%s!==0?(d=Nt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&Wa(d,s,f)&&(d=Nt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=Nt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Wa(d,s,f)&&(d=c));const h=Ro(l/s)===f;ui(e,d)&&(o&&h?d=n.key===Ho?l:Nt(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function iN(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let f=0;f<l;f++)u.push(o+d+f*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function aN(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function lN(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function za(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let Nb=0;function ur(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Nb);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Nb=requestAnimationFrame(s)}var _e=typeof document<"u"?w.useLayoutEffect:w.useEffect;function cN(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function uN(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const Lb=P.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function dN(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=P.useState(()=>new Map),i=P.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=P.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return _e(()=>{const l=new Map(o);Array.from(l.keys()).sort(cN).forEach((u,d)=>{l.set(u,d)}),uN(o,l)||s(l)},[o]),P.createElement(Lb.Provider,{value:P.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Fb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=P.useContext(Lb),[a,l]=P.useState(null),c=P.useRef(null),u=P.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var f;const h=t!==void 0;i.current[a]=h?t:(f=d==null?void 0:d.textContent)!=null?f:null}},[a,s,i,t]);return _e(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),_e(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),P.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(this,arguments)}let Vb=!1,fN=0;const $b=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fN++;function hN(){const[e,t]=P.useState(()=>Vb?$b():void 0);return _e(()=>{e==null&&t($b())},[]),P.useEffect(()=>{Vb=!0},[]),e}const Yo=Db.useId||hN;let di;process.env.NODE_ENV!=="production"&&(di=new Set);function Ha(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=di)!=null&&e.has(o))){var s;(s=di)==null||s.add(o),console.warn(o)}}function pN(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=di)!=null&&e.has(o))){var s;(s=di)==null||s.add(o),console.error(o)}}const Rb=P.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:f,style:{transform:h,...m}={},...p}=t;process.env.NODE_ENV!=="production"&&(n||Ha("The `ref` prop is required for `FloatingArrow`."));const v=Yo(),[b,y]=P.useState(!1);if(_e(()=>{if(!o)return;Kt(o).direction==="rtl"&&y(!0)},[o]),!o)return null;const g=c*2,T=g/2,S=i/2*(l/-8+1),E=a/2*l/4,[C,I]=r.split("-"),A=!!f,O=C==="top"||C==="bottom",L=u&&I==="end"?"bottom":"top";let _=u&&I==="end"?"right":"left";u&&b&&(_=I==="end"?"left":"right");const V=(s==null?void 0:s.x)!=null?u||s.x:"",k=(s==null?void 0:s.y)!=null?u||s.y:"",M=f||"M0,0"+(" H"+i)+(" L"+(i-S)+","+(a-E))+(" Q"+i/2+","+a+" "+S+","+(a-E))+" Z",F={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[C];return P.createElement("svg",Go({},p,{"aria-hidden":!0,ref:n,width:A?i:i+g,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[_]:V,[L]:k,[C]:O||A?"100%":"calc(100% - "+g/2+"px)",transform:""+F+(h??""),...m}}),g>0&&P.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:d,strokeWidth:g+(f?0:1),d:M}),P.createElement("path",{stroke:g&&!f?p.fill:"none",d:M}),P.createElement("clipPath",{id:v},P.createElement("rect",{x:-T,y:T*(A?-1:1),width:i+g,height:i})))});function Bb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const jb=P.createContext(null),Wb=P.createContext(null),dr=()=>{var e;return((e=P.useContext(jb))==null?void 0:e.id)||null},fr=()=>P.useContext(Wb);function mN(e){const t=Yo(),n=fr(),o=dr();return _e(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function gN(e){const{children:t,id:n}=e,r=dr();return P.createElement(jb.Provider,{value:P.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function yN(e){const{children:t}=e,n=P.useRef([]),r=P.useCallback(i=>{n.current=[...n.current,i]},[]),o=P.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=P.useState(()=>Bb())[0];return P.createElement(Wb.Provider,{value:P.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function hr(e){return"data-floating-ui-"+e}function At(e){const t=w.useRef(e);return _e(()=>{t.current=e}),t}const zb=hr("safe-polygon");function Pd(e,t,n){return n&&!$o(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Hb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,h=fr(),m=dr(),p=At(c),v=At(l),b=At(n),y=P.useRef(),g=P.useRef(-1),T=P.useRef(),S=P.useRef(-1),E=P.useRef(!0),C=P.useRef(!1),I=P.useRef(()=>{}),A=P.useCallback(()=>{var M;const F=(M=o.current.openEvent)==null?void 0:M.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[o]);P.useEffect(()=>{if(!a)return;function M(F){let{open:N}=F;N||(clearTimeout(g.current),clearTimeout(S.current),E.current=!0)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[a,s]),P.useEffect(()=>{if(!a||!p.current||!n)return;function M(N){A()&&r(!1,N,"hover")}const F=Et(i.floating).documentElement;return F.addEventListener("mouseleave",M),()=>{F.removeEventListener("mouseleave",M)}},[i.floating,n,r,a,p,A]);const O=P.useCallback(function(M,F,N){F===void 0&&(F=!0),N===void 0&&(N="hover");const R=Pd(v.current,"close",y.current);R&&!T.current?(clearTimeout(g.current),g.current=window.setTimeout(()=>r(!1,M,N),R)):F&&(clearTimeout(g.current),r(!1,M,N))},[v,r]),L=bt(()=>{I.current(),T.current=void 0}),_=bt(()=>{if(C.current){const M=Et(i.floating).body;M.style.pointerEvents="",M.removeAttribute(zb),C.current=!1}});P.useEffect(()=>{if(!a)return;function M(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function F(D){if(clearTimeout(g.current),E.current=!1,u&&!$o(y.current)||d>0&&!Pd(v.current,"open"))return;const B=Pd(v.current,"open",y.current);B?g.current=window.setTimeout(()=>{b.current||r(!0,D,"hover")},B):r(!0,D,"hover")}function N(D){if(M())return;I.current();const B=Et(i.floating);if(clearTimeout(S.current),p.current&&o.current.floatingContext){n||clearTimeout(g.current),T.current=p.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){_(),L(),O(D,!0,"safe-polygon")}});const oe=T.current;B.addEventListener("mousemove",oe),I.current=()=>{B.removeEventListener("mousemove",oe)};return}(y.current==="touch"?!ct(i.floating,D.relatedTarget):!0)&&O(D)}function R(D){M()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:D.clientX,y:D.clientY,onClose(){_(),L(),O(D)}})(D))}if(Ge(i.domReference)){var z;const D=i.domReference;return n&&D.addEventListener("mouseleave",R),(z=i.floating)==null||z.addEventListener("mouseleave",R),f&&D.addEventListener("mousemove",F,{once:!0}),D.addEventListener("mouseenter",F),D.addEventListener("mouseleave",N),()=>{var B;n&&D.removeEventListener("mouseleave",R),(B=i.floating)==null||B.removeEventListener("mouseleave",R),f&&D.removeEventListener("mousemove",F),D.removeEventListener("mouseenter",F),D.removeEventListener("mouseleave",N)}}},[i,a,e,u,d,f,O,L,_,r,n,b,h,v,p,o]),_e(()=>{var M;if(a&&n&&(M=p.current)!=null&&M.__options.blockPointerEvents&&A()){const N=Et(i.floating).body;N.setAttribute(zb,""),N.style.pointerEvents="none",C.current=!0;const R=i.floating;if(Ge(i.domReference)&&R){var F;const z=i.domReference,D=h==null||(F=h.nodesRef.current.find(B=>B.id===m))==null||(F=F.context)==null?void 0:F.elements.floating;return D&&(D.style.pointerEvents=""),z.style.pointerEvents="auto",R.style.pointerEvents="auto",()=>{z.style.pointerEvents="",R.style.pointerEvents=""}}}},[a,n,m,i,h,p,A]),_e(()=>{n||(y.current=void 0,L(),_())},[n,L,_]),P.useEffect(()=>()=>{L(),clearTimeout(g.current),clearTimeout(S.current),_()},[a,i.domReference,L,_]);const V=P.useMemo(()=>{function M(F){y.current=F.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(F){const{nativeEvent:N}=F;function R(){!E.current&&!b.current&&r(!0,N,"hover")}u&&!$o(y.current)||n||d===0||(clearTimeout(S.current),y.current==="touch"?R():S.current=window.setTimeout(R,d))}}},[u,r,n,b,d]),k=P.useMemo(()=>({onMouseEnter(){clearTimeout(g.current)},onMouseLeave(M){O(M.nativeEvent,!1)}}),[O]);return P.useMemo(()=>a?{reference:V,floating:k}:{},[a,V,k])}function vN(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function $r(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function bN(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),$r(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let qo=new WeakMap,Ua=new WeakSet,Ga={},kd=0;const wN=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ub=e=>e&&(e.host||Ub(e.parentNode)),xN=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ub(n);return e.contains(r)?r:null}).filter(n=>n!=null);function SN(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=xN(t,e),a=new Set,l=new Set(i),c=[];Ga[o]||(Ga[o]=new WeakMap);const u=Ga[o];i.forEach(d),f(t),a.clear();function d(h){!h||a.has(h)||(a.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,m=>{if(sr(m)!=="script")if(a.has(m))f(m);else{const p=s?m.getAttribute(s):null,v=p!==null&&p!=="false",b=(qo.get(m)||0)+1,y=(u.get(m)||0)+1;qo.set(m,b),u.set(m,y),c.push(m),b===1&&v&&Ua.add(m),y===1&&m.setAttribute(o,""),!v&&s&&m.setAttribute(s,"true")}})}return kd++,()=>{c.forEach(h=>{const m=(qo.get(h)||0)-1,p=(u.get(h)||0)-1;qo.set(h,m),u.set(h,p),m||(!Ua.has(h)&&s&&h.removeAttribute(s),Ua.delete(h)),p||h.removeAttribute(o)}),kd--,kd||(qo=new WeakMap,qo=new WeakMap,Ua=new WeakSet,Ga={})}}function Gb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Et(e[0]).body;return SN(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ko=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yb(e,t){const n=ii(e,Ko());t==="prev"&&n.reverse();const r=n.indexOf(un(Et(e)));return n.slice(r+1)[0]}function qb(){return Yb(document.body,"next")}function Kb(){return Yb(document.body,"prev")}function fi(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ct(n,r)}function TN(e){ii(e,Ko()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function EN(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function CN(e,t,n){const r=e.indexOf(t);function o(i){const a=hr("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||ct(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const Id={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let PN;function Zb(e){e.key==="Tab"&&(e.target,clearTimeout(PN))}const Ya=P.forwardRef(function(t,n){const[r,o]=P.useState();_e(()=>(cd()&&o("button"),document.addEventListener("keydown",Zb),()=>{document.removeEventListener("keydown",Zb)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[hr("focus-guard")]:"",style:Id};return P.createElement("span",Go({},t,s))}),Xb=P.createContext(null),Qb=hr("portal");function kN(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Yo(),o=Jb(),[s,i]=P.useState(null),a=P.useRef(null);return _e(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),_e(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Qb,""),l.appendChild(c),a.current=c,i(c)},[t,r]),_e(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Ge(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Qb,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Rr(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=kN({id:n,root:r}),[i,a]=P.useState(null),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),f=!!i&&!i.modal&&i.open&&o&&!!(r||s);return P.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function h(m){s&&fi(m)&&(m.type==="focusin"?EN:TN)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,o,i==null?void 0:i.modal]),P.createElement(Xb.Provider,{value:P.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},f&&s&&P.createElement(Ya,{"data-type":"outside",ref:l,onFocus:h=>{if(fi(h,s)){var m;(m=u.current)==null||m.focus()}else{const p=Kb()||(i==null?void 0:i.refs.domReference.current);p==null||p.focus()}}}),f&&s&&P.createElement("span",{"aria-owns":s.id,style:Id}),s&&Ss.createPortal(t,s),f&&s&&P.createElement(Ya,{"data-type":"outside",ref:c,onFocus:h=>{if(fi(h,s)){var m;(m=d.current)==null||m.focus()}else{const p=qb()||(i==null?void 0:i.refs.domReference.current);p==null||p.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,h.nativeEvent))}}}))}const Jb=()=>P.useContext(Xb),e0=20;let Br=[];function Ad(e){Br=Br.filter(n=>n.isConnected);let t=e;if(!(!t||sr(t)==="body")){if(!IM(t,Ko())){const n=ii(t,Ko())[0];n&&(t=n)}Br.push(t),Br.length>e0&&(Br=Br.slice(-e0))}}function t0(){return Br.slice().reverse().find(e=>e.isConnected)}const IN=P.forwardRef(function(t,n){return P.createElement("button",Go({},t,{type:"button",ref:n,tabIndex:-1,style:Id}))});function Zo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:m,onOpenChange:p,events:v,dataRef:b,floatingId:y,elements:{domReference:g,floating:T}}=t,S=typeof i=="number"&&i<0,E=ub(g)&&S,C=wN()?s:!0,I=At(o),A=At(i),O=At(a),L=fr(),_=Jb(),V=P.useRef(null),k=P.useRef(null),M=P.useRef(!1),F=P.useRef(!1),N=P.useRef(-1),R=_!=null,z=T==null?void 0:T.firstElementChild,D=(z==null?void 0:z.id)===y?z:T,B=bt(function(G){return G===void 0&&(G=D),G?ii(G,Ko()):[]}),Z=bt(G=>{const $=B(G);return I.current.map(j=>g&&j==="reference"?g:D&&j==="floating"?D:$).filter(Boolean).flat()});P.useEffect(()=>{if(r||!c)return;function G(j){if(j.key==="Tab"){ct(D,un(Et(D)))&&B().length===0&&!E&&It(j);const H=Z(),Y=Cn(j);I.current[0]==="reference"&&Y===g&&(It(j),j.shiftKey?ur(H[H.length-1]):ur(H[1])),I.current[1]==="floating"&&Y===D&&j.shiftKey&&(It(j),ur(H[0]))}}const $=Et(D);return $.addEventListener("keydown",G),()=>{$.removeEventListener("keydown",G)}},[r,g,D,c,I,E,B,Z]),P.useEffect(()=>{if(r||!T)return;function G($){const j=Cn($),Y=B().indexOf(j);Y!==-1&&(N.current=Y)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,B]),P.useEffect(()=>{if(r||!d)return;function G(){F.current=!0,setTimeout(()=>{F.current=!1})}function $(j){const H=j.relatedTarget;queueMicrotask(()=>{const Y=!(ct(g,H)||ct(T,H)||ct(H,T)||ct(_==null?void 0:_.portalNode,H)||H!=null&&H.hasAttribute(hr("focus-guard"))||L&&($r(L.nodesRef.current,m).find(Q=>{var fe,U;return ct((fe=Q.context)==null?void 0:fe.elements.floating,H)||ct((U=Q.context)==null?void 0:U.elements.domReference,H)})||vN(L.nodesRef.current,m).find(Q=>{var fe,U;return((fe=Q.context)==null?void 0:fe.elements.floating)===H||((U=Q.context)==null?void 0:U.elements.domReference)===H})));if(l&&Y&&un(Et(D))===Et(D).body){gt(D)&&(D==null||D.focus());const Q=N.current,fe=B(),U=fe[Q]||fe[fe.length-1]||D;gt(U)&&U.focus()}(E||!c)&&H&&Y&&!F.current&&H!==t0()&&(M.current=!0,p(!1,j))})}if(T&&gt(g))return g.addEventListener("focusout",$),g.addEventListener("pointerdown",G),T.addEventListener("focusout",$),()=>{g.removeEventListener("focusout",$),g.removeEventListener("pointerdown",G),T.removeEventListener("focusout",$)}},[r,g,T,D,c,m,L,_,p,d,l,B,E]),P.useEffect(()=>{var G;if(r)return;const $=Array.from((_==null||(G=_.portalNode)==null?void 0:G.querySelectorAll("["+hr("portal")+"]"))||[]);if(T){const j=[T,...$,V.current,k.current,I.current.includes("reference")||E?g:null].filter(Y=>Y!=null),H=c||E?Gb(j,C,!C):Gb(j);return()=>{H()}}},[r,g,T,c,I,_,E,C]),_e(()=>{if(r||!gt(D))return;const G=Et(D),$=un(G);queueMicrotask(()=>{const j=Z(D),H=A.current,Y=(typeof H=="number"?j[H]:H.current)||D,Q=ct(D,$);!S&&!Q&&f&&ur(Y,{preventScroll:Y===D})})},[r,f,D,S,Z,A]),_e(()=>{if(r||!D)return;let G=!1;const $=Et(D),j=un($);let Y=b.current.openEvent;const Q=h.domReference.current;Ad(j);function fe(U){let{open:Ae,reason:Ke,event:Be,nested:Ce}=U;Ae&&(Y=Be),Ke==="escape-key"&&h.domReference.current&&Ad(h.domReference.current),Ke==="hover"&&Be.type==="mouseleave"&&(M.current=!0),Ke==="outside-press"&&(Ce?(M.current=!1,G=!0):M.current=!(lb(Be)||ld(Be)))}return v.on("openchange",fe),()=>{v.off("openchange",fe);const U=un($),Ae=ct(T,U)||L&&$r(L.nodesRef.current,m).some(q=>{var ie;return ct((ie=q.context)==null?void 0:ie.elements.floating,U)});(Ae||Y&&["click","mousedown"].includes(Y.type))&&h.domReference.current&&Ad(h.domReference.current);const Be=Q||j,Ce=ii(Et(Be).body,Ko());queueMicrotask(()=>{let q=t0();!q&&gt(Be)&&T&&(q=CN(Ce,Be,T)),O.current&&!M.current&&gt(q)&&(!(q!==U&&U!==$.body)||Ae)&&q.focus({preventScroll:G})})}},[r,T,D,O,b,h,v,L,m]),_e(()=>{if(!r&&_)return _.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:p,refs:h}),()=>{_.setFocusManagerState(null)}},[r,_,c,f,p,h,d]),_e(()=>{if(r||!D||typeof MutationObserver!="function"||S)return;const G=()=>{const j=D.getAttribute("tabindex"),H=B(),Y=un(Et(T)),Q=H.indexOf(Y);Q!==-1&&(N.current=Q),I.current.includes("floating")||Y!==h.domReference.current&&H.length===0?j!=="0"&&D.setAttribute("tabindex","0"):j!=="-1"&&D.setAttribute("tabindex","-1")};G();const $=new MutationObserver(G);return $.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{$.disconnect()}},[r,T,D,h,I,B,S]);function oe(G){return r||!u||!c?null:P.createElement(IN,{ref:G==="start"?V:k,onClick:$=>p(!1,$.nativeEvent)},typeof u=="string"?u:"Dismiss")}const te=!r&&C&&(c?!E:!0)&&(R||c);return P.createElement(P.Fragment,null,te&&P.createElement(Ya,{"data-type":"inside",ref:_==null?void 0:_.beforeInsideRef,onFocus:G=>{if(c){const j=Z();ur(o[0]==="reference"?j[0]:j[j.length-1])}else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(M.current=!1,fi(G,_.portalNode)){const j=qb()||g;j==null||j.focus()}else{var $;($=_.beforeOutsideRef.current)==null||$.focus()}}}),!E&&oe("start"),n,oe("end"),te&&P.createElement(Ya,{"data-type":"inside",ref:_==null?void 0:_.afterInsideRef,onFocus:G=>{if(c)ur(Z()[0]);else if(_!=null&&_.preserveTabOrder&&_.portalNode)if(d&&(M.current=!0),fi(G,_.portalNode)){const j=Kb()||g;j==null||j.focus()}else{var $;($=_.afterOutsideRef.current)==null||$.focus()}}}))}const Od=new Set,AN=P.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=Yo();return _e(()=>{if(!r)return;Od.add(s);const i=/iP(hone|ad|od)|iOS/.test(ad()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,f=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var h,m;const p=((h=window.visualViewport)==null?void 0:h.offsetLeft)||0,v=((m=window.visualViewport)==null?void 0:m.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(f-Math.floor(v))+"px",left:-(d-Math.floor(p))+"px",right:"0"})}return()=>{Od.delete(s),Od.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f)))}},[s,r]),P.createElement("div",Go({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function n0(e){return gt(e.target)&&e.target.tagName==="BUTTON"}function r0(e){return fd(e)}function hi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=P.useRef(),f=P.useRef(!1),h=P.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const p=d.current;m.button===0&&a!=="click"&&($o(p,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const p=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}$o(p,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){d.current=void 0,!(m.defaultPrevented||!u||n0(m))&&(m.key===" "&&!r0(s)&&(m.preventDefault(),f.current=!0),m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||n0(m)||r0(s)||m.key===" "&&f.current&&(f.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return P.useMemo(()=>i?{reference:h}:{},[i,h])}function ON(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,f=i.x,h=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),f-=n||0,h-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,f=a&&t.x!=null?t.x:f,h=l&&t.y!=null?t.y:h):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:f,y:h,top:h,right:f+u,bottom:h+d,left:f}}}}function o0(e){return e!=null&&e.clientX!=null}function _N(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=P.useRef(!1),f=P.useRef(null),[h,m]=P.useState(),[p,v]=P.useState([]),b=bt((E,C)=>{d.current||r.current.openEvent&&!o0(r.current.openEvent)||i.setPositionReference(ON(s,{x:E,y:C,axis:l,dataRef:r,pointerType:h}))}),y=bt(E=>{c!=null||u!=null||(n?f.current||v([]):b(E.clientX,E.clientY))}),g=$o(h)?o:n,T=P.useCallback(()=>{if(!g||!a||c!=null||u!=null)return;const E=Rt(o);function C(I){const A=Cn(I);ct(o,A)?(E.removeEventListener("mousemove",C),f.current=null):b(I.clientX,I.clientY)}if(!r.current.openEvent||o0(r.current.openEvent)){E.addEventListener("mousemove",C);const I=()=>{E.removeEventListener("mousemove",C),f.current=null};return f.current=I,I}i.setPositionReference(s)},[g,a,c,u,o,r,i,s,b]);P.useEffect(()=>T(),[T,p]),P.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),P.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),_e(()=>{a&&(c!=null||u!=null)&&(d.current=!1,b(c,u))},[a,c,u,b]);const S=P.useMemo(()=>{function E(C){let{pointerType:I}=C;m(I)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:y,onMouseEnter:y}},[y]);return P.useMemo(()=>a?{reference:S}:{},[a,S])}const DN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},MN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},s0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function jr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:m}=t,p=fr(),v=bt(typeof l=="function"?l:()=>!1),b=typeof l=="function"?v:l,y=P.useRef(!1),g=P.useRef(!1),{escapeKey:T,outsidePress:S}=s0(h),{escapeKey:E,outsidePress:C}=s0(m),I=bt(k=>{var M;if(!n||!i||!a||k.key!=="Escape")return;const F=(M=s.current.floatingContext)==null?void 0:M.nodeId,N=p?$r(p.nodesRef.current,F):[];if(!T&&(k.stopPropagation(),N.length>0)){let R=!0;if(N.forEach(z=>{var D;if((D=z.context)!=null&&D.open&&!z.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,eM(k)?k.nativeEvent:k,"escape-key")}),A=bt(k=>{var M;const F=()=>{var N;I(k),(N=Cn(k))==null||N.removeEventListener("keydown",F)};(M=Cn(k))==null||M.addEventListener("keydown",F)}),O=bt(k=>{var M;const F=y.current;y.current=!1;const N=g.current;if(g.current=!1,c==="click"&&N||F||typeof b=="function"&&!b(k))return;const R=Cn(k),z="["+hr("inert")+"]",D=Et(o.floating).querySelectorAll(z);let B=Ge(R)?R:null;for(;B&&!ir(B);){const G=zn(B);if(ir(G)||!Ge(G))break;B=G}if(D.length&&Ge(R)&&!tM(R)&&!ct(R,o.floating)&&Array.from(D).every(G=>!ct(B,G)))return;if(gt(R)&&V){const G=R.clientWidth>0&&R.scrollWidth>R.clientWidth,$=R.clientHeight>0&&R.scrollHeight>R.clientHeight;let j=$&&k.offsetX>R.clientWidth;if($&&Kt(R).direction==="rtl"&&(j=k.offsetX<=R.offsetWidth-R.clientWidth),j||G&&k.offsetY>R.clientHeight)return}const Z=(M=s.current.floatingContext)==null?void 0:M.nodeId,oe=p&&$r(p.nodesRef.current,Z).some(G=>{var $;return dd(k,($=G.context)==null?void 0:$.elements.floating)});if(dd(k,o.floating)||dd(k,o.domReference)||oe)return;const te=p?$r(p.nodesRef.current,Z):[];if(te.length>0){let G=!0;if(te.forEach($=>{var j;if((j=$.context)!=null&&j.open&&!$.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,k,"outside-press")}),L=bt(k=>{var M;const F=()=>{var N;O(k),(N=Cn(k))==null||N.removeEventListener(c,F)};(M=Cn(k))==null||M.addEventListener(c,F)});P.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=S;function k(N){r(!1,N,"ancestor-scroll")}const M=Et(o.floating);a&&M.addEventListener("keydown",E?A:I,E),b&&M.addEventListener(c,C?L:O,C);let F=[];return f&&(Ge(o.domReference)&&(F=ar(o.domReference)),Ge(o.floating)&&(F=F.concat(ar(o.floating))),!Ge(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(ar(o.reference.contextElement)))),F=F.filter(N=>{var R;return N!==((R=M.defaultView)==null?void 0:R.visualViewport)}),F.forEach(N=>{N.addEventListener("scroll",k,{passive:!0})}),()=>{a&&M.removeEventListener("keydown",E?A:I,E),b&&M.removeEventListener(c,C?L:O,C),F.forEach(N=>{N.removeEventListener("scroll",k)})}},[s,o,a,b,c,n,r,f,i,T,S,I,E,A,O,C,L]),P.useEffect(()=>{y.current=!1},[b,c]);const _=P.useMemo(()=>({onKeyDown:I,[DN[d]]:k=>{u&&r(!1,k.nativeEvent,"reference-press")}}),[I,r,u,d]),V=P.useMemo(()=>({onKeyDown:I,onMouseDown(){g.current=!0},onMouseUp(){g.current=!0},[MN[c]]:()=>{y.current=!0}}),[I,c]);return P.useMemo(()=>i?{reference:_,floating:V}:{},[i,_,V])}function NN(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Yo(),s=P.useRef({}),[i]=P.useState(()=>Bb()),a=dr()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Ge(h)&&pN("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=P.useState(r.reference),u=bt((h,m,p)=>{s.current.openEvent=h?m:void 0,i.emit("openchange",{open:h,event:m,reason:p,nested:a}),n==null||n(h,m,p)}),d=P.useMemo(()=>({setPositionReference:c}),[]),f=P.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return P.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}function Wr(e){e===void 0&&(e={});const{nodeId:t}=e,n=NN({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=P.useState(null),[a,l]=P.useState(null),u=(o==null?void 0:o.reference)||s,d=P.useRef(null),f=fr();_e(()=>{u&&(d.current=u)},[u]);const h=nN({...e,elements:{...o,...a&&{reference:a}}}),m=P.useCallback(g=>{const T=Ge(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),contextElement:g}:g;l(T),h.refs.setReference(T)},[h.refs]),p=P.useCallback(g=>{(Ge(g)||g===null)&&(d.current=g,i(g)),(Ge(h.refs.reference.current)||h.refs.reference.current===null||g!==null&&!Ge(g))&&h.refs.setReference(g)},[h.refs]),v=P.useMemo(()=>({...h.refs,setReference:p,setPositionReference:m,domReference:d}),[h.refs,p,m]),b=P.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=P.useMemo(()=>({...h,...r,refs:v,elements:b,nodeId:t}),[h,v,b,t,r]);return _e(()=>{r.dataRef.current.floatingContext=y;const g=f==null?void 0:f.nodesRef.current.find(T=>T.id===t);g&&(g.context=y)}),P.useMemo(()=>({...h,context:y,refs:v,elements:b}),[h,v,b,y])}function LN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=P.useRef(!1),u=P.useRef(),d=P.useRef(!0);P.useEffect(()=>{if(!a)return;const h=Rt(i.domReference);function m(){!n&&gt(i.domReference)&&i.domReference===un(Et(i.domReference))&&(c.current=!0)}function p(){d.current=!0}return h.addEventListener("blur",m),h.addEventListener("keydown",p,!0),()=>{h.removeEventListener("blur",m),h.removeEventListener("keydown",p,!0)}},[i.domReference,n,a]),P.useEffect(()=>{if(!a)return;function h(m){let{reason:p}=m;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),P.useEffect(()=>()=>{clearTimeout(u.current)},[]);const f=P.useMemo(()=>({onPointerDown(h){ld(h.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const m=Cn(h.nativeEvent);if(l&&Ge(m))try{if(cd()&&cb())throw Error();if(!m.matches(":focus-visible"))return}catch{if(!d.current&&!fd(m))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const m=h.relatedTarget,p=h.nativeEvent,v=Ge(m)&&m.hasAttribute(hr("focus-guard"))&&m.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var b;const y=un(i.domReference?i.domReference.ownerDocument:document);!m&&y===i.domReference||ct((b=s.current.floatingContext)==null?void 0:b.refs.floating.current,y)||ct(i.domReference,y)||v||r(!1,p,"focus")})}}),[s,i.domReference,r,l]);return P.useMemo(()=>a?{reference:f}:{},[a,f])}const i0="active",a0="selected";function _d(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[i0]:i,[a0]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[i0,a0].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var f,h=arguments.length,m=new Array(h),p=0;p<h;p++)m[p]=arguments[p];return(f=r.get(c))==null?void 0:f.map(v=>v(...m)).find(v=>v!==void 0)}}}else i[c]=u}),i),{})}}function zr(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=P.useCallback(a=>_d(a,e,"reference"),t),s=P.useCallback(a=>_d(a,e,"floating"),n),i=P.useCallback(a=>_d(a,e,"item"),r);return P.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let l0=!1;function qa(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function c0(e,t){return qa(t,e===Ed||e===ci,e===Ho||e===Uo)}function Dd(e,t,n){return qa(t,e===ci,n?e===Ho:e===Uo)||e==="Enter"||e===" "||e===""}function FN(e,t,n){return qa(t,n?e===Ho:e===Uo,e===ci)}function u0(e,t,n){return qa(t,n?e===Uo:e===Ho,e===Ed)}function Md(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:y=void 0,orientation:g="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:C,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||Ha("`useListNavigation` looping must be enabled to allow escaping."),m||Ha("`useListNavigation` must be virtual to allow escaping.")),g==="vertical"&&T>1&&Ha("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const A=dr(),O=fr(),L=bt(a),_=P.useRef(p),V=P.useRef(c??-1),k=P.useRef(null),M=P.useRef(!0),F=P.useRef(L),N=P.useRef(!!o.floating),R=P.useRef(n),z=P.useRef(!1),D=P.useRef(!1),B=At(y),Z=At(n),oe=At(S),te=At(o.floating),G=At(c),[$,j]=P.useState(),[H,Y]=P.useState(),Q=bt(function(q,ie,W){W===void 0&&(W=!1);function ee(ue){m?(j(ue.id),O==null||O.events.emit("virtualfocus",ue),E&&(E.current=ue)):ur(ue,{preventScroll:!0,sync:cb()&&cd()?l0||z.current:!1})}const ye=q.current[ie.current];ye&&ee(ye),requestAnimationFrame(()=>{const ue=q.current[ie.current]||ye;if(!ue)return;ye||ee(ue);const je=oe.current;je&&U&&(W||!M.current)&&(ue.scrollIntoView==null||ue.scrollIntoView(typeof je=="boolean"?{block:"nearest",inline:"nearest"}:je))})});_e(()=>{document.createElement("div").focus({get preventScroll(){return l0=!0,!1}})},[]),_e(()=>{l&&(n&&o.floating?_.current&&c!=null&&(D.current=!0,V.current=c,L(c)):N.current&&(V.current=-1,F.current(null)))},[l,n,o.floating,c,L]),_e(()=>{if(l&&n&&o.floating)if(i==null){if(z.current=!1,G.current!=null)return;if(N.current&&(V.current=-1,Q(s,V)),(!R.current||!N.current)&&_.current&&(k.current!=null||_.current===!0&&k.current==null)){let q=0;const ie=()=>{s.current[0]==null?(q<2&&(q?requestAnimationFrame:queueMicrotask)(ie),q++):(V.current=k.current==null||Dd(k.current,g,h)||f?Cd(s,B.current):Mb(s,B.current),k.current=null,L(V.current))};ie()}}else ui(s,i)||(V.current=i,Q(s,V,D.current),D.current=!1)},[l,n,o.floating,i,G,f,s,g,h,L,Q,B]),_e(()=>{var q;if(!l||o.floating||!O||m||!N.current)return;const ie=O.nodesRef.current,W=(q=ie.find(ue=>ue.id===A))==null||(q=q.context)==null?void 0:q.elements.floating,ee=un(Et(o.floating)),ye=ie.some(ue=>ue.context&&ct(ue.context.elements.floating,ee));W&&!ye&&M.current&&W.focus({preventScroll:!0})},[l,o.floating,O,A,m]),_e(()=>{if(!l||!O||!m||A)return;function q(ie){Y(ie.id),E&&(E.current=ie)}return O.events.on("virtualfocus",q),()=>{O.events.off("virtualfocus",q)}},[l,O,m,A,E]),_e(()=>{F.current=L,N.current=!!o.floating}),_e(()=>{n||(k.current=null)},[n]),_e(()=>{R.current=n},[n]);const fe=i!=null,U=P.useMemo(()=>{function q(W){if(!n)return;const ee=s.current.indexOf(W);ee!==-1&&L(ee)}return{onFocus(W){let{currentTarget:ee}=W;q(ee)},onClick:W=>{let{currentTarget:ee}=W;return ee.focus({preventScroll:!0})},...v&&{onMouseMove(W){let{currentTarget:ee}=W;q(ee)},onPointerLeave(W){let{pointerType:ee}=W;!M.current||ee==="touch"||(V.current=-1,Q(s,V),L(null),m||ur(te.current,{preventScroll:!0}))}}}},[n,te,Q,v,s,L,m]),Ae=bt(q=>{if(M.current=!1,z.current=!0,!Z.current&&q.currentTarget===te.current)return;if(f&&u0(q.key,g,h)){It(q),r(!1,q.nativeEvent,"list-navigation"),gt(o.domReference)&&!m&&o.domReference.focus();return}const ie=V.current,W=Cd(s,y),ee=Mb(s,y);if(q.key==="Home"&&(It(q),V.current=W,L(V.current)),q.key==="End"&&(It(q),V.current=ee,L(V.current)),T>1){const ye=C||Array.from({length:s.current.length},()=>({width:1,height:1})),ue=iN(ye,T,I),je=ue.findIndex(le=>le!=null&&!za(s.current,le,y)),ne=ue.reduce((le,Ne,tt)=>Ne!=null&&!za(s.current,Ne,y)?tt:le,-1);if(V.current=ue[sN({current:ue.map(le=>le!=null?s.current[le]:null)},{event:q,orientation:g,loop:d,cols:T,disabledIndices:lN([...y||s.current.map((le,Ne)=>za(s.current,Ne)?Ne:void 0),void 0],ue),minIndex:je,maxIndex:ne,prevIndex:aN(V.current>ee?W:V.current,ye,ue,T,q.key===ci?"bl":q.key===Uo?"tr":"tl"),stopEvent:!0})],L(V.current),g==="both")return}if(c0(q.key,g)){if(It(q),n&&!m&&un(q.currentTarget.ownerDocument)===q.currentTarget){V.current=Dd(q.key,g,h)?W:ee,L(V.current);return}Dd(q.key,g,h)?d?V.current=ie>=ee?u&&ie!==s.current.length?-1:W:Nt(s,{startingIndex:ie,disabledIndices:y}):V.current=Math.min(ee,Nt(s,{startingIndex:ie,disabledIndices:y})):d?V.current=ie<=W?u&&ie!==-1?s.current.length:ee:Nt(s,{startingIndex:ie,decrement:!0,disabledIndices:y}):V.current=Math.max(W,Nt(s,{startingIndex:ie,decrement:!0,disabledIndices:y})),ui(s,V.current)?L(null):L(V.current)}}),Ke=P.useMemo(()=>m&&n&&fe&&{"aria-activedescendant":H||$},[m,n,fe,H,$]),Be=P.useMemo(()=>({"aria-orientation":g==="both"?void 0:g,...!ub(o.domReference)&&Ke,onKeyDown:Ae,onPointerMove(){M.current=!0}}),[Ke,Ae,o.domReference,g]),Ce=P.useMemo(()=>{function q(W){p==="auto"&&lb(W.nativeEvent)&&(_.current=!0)}function ie(W){_.current=p,p==="auto"&&ld(W.nativeEvent)&&(_.current=!0)}return{...Ke,onKeyDown(W){M.current=!1;const ee=W.key.indexOf("Arrow")===0,ye=FN(W.key,g,h),ue=u0(W.key,g,h),je=c0(W.key,g),ne=(f?ye:je)||W.key==="Enter"||W.key.trim()==="";if(m&&n){const Ot=O==null?void 0:O.nodesRef.current.find(Wt=>Wt.parentId==null),Vt=O&&Ot?bN(O.nodesRef.current,Ot.id):null;if(ee&&Vt&&E){const Wt=new KeyboardEvent("keydown",{key:W.key,bubbles:!0});if(ye||ue){var le,Ne;const ro=((le=Vt.context)==null?void 0:le.elements.domReference)===W.currentTarget,bs=ue&&!ro?(Ne=Vt.context)==null?void 0:Ne.elements.domReference:ye?s.current.find(ws=>(ws==null?void 0:ws.id)===$):null;bs&&(It(W),bs.dispatchEvent(Wt),Y(void 0))}if(je&&Vt.context&&Vt.context.open&&Vt.parentId&&W.currentTarget!==Vt.context.elements.domReference){var tt;It(W),(tt=Vt.context.elements.domReference)==null||tt.dispatchEvent(Wt);return}}return Ae(W)}if(!(!n&&!b&&ee)){if(ne&&(k.current=f&&je?null:W.key),f){ye&&(It(W),n?(V.current=Cd(s,B.current),L(V.current)):r(!0,W.nativeEvent,"list-navigation"));return}je&&(c!=null&&(V.current=c),It(W),!n&&b?r(!0,W.nativeEvent,"list-navigation"):Ae(W),n&&L(V.current))}},onFocus(){n&&!m&&L(null)},onPointerDown:ie,onMouseDown:q,onClick:q}},[$,Ke,Ae,B,p,s,f,L,r,n,b,g,h,c,O,m,E]);return P.useMemo(()=>l?{reference:Ce,floating:Be,item:U}:{},[l,Ce,Be,U])}const VN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Hr(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=VN.get(i))!=null?n:i,l=Yo(),u=dr()!=null,d=P.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),f=P.useMemo(()=>{const m={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?m:{...m,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),h=P.useCallback(m=>{let{active:p,selected:v}=m;const b={role:"option",...p&&{id:o+"-option"}};switch(i){case"select":return{...b,"aria-selected":p&&v};case"combobox":return{...b,...p&&{"aria-selected":!0}}}return{}},[o,i]);return P.useMemo(()=>s?{reference:d,floating:f,item:h}:{},[s,d,f,h])}const d0=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Xo(e,t){return typeof e=="function"?e(t):e}function $N(e,t){const[n,r]=P.useState(e);return e&&!n&&r(!0),P.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function RN(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=P.useState("unmounted"),c=$N(n,i);return!c&&a==="close"&&l("unmounted"),_e(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function f0(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=P.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,f=(u?i:i.close)||0,[h,m]=P.useState(()=>({...Xo(s,c),...Xo(n,c)})),{isMounted:p,status:v}=RN(e,{duration:i}),b=At(n),y=At(r),g=At(o),T=At(s);return _e(()=>{const S=Xo(b.current,c),E=Xo(g.current,c),C=Xo(T.current,c),I=Xo(y.current,c)||Object.keys(S).reduce((A,O)=>(A[O]="",A),{});if(v==="initial"&&m(A=>({transitionProperty:A.transitionProperty,...C,...S})),v==="open"&&m({transitionProperty:Object.keys(I).map(d0).join(","),transitionDuration:d+"ms",...C,...I}),v==="close"){const A=E||S;m({transitionProperty:Object.keys(A).map(d0).join(","),transitionDuration:f+"ms",...C,...A})}},[f,g,b,y,T,d,v,c]),{isMounted:p,styles:h}}function BN(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:h=null}=t,m=P.useRef(),p=P.useRef(""),v=P.useRef((n=h??i)!=null?n:-1),b=P.useRef(null),y=bt(a),g=bt(l),T=At(u),S=At(f);_e(()=>{r&&(clearTimeout(m.current),b.current=null,p.current="")},[r]),_e(()=>{if(r&&p.current===""){var O;v.current=(O=h??i)!=null?O:-1}},[r,h,i]);const E=bt(O=>{O?o.current.typing||(o.current.typing=O,g(O)):o.current.typing&&(o.current.typing=O,g(O))}),C=bt(O=>{function L(F,N,R){const z=T.current?T.current(N,R):N.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(R.toLocaleLowerCase()))===0);return z?F.indexOf(z):-1}const _=s.current;if(p.current.length>0&&p.current[0]!==" "&&(L(_,_,p.current)===-1?E(!1):O.key===" "&&It(O)),_==null||S.current.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;r&&O.key!==" "&&(It(O),E(!0)),_.every(F=>{var N,R;return F?((N=F[0])==null?void 0:N.toLocaleLowerCase())!==((R=F[1])==null?void 0:R.toLocaleLowerCase()):!0})&&p.current===O.key&&(p.current="",v.current=b.current),p.current+=O.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",v.current=b.current,E(!1)},d);const k=v.current,M=L(_,[..._.slice((k||0)+1),..._.slice(0,(k||0)+1)],p.current);M!==-1?(y(M),b.current=M):O.key!==" "&&(p.current="",E(!1))}),I=P.useMemo(()=>({onKeyDown:C}),[C]),A=P.useMemo(()=>({onKeyDown:C,onKeyUp(O){O.key===" "&&E(!1)}}),[C,E]);return P.useMemo(()=>c?{reference:I,floating:A}:{},[c,I,A])}function h0(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function jN(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function p0(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,f){const h=performance.now(),m=h-l;if(i===null||a===null||m===0)return i=d,a=f,l=h,null;const p=d-i,v=f-a,y=Math.sqrt(p*p+v*v)/m;return i=d,a=f,l=h,y}const u=d=>{let{x:f,y:h,placement:m,elements:p,onClose:v,nodeId:b,tree:y}=d;return function(T){function S(){clearTimeout(o),v()}if(clearTimeout(o),!p.domReference||!p.floating||m==null||f==null||h==null)return;const{clientX:E,clientY:C}=T,I=[E,C],A=Cn(T),O=T.type==="mouseleave",L=ct(p.floating,A),_=ct(p.domReference,A),V=p.domReference.getBoundingClientRect(),k=p.floating.getBoundingClientRect(),M=m.split("-")[0],F=f>k.right-k.width/2,N=h>k.bottom-k.height/2,R=jN(I,V),z=k.width>V.width,D=k.height>V.height,B=(z?V:k).left,Z=(z?V:k).right,oe=(D?V:k).top,te=(D?V:k).bottom;if(L&&(s=!0,!O))return;if(_&&(s=!1),_&&!O){s=!0;return}if(O&&Ge(T.relatedTarget)&&ct(p.floating,T.relatedTarget)||y&&$r(y.nodesRef.current,b).some(j=>{let{context:H}=j;return H==null?void 0:H.open}))return;if(M==="top"&&h>=V.bottom-1||M==="bottom"&&h<=V.top+1||M==="left"&&f>=V.right-1||M==="right"&&f<=V.left+1)return S();let G=[];switch(M){case"top":G=[[B,V.top+1],[B,k.bottom-1],[Z,k.bottom-1],[Z,V.top+1]];break;case"bottom":G=[[B,k.top+1],[B,V.bottom-1],[Z,V.bottom-1],[Z,k.top+1]];break;case"left":G=[[k.right-1,te],[k.right-1,oe],[V.left+1,oe],[V.left+1,te]];break;case"right":G=[[V.right-1,te],[V.right-1,oe],[k.left+1,oe],[k.left+1,te]];break}function $(j){let[H,Y]=j;switch(M){case"top":{const Q=[z?H+t/2:F?H+t*4:H-t*4,Y+t+1],fe=[z?H-t/2:F?H+t*4:H-t*4,Y+t+1],U=[[k.left,F||z?k.bottom-t:k.top],[k.right,F?z?k.bottom-t:k.top:k.bottom-t]];return[Q,fe,...U]}case"bottom":{const Q=[z?H+t/2:F?H+t*4:H-t*4,Y-t],fe=[z?H-t/2:F?H+t*4:H-t*4,Y-t],U=[[k.left,F||z?k.top+t:k.bottom],[k.right,F?z?k.top+t:k.bottom:k.top+t]];return[Q,fe,...U]}case"left":{const Q=[H+t+1,D?Y+t/2:N?Y+t*4:Y-t*4],fe=[H+t+1,D?Y-t/2:N?Y+t*4:Y-t*4];return[...[[N||D?k.right-t:k.left,k.top],[N?D?k.right-t:k.left:k.right-t,k.bottom]],Q,fe]}case"right":{const Q=[H-t,D?Y+t/2:N?Y+t*4:Y-t*4],fe=[H-t,D?Y-t/2:N?Y+t*4:Y-t*4],U=[[N||D?k.left+t:k.right,k.top],[N?D?k.left+t:k.right:k.left+t,k.bottom]];return[Q,fe,...U]}}}if(!h0([E,C],G)){if(s&&!R)return S();if(!O&&r){const j=c(T.clientX,T.clientY);if(j!==null&&j<.1)return S()}h0([E,C],$([f,h]))?!s&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Qo=e=>{const t=w.useId(),[n,r]=w.useState(e.open),o=w.useRef(null),s=w.useMemo(()=>[li(10),Sd({fallbackAxisSideDirection:"end"}),xd(),_b({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Wr({open:n,middleware:s,transform:!0,whileElementsMounted:ai,onOpenChange:(m,p)=>{var b;const v=p==null?void 0:p.relatedTarget;v&&v.dataset.floating==="true"&&!m||(r(m),(b=e.onChange)==null||b.call(e,m))}}),c=hi(l),u=jr(l),d=Hr(l),{getReferenceProps:f,getFloatingProps:h}=zr([c,u,d]);return x.jsxs(w.Fragment,{children:[x.jsx("button",{ref:i.setReference,...f(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(Rr,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(Zo,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...h(),children:[x.jsx(Rb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},WN=e=>{const t=w.useRef(null),n=w.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=w.useState(!1),{context:a,refs:l}=Wr({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=hi(a),u=Hr(a),d=jr(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:f,getReferenceProps:h}=zr([c,u,d]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(go,{...h(e),as:at.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:x.jsx(at.span,{layoutId:o,children:e.trigger})}),x.jsx(er,{children:s?x.jsx(Rr,{root:t,children:x.jsx(Zo,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(at.div,{...f(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},m0=300,zN=500,g0=(e="")=>Me("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary focus:bg-primary aria-expanded:opacity-80","focus:text-primary-foreground hover:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),Nd=w.createContext({isOpen:!1,activeIndex:null,getItemProps:()=>({}),setActiveIndex:()=>{},setHasFocusInside:()=>{}}),y0=w.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const[l,c]=w.useState(!1),[u,d]=w.useState(!1),[f,h]=w.useState(null),m=w.useRef([]),p=w.useRef([]),v=w.useContext(Nd),b=dr(),y=fr(),g=mN(),T=Fb(),S=b!==null,{floatingStyles:E,refs:C,context:I}=Wr({nodeId:g,open:l,transform:!0,strategy:"absolute",onOpenChange:c,whileElementsMounted:ai,placement:S?"right":"bottom-start",middleware:[li({mainAxis:S?0:4,alignmentAxis:S?-4:0}),Sd(),xd()]}),A=Hr(I,{role:"menu",enabled:!0}),O=jr(I,{bubbles:!0}),L=Hb(I,{move:!1,enabled:n,delay:{open:m0},handleClose:p0({blockPointerEvents:!0})}),_=hi(I,{event:"mousedown",toggle:!S,ignoreMouse:S,keyboardHandlers:!0}),V=Md(I,{loop:!0,listRef:m,activeIndex:f,nested:S,onNavigate:h}),k=BN(I,{activeIndex:f,listRef:p,resetMs:zN,onMatch:l?h:void 0}),{getReferenceProps:M,getFloatingProps:F,getItemProps:N}=zr([L,_,A,O,V,k]);w.useEffect(()=>{if(!y)return;function z(){c(!1)}function D(B){B.nodeId!==g&&B.parentId===b&&c(!1)}return y.events.on("click",z),y.events.on("menuopen",D),()=>{y.events.off("click",z),y.events.off("menuopen",D)}},[y,g,b]),w.useEffect(()=>{l&&y&&y.events.emit("menuopen",{parentId:b,nodeId:g})},[y,l,g,b]);const R=r?i.className:Me(g0(i.className));return x.jsxs(gN,{id:g,children:[x.jsx(w.Fragment,{children:i.asChild?x.jsx(Vo,{children:s,ref:Td([C.setReference,T.ref,a]),tabIndex:S?v.activeIndex===T.index?0:-1:void 0,"data-open":l?"":void 0,"data-nested":S?"":void 0,role:S?"menuitem":void 0,"data-focus-inside":u?"":void 0,className:R,...M(v.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),d(!1),v.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",className:R,"data-open":l?"":void 0,"data-nested":S?"":void 0,role:S?"menuitem":void 0,"data-focus-inside":u?"":void 0,ref:Td([C.setReference,T.ref,a]),tabIndex:S?v.activeIndex===T.index?0:-1:void 0,...M(v.getItemProps({...i,onFocus(z){var D;(D=i.onFocus)==null||D.call(i,z),d(!1),v.setHasFocusInside(!0)}})),children:[s,S&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(Cu,{size:14})]})]})}),x.jsx(Nd.Provider,{value:{activeIndex:f,setActiveIndex:h,getItemProps:N,setHasFocusInside:d,isOpen:l},children:x.jsx(dN,{elementsRef:m,labelsRef:p,children:l&&x.jsx(Rr,{preserveTabOrder:!0,children:x.jsx(Zo,{context:I,modal:!1,initialFocus:S?-1:0,returnFocus:!S,children:x.jsx(t,{...F(),ref:C.setFloating,style:{...i.style,...E},className:Me("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),HN=w.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=w.useContext(Nd),a=Fb({label:r?null:typeof e=="string"?e:t}),l=fr(),c=a.index===i.activeIndex;return x.jsxs("button",{...o,type:"button",role:"menuitem",disabled:r,"data-active":c,"data-open":i.isOpen,tabIndex:c?0:-1,ref:Td([a.ref,s]),className:g0(`${o.className??""} ${c?"bg-primary text-primary-foreground":""}`),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),UN=w.forwardRef((e,t)=>dr()!==null?x.jsx(y0,{...e,isParent:!1,ref:t}):x.jsx(yN,{children:x.jsx(y0,{...e,isParent:!0,ref:t})}));var kn=function(){return kn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},kn.apply(this,arguments)};function v0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Jo(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function l(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function es(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function b0(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Ld(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ka="right-scroll-bar-position",Za="width-before-scroll-bar",GN="with-scroll-bars-hidden",YN="--removed-body-scroll-bar-size";function Fd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qN(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var KN=typeof window<"u"?P.useLayoutEffect:P.useEffect,w0=new WeakMap;function ZN(e,t){var n=qN(null,function(r){return e.forEach(function(o){return Fd(o,r)})});return KN(function(){var r=w0.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Fd(a,null)}),s.forEach(function(a){o.has(a)||Fd(a,i)})}w0.set(n,e)},[e]),n}function XN(e){return e}function QN(e,t){t===void 0&&(t=XN);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function JN(e){e===void 0&&(e={});var t=QN(null);return t.options=kn({async:!0,ssr:!1},e),t}var x0=function(e){var t=e.sideCar,n=v0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,kn({},n))};x0.isSideCarExport=!0;function eL(e,t){return e.useMedium(t),x0}var S0=JN(),Vd=function(){},Xa=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:Vd,onWheelCapture:Vd,onTouchMoveCapture:Vd}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,y=e.gapMode,g=v0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=ZN([n,t]),E=kn(kn({},g),o);return P.createElement(P.Fragment,null,u&&P.createElement(T,{sideCar:S0,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:y}),i?P.cloneElement(P.Children.only(a),kn(kn({},E),{ref:S})):P.createElement(b,kn({},E,{className:l,ref:S}),a))});Xa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xa.classNames={fullWidth:Za,zeroRight:Ka};var tL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tL();return t&&e.setAttribute("nonce",t),e}function rL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nL())&&(rL(t,n),oL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iL=function(){var e=sL();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T0=function(){var e=iL(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},aL={left:0,top:0,right:0,gap:0},$d=function(e){return parseInt(e||"",10)||0},lL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[$d(n),$d(r),$d(o)]},cL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aL;var t=lL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uL=T0(),ts="data-scroll-locked",dL=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
173
+ .`.concat(GN,` {
174
174
  overflow: hidden `).concat(r,`;
175
175
  padding-right: `).concat(a,"px ").concat(r,`;
176
176
  }
@@ -187,51 +187,51 @@
187
187
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
188
188
  }
189
189
 
190
- .`).concat(qa,` {
190
+ .`).concat(Ka,` {
191
191
  right: `).concat(a,"px ").concat(r,`;
192
192
  }
193
193
 
194
- .`).concat(Ka,` {
194
+ .`).concat(Za,` {
195
195
  margin-right: `).concat(a,"px ").concat(r,`;
196
196
  }
197
197
 
198
- .`).concat(qa," .").concat(qa,` {
198
+ .`).concat(Ka," .").concat(Ka,` {
199
199
  right: 0 `).concat(r,`;
200
200
  }
201
201
 
202
- .`).concat(Ka," .").concat(Ka,` {
202
+ .`).concat(Za," .").concat(Za,` {
203
203
  margin-right: 0 `).concat(r,`;
204
204
  }
205
205
 
206
206
  body[`).concat(ts,`] {
207
- `).concat(UN,": ").concat(a,`px;
207
+ `).concat(YN,": ").concat(a,`px;
208
208
  }
209
- `)},E0=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},uL=function(){P.useEffect(function(){return document.body.setAttribute(ts,(E0()+1).toString()),function(){var e=E0()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},dL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;uL();var s=P.useMemo(function(){return aL(o)},[o]);return P.createElement(lL,{styles:cL(s,!t,o,n?"":"!important")})},Vd=!1;if(typeof window<"u")try{var Xa=Object.defineProperty({},"passive",{get:function(){return Vd=!0,!0}});window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{Vd=!1}var ns=Vd?{passive:!1}:!1,fL=function(e){return e.tagName==="TEXTAREA"},C0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fL(e)&&n[t]==="visible")},hL=function(e){return C0(e,"overflowY")},pL=function(e){return C0(e,"overflowX")},P0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=k0(e,r);if(o){var s=I0(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gL=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},k0=function(e,t){return e==="v"?hL(t):pL(t)},I0=function(e,t){return e==="v"?mL(t):gL(t)},yL=function(e,t){return e==="h"&&t==="rtl"?-1:1},vL=function(e,t,n,r,o){var s=yL(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,d=0,f=0;do{var h=I0(e,a),m=h[0],p=h[1],y=h[2],b=p-y-s*m;(m||b)&&k0(e,a)&&(d+=b,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(c=!0),c},Qa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A0=function(e){return[e.deltaX,e.deltaY]},O0=function(e){return e&&"current"in e?e.current:e},bL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wL=function(e){return`
209
+ `)},E0=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},fL=function(){P.useEffect(function(){return document.body.setAttribute(ts,(E0()+1).toString()),function(){var e=E0()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},hL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;fL();var s=P.useMemo(function(){return cL(o)},[o]);return P.createElement(uL,{styles:dL(s,!t,o,n?"":"!important")})},Rd=!1;if(typeof window<"u")try{var Qa=Object.defineProperty({},"passive",{get:function(){return Rd=!0,!0}});window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Rd=!1}var ns=Rd?{passive:!1}:!1,pL=function(e){return e.tagName==="TEXTAREA"},C0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pL(e)&&n[t]==="visible")},mL=function(e){return C0(e,"overflowY")},gL=function(e){return C0(e,"overflowX")},P0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=k0(e,r);if(o){var s=I0(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vL=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},k0=function(e,t){return e==="v"?mL(t):gL(t)},I0=function(e,t){return e==="v"?yL(t):vL(t)},bL=function(e,t){return e==="h"&&t==="rtl"?-1:1},wL=function(e,t,n,r,o){var s=bL(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,d=0,f=0;do{var h=I0(e,a),m=h[0],p=h[1],v=h[2],b=p-v-s*m;(m||b)&&k0(e,a)&&(d+=b,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(c=!0),c},Ja=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A0=function(e){return[e.deltaX,e.deltaY]},O0=function(e){return e&&"current"in e?e.current:e},xL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SL=function(e){return`
210
210
  .block-interactivity-`.concat(e,` {pointer-events: none;}
211
211
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
212
- `)},xL=0,rs=[];function SL(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(xL++)[0],s=P.useState(T0)[0],i=P.useRef(e);P.useEffect(function(){i.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Md([e.lockRef.current],(e.shards||[]).map(O0),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var b=Qa(p),v=n.current,g="deltaX"in p?p.deltaX:v[0]-b[0],T="deltaY"in p?p.deltaY:v[1]-b[1],S,E=p.target,C=Math.abs(g)>Math.abs(T)?"h":"v";if("touches"in p&&C==="h"&&E.type==="range")return!1;var I=P0(C,E);if(!I)return!0;if(I?S=C:(S=C==="v"?"h":"v",I=P0(C,E)),!I)return!1;if(!r.current&&"changedTouches"in p&&(g||T)&&(r.current=S),!S)return!0;var A=r.current||S;return vL(A,y,p,A==="h"?g:T,!0)},[]),l=P.useCallback(function(p){var y=p;if(!(!rs.length||rs[rs.length-1]!==s)){var b="deltaY"in y?A0(y):Qa(y),v=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&bL(S.delta,b)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(O0).filter(Boolean).filter(function(S){return S.contains(y.target)}),T=g.length>0?a(y,g[0]):!i.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),c=P.useCallback(function(p,y,b,v){var g={name:p,delta:y,target:b,should:v,shadowParent:TL(b)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(T){return T!==g})},1)},[]),u=P.useCallback(function(p){n.current=Qa(p),r.current=void 0},[]),d=P.useCallback(function(p){c(p.type,A0(p),p.target,a(p,e.lockRef.current))},[]),f=P.useCallback(function(p){c(p.type,Qa(p),p.target,a(p,e.lockRef.current))},[]);P.useEffect(function(){return rs.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ns),document.addEventListener("touchmove",l,ns),document.addEventListener("touchstart",u,ns),function(){rs=rs.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,ns),document.removeEventListener("touchmove",l,ns),document.removeEventListener("touchstart",u,ns)}},[]);var h=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(s,{styles:wL(o)}):null,h?P.createElement(dL,{gapMode:e.gapMode}):null)}function TL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EL=QN(S0,SL);var _0=P.forwardRef(function(e,t){return P.createElement(Za,kn({},e,{ref:t,sideCar:EL}))});_0.classNames=Za.classNames;const CL=(e,t)=>Gi()?t:window.matchMedia(e).matches,PL=(e,t=!0)=>{const[n,r]=w.useState(t);return w.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(CL(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},dn="600ms",kL={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:dn},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:dn},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:dn}},IL={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:dn},exit:{translateX:["0%","30%"],opacity:0,animationDuration:dn}},$d={drawer:e=>e==="left"?kL:IL,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:dn,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:dn,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:dn,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:dn},enter:{opacity:1,scale:[1.05,1],animationDuration:dn},exit:{opacity:0,scale:.97,animationDuration:dn}}},AL=po("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),OL={top:0,left:0,right:0,bottom:-1},_L=e=>e*.62,DL=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=_L(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(at.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:OL,whileDrag:{cursor:"grabbing"},className:Me("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},Rd={drawer:"right",sheet:"none",dialog:"none"},ML=({open:e,title:t,footer:n,asChild:r,trigger:o,children:s,layoutId:i,onChange:a,className:l,resizer:c=!0,closable:u=!0,forceType:d=!1,overlayClassName:f="",type:h="dialog",position:m,overlayClickClose:p=!1,...y})=>{const b=w.useId(),v=w.useId(),g=PL("(min-width: 64rem)"),T=h!=="dialog",S=g?h==="drawer"?m:Rd[h]:d?Rd[h]:Rd.sheet,E=g||d?$d[h]:$d.sheet,C=typeof E=="function"?E(S):E,I=g||d?h:"sheet",{refs:A,context:O}=Wr({open:e,onOpenChange:a}),F=fi(O),_=Hr(O),V=jr(O,{escapeKey:!0,referencePress:!0,outsidePress:p}),{getReferenceProps:k,getFloatingProps:M}=zr([F,_,V]),L=o,N=_r(void 0),R=()=>a(!1);return x.jsxs(w.Fragment,{children:[o?x.jsx(w.Fragment,{children:r?x.jsx(Vo,{ref:A.setReference,...k({layoutId:i}),children:L}):x.jsx(at.button,{ref:A.setReference,...k(),layoutId:i,type:"button",children:L})}):null,x.jsx(Rr,{children:x.jsx(er,{mode:"wait",presenceAffectsLayout:!0,children:e?x.jsx(_0,{enabled:!0,forwardProps:!0,removeScrollBar:!0,inert:!0,noIsolation:!0,children:x.jsx(kN,{lockScroll:!0,className:Me(`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${I==="drawer"?"":"flex items-start justify-center p-10"}`,f),children:x.jsx(Zo,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:O,children:x.jsxs(at.div,{...y,exit:"exit",animate:"enter",initial:"initial",variants:C,"data-component":"modal",ref:A.setFloating,"aria-modal":e,layoutId:i,"aria-labelledby":b,"aria-describedby":v,className:Me(AL({position:S,type:I}),l),style:I==="drawer"?{width:N}:{height:N},...M(),children:[t?x.jsx("header",{className:"relative w-full",children:t?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:t}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s}),n?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:n}):null,u?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(Cu,{})})}):null,T&&c?x.jsx(DL,{onChange:a,parent:A.floating,position:S,sheet:I==="sheet",value:N}):null]})})})}):null})})]})},NL=e=>x.jsx(at.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),D0=({as:e,title:t,children:n,placement:r,focus:o=!0,hover:s=!0,enabled:i=!0,popover:a=!0,followCursor:l=!1,...c})=>{const[u,d]=w.useState(!1),f=w.useRef(null),h=e||"span",{refs:m,floatingStyles:p,context:y}=Wr({open:u,placement:r,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:ii,middleware:[bd(),ai(5),wd({fallbackAxisSideDirection:"start"}),_b({padding:5,element:f})]}),b=Hb(y,{move:!0,delay:{open:m0},enabled:i?s:!1,handleClose:a?p0():null}),v=MN(y,{enabled:i?o:!1}),g=fi(y,{enabled:i?a:!1}),T=jr(y,{enabled:i}),S=Hr(y,{role:"tooltip",enabled:i}),E=AN(y,{enabled:!!i&&!!l}),{getReferenceProps:C,getFloatingProps:I}=zr([S,T,E,o?v:void 0,s?b:void 0,a?g:void 0]);return x.jsxs(w.Fragment,{children:[x.jsx(h,{ref:m.setReference,...C(c),children:t}),x.jsx(Rr,{preserveTabOrder:!0,children:u&&x.jsxs(mo,{...I(),ref:m.setFloating,style:p,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(Rb,{ref:f,context:y,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class Ja{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)Ja.getDescendantProperty(a[l],s,r);else s&&Ja.getDescendantProperty(a,s,r)}else r.push(t);return r}}class Ur{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=Ur.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=Ja.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=Ur.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=Ur.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return Ur.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const el=0,pr=1,os=2,M0=4;function hi(e,t){return n=>e(t(n))}function LL(e,t){return t(e)}function N0(e,t){return n=>e(t,n)}function L0(e,t){return()=>e(t)}function tl(e,t){return t(e),e}function Je(...e){return e}function FL(e){e()}function F0(e){return()=>e}function VL(...e){return()=>{e.map(FL)}}function Bd(e){return e!==void 0}function Gr(){}function ze(e,t){return e(pr,t)}function Te(e,t){e(el,t)}function jd(e){e(os)}function Lt(e){return e(M0)}function pe(e,t){return ze(e,N0(t,el))}function In(e,t){const n=e(pr,r=>{n(),t(r)});return n}function Oe(){const e=[];return(t,n)=>{switch(t){case os:e.splice(0,e.length);return;case pr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case el:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function re(e){let t=e;const n=Oe();return(r,o)=>{switch(r){case pr:o(t);break;case el:t=o;break;case M0:return t}return n(r,o)}}function $L(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case pr:return s?n===s?void 0:(r(),n=s,t=ze(e,s),t):(r(),Gr);case os:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Xt(e){return tl(Oe(),t=>pe(e,t))}function Ft(e,t){return tl(re(t),n=>pe(e,n))}function RL(...e){return t=>e.reduceRight(LL,t)}function K(e,...t){const n=RL(...t);return(r,o)=>{switch(r){case pr:return ze(e,n(o));case os:jd(e);return}}}function V0(e,t){return e===t}function et(e=V0){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function ve(e){return t=>n=>{e(n)&&t(n)}}function de(e){return t=>hi(t,e)}function An(e){return t=>()=>t(e)}function On(e,t){return n=>r=>n(t=e(t,r))}function ss(e){return t=>n=>{e>0?e--:t(n)}}function mr(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function $0(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ee(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);ze(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>s([i].concat(t));n===o?a():r=a}}function R0(...e){return function(t,n){switch(t){case pr:return VL(...e.map(r=>ze(r,n)));case os:return;default:throw new Error(`unrecognized action ${t}`)}}}function we(e,t=V0){return K(e,et(t))}function Ct(...e){const t=Oe(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);ze(s,l=>{n[i]=l,r=r|a,r===o&&Te(t,n)})}),function(s,i){switch(s){case pr:return r===o&&i(n),ze(t,i);case os:return jd(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ve(e,t=[],{singleton:n}={singleton:!0}){return{id:BL(),constructor:e,dependencies:t,singleton:n}}const BL=()=>Symbol();function jL(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const a=o(s.map(l=>n(l)));return i&&t.set(r,a),a};return n(e)}function WL(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const nl=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Wd(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=w.createContext({});function l(b,v){b.propsReady&&Te(b.propsReady,!1);for(const g of r){const T=b[t.required[g]];Te(T,v[g])}for(const g of o)if(g in v){const T=b[t.optional[g]];Te(T,v[g])}b.propsReady&&Te(b.propsReady,!0)}function c(b){return s.reduce((v,g)=>(v[g]=T=>{const S=b[t.methods[g]];Te(S,T)},v),{})}function u(b){return i.reduce((v,g)=>(v[g]=$L(b[t.events[g]]),v),{})}const d=w.forwardRef((b,v)=>{const{children:g,...T}=b,[S]=w.useState(()=>tl(jL(e),C=>l(C,T))),[E]=w.useState(L0(u,S));return nl(()=>{for(const C of i)C in T&&ze(E[C],T[C]);return()=>{Object.values(E).map(jd)}},[T,E,S]),nl(()=>{l(S,T)}),w.useImperativeHandle(v,F0(c(S))),w.createElement(a.Provider,{value:S},n?w.createElement(n,WL([...r,...o,...i],T),g):g)}),f=b=>w.useCallback(N0(Te,w.useContext(a)[b]),[b]),h=b=>{const g=w.useContext(a)[b],T=w.useCallback(S=>ze(g,S),[g]);return w.useSyncExternalStore(T,()=>Lt(g),()=>Lt(g))},m=b=>{const g=w.useContext(a)[b],[T,S]=w.useState(L0(Lt,g));return nl(()=>ze(g,E=>{E!==T&&S(F0(E))}),[g,T]),T},p=w.version.startsWith("18")?h:m;return{Component:d,usePublisher:f,useEmitterValue:p,useEmitter:(b,v)=>{const T=w.useContext(a)[b];nl(()=>ze(T,v),[v,T])}}}const zL=typeof document<"u"?w.useLayoutEffect:w.useEffect;var Qt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Qt||{});const HL={0:"debug",1:"log",2:"warn",3:"error"},UL=()=>typeof globalThis>"u"?window:globalThis,gr=Ve(()=>{const e=re(3);return{log:re((n,r,o=1)=>{var s;const i=(s=UL().VIRTUOSO_LOG_LEVEL)!=null?s:Lt(e);o>=i&&console[HL[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function zd(e,t=!0){const n=w.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=w.useMemo(()=>new ResizeObserver(s=>{requestAnimationFrame(()=>{const i=s[0].target;i.offsetParent!==null&&e(i)})}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function _n(e,t=!0){return zd(e,t).callbackRef}function B0(e,t,n,r,o,s,i){const a=w.useCallback(l=>{const c=GL(l.children,t,"offsetHeight",o);let u=l.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;const d=u.lastElementChild.dataset.viewportType==="window",f=i?i.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:u.scrollTop,h=i?i.scrollHeight:d?document.documentElement.scrollHeight:u.scrollHeight,m=i?i.offsetHeight:d?window.innerHeight:u.offsetHeight;r({scrollTop:Math.max(f,0),scrollHeight:h,viewportHeight:m}),s==null||s(YL("row-gap",getComputedStyle(l).rowGap,o)),c!==null&&e(c)},[e,t,o,s,i,r]);return zd(a,n)}function GL(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(!a||a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),u=t(a,n);if(u===0&&r("Zero-sized element, this should not happen",{child:a},Qt.ERROR),u===c)continue;const d=s[s.length-1];s.length===0||d.size!==u||d.endIndex!==l-1?s.push({startIndex:l,endIndex:l,size:u}):s[s.length-1].endIndex++}return s}function YL(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Qt.WARN),t==="normal"?0:parseInt(t??"0",10)}function fn(e,t){return Math.round(e.getBoundingClientRect()[t])}function j0(e,t){return Math.abs(e-t)<1.01}function W0(e,t,n,r=Gr,o){const s=w.useRef(null),i=w.useRef(null),a=w.useRef(null),l=w.useCallback(d=>{const f=d.target,h=f===window||f===document,m=h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,p=h?document.documentElement.scrollHeight:f.scrollHeight,y=h?window.innerHeight:f.offsetHeight,b=()=>{e({scrollTop:Math.max(m,0),scrollHeight:p,viewportHeight:y})};d.suppressFlushSync?b():xs.flushSync(b),i.current!==null&&(m===i.current||m<=0||m===p-y)&&(i.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);w.useEffect(()=>{const d=o||s.current;return r(o||s.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[s,l,n,r,o]);function c(d){const f=s.current;if(!f||"offsetHeight"in f&&f.offsetHeight===0)return;const h=d.behavior==="smooth";let m,p,y;f===window?(p=Math.max(fn(document.documentElement,"height"),document.documentElement.scrollHeight),m=window.innerHeight,y=document.documentElement.scrollTop):(p=f.scrollHeight,m=fn(f,"height"),y=f.scrollTop);const b=p-m;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),j0(m,p)||d.top===y){e({scrollTop:y,scrollHeight:p,viewportHeight:m}),h&&t(!0);return}h?(i.current=d.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,i.current=null,t(!0)},1e3)):i.current=null,f.scrollTo(d)}function u(d){s.current.scrollBy(d)}return{scrollerRef:s,scrollByCallback:u,scrollToCallback:c}}const Bt=Ve(()=>{const e=Oe(),t=Oe(),n=re(0),r=Oe(),o=re(0),s=Oe(),i=Oe(),a=re(0),l=re(0),c=re(0),u=re(0),d=Oe(),f=Oe(),h=re(!1);return pe(K(e,de(({scrollTop:m})=>m)),t),pe(K(e,de(({scrollHeight:m})=>m)),i),pe(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:a,fixedHeaderHeight:l,fixedFooterHeight:c,footerHeight:u,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:d,scrollBy:f,statefulScrollTop:o,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),pi={lvl:0};function z0(e,t,n,r=pi,o=pi){return{k:e,v:t,lvl:n,l:r,r:o}}function Ye(e){return e===pi}function is(){return pi}function Hd(e,t){if(Ye(e))return pi;const{k:n,l:r,r:o}=e;if(t===n){if(Ye(r))return o;if(Ye(o))return r;{const[s,i]=H0(r);return rl(wt(e,{k:s,v:i,l:U0(r)}))}}else return t<n?rl(wt(e,{l:Hd(r,t)})):rl(wt(e,{r:Hd(o,t)}))}function mi(e,t){if(!Ye(e))return t===e.k?e.v:t<e.k?mi(e.l,t):mi(e.r,t)}function hn(e,t,n="k"){if(Ye(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=hn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return hn(e.l,t,n)}function Jt(e,t,n){return Ye(e)?z0(t,n,1):t===e.k?wt(e,{k:t,v:n}):t<e.k?G0(wt(e,{l:Jt(e.l,t,n)})):G0(wt(e,{r:Jt(e.r,t,n)}))}function Ud(e,t,n){if(Ye(e))return[];const{k:r,v:o,l:s,r:i}=e;let a=[];return r>t&&(a=a.concat(Ud(s,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(Ud(i,t,n))),a}function Yr(e){return Ye(e)?[]:[...Yr(e.l),{k:e.k,v:e.v},...Yr(e.r)]}function H0(e){return Ye(e.r)?[e.k,e.v]:H0(e.r)}function U0(e){return Ye(e.r)?e.l:rl(wt(e,{r:U0(e.r)}))}function wt(e,t){return z0(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Gd(e){return Ye(e)||e.lvl>e.r.lvl}function G0(e){return Yd(q0(e))}function rl(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Gd(t))return q0(wt(e,{lvl:r-1}));if(!Ye(t)&&!Ye(t.r))return wt(t.r,{l:wt(t,{r:t.r.l}),r:wt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Gd(e))return Yd(wt(e,{lvl:r-1}));if(!Ye(n)&&!Ye(n.l)){const o=n.l,s=Gd(o)?n.lvl-1:n.lvl;return wt(o,{l:wt(e,{r:o.l,lvl:r-1}),r:Yd(wt(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function ol(e,t,n){if(Ye(e))return[];const r=hn(e,t)[0];return qL(Ud(e,r,n))}function Y0(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({start:r,end:a-1,value:o}),r=a,o=l}return s.push({start:r,end:1/0,value:o}),s}function qL(e){return Y0(e,({k:t,v:n})=>({index:t,value:n}))}function Yd(e){const{r:t,lvl:n}=e;return!Ye(t)&&!Ye(t.r)&&t.lvl===n&&t.r.lvl===n?wt(t,{l:wt(e,{r:t.l}),lvl:n+1}):e}function q0(e){const{l:t}=e;return!Ye(t)&&t.lvl===e.lvl?wt(t,{r:wt(e,{l:t.r})}):e}function sl(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function K0(e,t,n){return e[sl(e,t,n)]}function KL(e,t,n,r){const o=sl(e,t,r),s=sl(e,n,r,o);return e.slice(o,s+1)}const qd=Ve(()=>({recalcInProgress:re(!1)}),[],{singleton:!0});function ZL(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Z0(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function XL(e,t){let n=Ye(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),Ye(e)){e=Jt(e,0,o);continue}const a=ol(e,s-1,i+1);if(a.some(ZL(r)))continue;let l=!1,c=!1;for(const{start:u,end:d,value:f}of a)l?(i>=u||o===f)&&(e=Hd(e,u)):(c=f!==o,l=!0),d>i&&i>=u&&f!==o&&(e=Jt(e,i+1,f));c&&(e=Jt(e,s,o))}return[e,n]}function QL(){return{offsetTree:[],sizeTree:is(),groupOffsetTree:is(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Kd({index:e},t){return t===e?0:t<e?-1:1}function JL({offset:e},t){return t===e?0:t<e?-1:1}function eF(e){return{index:e.index,value:e}}function tF(e,t,n,r=0){return r>0&&(t=Math.max(t,K0(e,r,Kd).offset)),Y0(KL(e,t,n,JL),eF)}function Zd(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=sl(o,t-1,Kd),a=o[l].offset;const u=hn(n,t-1);s=u[0],i=u[1],o.length&&o[l].size===hn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of ol(n,t,1/0)){const d=c-s,f=d*i+a+d*r;o.push({offset:f,size:u,index:c}),s=c,a=f,i=u}return{offsetTree:o,lastIndex:s,lastOffset:a,lastSize:i}}function nF(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Qt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&Ye(s)&&t.length===2){const f=t[0].size,h=t[1].size;i=n.reduce((m,p)=>Jt(Jt(m,p,f),p+1,h),i)}else[i,a]=XL(i,t);if(i===s)return e;const{offsetTree:l,lastIndex:c,lastSize:u,lastOffset:d}=Zd(e.offsetTree,a,i,o);return{sizeTree:i,offsetTree:l,lastIndex:c,lastOffset:d,lastSize:u,groupOffsetTree:n.reduce((f,h)=>Jt(f,h,gi(h,l,o)),is()),groupIndices:n}}function gi(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=K0(t,e,Kd),i=e-o,a=s*i+(i-1)*n+r;return a>0?a+n:a}function rF(e){return typeof e.groupIndex<"u"}function X0(e,t,n){if(rF(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=Q0(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function Q0(e,t){if(!il(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function il(e){return!Ye(e.groupOffsetTree)}function oF(e){return Yr(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const sF={offsetHeight:"height",offsetWidth:"width"},Dn=Ve(([{log:e},{recalcInProgress:t}])=>{const n=Oe(),r=Oe(),o=Ft(r,0),s=Oe(),i=Oe(),a=re(0),l=re([]),c=re(void 0),u=re(void 0),d=re((S,E)=>fn(S,sF[E])),f=re(void 0),h=re(0),m=QL(),p=Ft(K(n,Ee(l,e,h),On(nF,m),et()),m),y=Ft(K(l,et(),On((S,E)=>({prev:S.current,current:E}),{prev:[],current:[]}),de(({prev:S})=>S)),[]);pe(K(l,ve(S=>S.length>0),Ee(p,h),de(([S,E,C])=>{const I=S.reduce((A,O,F)=>Jt(A,O,gi(O,E.offsetTree,C)||F),is());return{...E,groupIndices:S,groupOffsetTree:I}})),p),pe(K(r,Ee(p),ve(([S,{lastIndex:E}])=>S<E),de(([S,{lastIndex:E,lastSize:C}])=>[{startIndex:S,endIndex:E,size:C}])),n),pe(c,u);const b=Ft(K(c,de(S=>S===void 0)),!0);pe(K(u,ve(S=>S!==void 0&&Ye(Lt(p).sizeTree)),de(S=>[{startIndex:0,endIndex:0,size:S}])),n);const v=Xt(K(n,Ee(p),On(({sizes:S},[E,C])=>({changed:C!==S,sizes:C}),{changed:!1,sizes:m}),de(S=>S.changed)));ze(K(a,On((S,E)=>({diff:S.prev-E,prev:E}),{diff:0,prev:0}),de(S=>S.diff)),S=>{const{groupIndices:E}=Lt(p);if(S>0)Te(t,!0),Te(s,S+Z0(S,E));else if(S<0){const C=Lt(y);C.length>0&&(S-=Z0(-S,C)),Te(i,S)}}),ze(K(a,Ee(e)),([S,E])=>{S<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Qt.ERROR)});const g=Xt(s);pe(K(s,Ee(p),de(([S,E])=>{const C=E.groupIndices.length>0,I=[],A=E.lastSize;if(C){const O=mi(E.sizeTree,0);let F=0,_=0;for(;F<S;){const M=E.groupIndices[_],L=E.groupIndices.length===_+1?1/0:E.groupIndices[_+1]-M-1;I.push({startIndex:M,endIndex:M,size:O}),I.push({startIndex:M+1,endIndex:M+1+L-1,size:A}),_++,F+=L+1}const V=Yr(E.sizeTree);return F!==S&&V.shift(),V.reduce((M,{k:L,v:N})=>{let R=M.ranges;return M.prevSize!==0&&(R=[...M.ranges,{startIndex:M.prevIndex,endIndex:L+S-1,size:M.prevSize}]),{ranges:R,prevIndex:L+S,prevSize:N}},{ranges:I,prevIndex:S,prevSize:0}).ranges}return Yr(E.sizeTree).reduce((O,{k:F,v:_})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:F+S-1,size:O.prevSize}],prevIndex:F+S,prevSize:_}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const T=Xt(K(i,Ee(p,h),de(([S,{offsetTree:E},C])=>{const I=-S;return gi(I,E,C)})));return pe(K(i,Ee(p,h),de(([S,E,C])=>{if(E.groupIndices.length>0){if(Ye(E.sizeTree))return E;let A=is();const O=Lt(y);let F=0,_=0,V=0;for(;F<-S;){V=O[_];const M=O[_+1]-V-1;_++,F+=M+1}if(A=Yr(E.sizeTree).reduce((M,{k:L,v:N})=>Jt(M,Math.max(0,L+S),N),A),F!==-S){const M=mi(E.sizeTree,V);A=Jt(A,0,M);const L=hn(E.sizeTree,-S+1)[1];A=Jt(A,1,L)}return{...E,sizeTree:A,...Zd(E.offsetTree,0,A,C)}}else{const A=Yr(E.sizeTree).reduce((O,{k:F,v:_})=>Jt(O,Math.max(0,F+S),_),is());return{...E,sizeTree:A,...Zd(E.offsetTree,0,A,C)}}})),p),{data:f,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:u,fixedItemSize:c,unshiftWith:s,shiftWith:i,shiftWithOffset:T,beforeUnshiftWith:g,firstItemIndex:a,gap:h,sizes:p,listRefresh:v,statefulTotalCount:o,trackItemSizes:b,itemSize:d}},Je(gr,qd),{singleton:!0}),iF=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function J0(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!iF)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const yi=Ve(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:a,headerHeight:l,footerHeight:c,fixedHeaderHeight:u,fixedFooterHeight:d},{log:f}])=>{const h=Oe(),m=Oe(),p=re(0);let y=null,b=null,v=null;function g(){y&&(y(),y=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),Te(o,!1)}return pe(K(h,Ee(e,s,t,p,l,c,f),Ee(r,u,d),de(([[T,S,E,C,I,A,O,F],_,V,k])=>{const M=J0(T),{align:L,behavior:N,offset:R}=M,z=C-1,D=X0(M,S,z);let B=gi(D,S.offsetTree,_)+A;L==="end"?(B+=V+hn(S.sizeTree,D)[1]-E+k,D===z&&(B+=O)):L==="center"?B+=(V+hn(S.sizeTree,D)[1]-E+k)/2:B-=I,R&&(B+=R);const Z=oe=>{g(),oe?(F("retrying to scroll to",{location:T},Qt.DEBUG),Te(h,T)):(Te(m,!0),F("list did not change, scroll successful",{},Qt.DEBUG))};if(g(),N==="smooth"){let oe=!1;v=ze(n,te=>{oe=oe||te}),y=In(a,()=>{Z(oe)})}else y=In(K(n,aF(150)),Z);return b=setTimeout(()=>{g()},1200),Te(o,!0),F("scrolling from index to",{index:D,top:B,behavior:N},Qt.DEBUG),{top:B,behavior:N}})),i),{scrollToIndex:h,scrollTargetReached:m,topListHeight:p}},Je(Dn,Bt,gr),{singleton:!0});function aF(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const vi="up",bi="down",lF="none",cF={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},uF=0,wi=Ve(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=re(!1),a=re(!0),l=Oe(),c=Oe(),u=re(4),d=re(uF),f=Ft(K(R0(K(we(t),ss(1),An(!0)),K(we(t),ss(1),An(!1),$0(100))),et()),!1),h=Ft(K(R0(K(s,An(!0)),K(s,An(!1),$0(200))),et()),!1);pe(K(Ct(we(t),we(d)),de(([v,g])=>v<=g),et()),a),pe(K(a,mr(50)),c);const m=Xt(K(Ct(e,we(n),we(r),we(o),we(u)),On((v,[{scrollTop:g,scrollHeight:T},S,E,C,I])=>{const A=g+S-T>-I,O={viewportHeight:S,scrollTop:g,scrollHeight:T};if(A){let _,V;return g>v.state.scrollTop?(_="SCROLLED_DOWN",V=v.state.scrollTop-g):(_="SIZE_DECREASED",V=v.state.scrollTop-g||v.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:_,scrollTopDelta:V}}let F;return O.scrollHeight>v.state.scrollHeight?F="SIZE_INCREASED":S<v.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":g<v.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:O}},cF),et((v,g)=>v&&v.atBottom===g.atBottom))),p=Ft(K(e,On((v,{scrollTop:g,scrollHeight:T,viewportHeight:S})=>{if(j0(v.scrollHeight,T))return{scrollTop:g,scrollHeight:T,jump:0,changed:!1};{const E=T-(g+S)<1;return v.scrollTop!==g&&E?{scrollHeight:T,scrollTop:g,jump:v.scrollTop-g,changed:!0}:{scrollHeight:T,scrollTop:g,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),ve(v=>v.changed),de(v=>v.jump)),0);pe(K(m,de(v=>v.atBottom)),i),pe(K(i,mr(50)),l);const y=re(bi);pe(K(e,de(({scrollTop:v})=>v),et(),On((v,g)=>Lt(h)?{direction:v.direction,prevScrollTop:g}:{direction:g<v.prevScrollTop?vi:bi,prevScrollTop:g},{direction:bi,prevScrollTop:0}),de(v=>v.direction)),y),pe(K(e,mr(50),An(lF)),y);const b=re(0);return pe(K(f,ve(v=>!v),An(0)),b),pe(K(t,mr(100),Ee(f),ve(([v,g])=>!!g),On(([v,g],[T])=>[g,T],[0,0]),de(([v,g])=>g-v)),b),{isScrolling:f,isAtTop:a,isAtBottom:i,atBottomState:m,atTopStateChange:c,atBottomStateChange:l,scrollDirection:y,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Je(Bt)),yr=Ve(([{log:e}])=>{const t=re(!1),n=Xt(K(t,ve(r=>r),et()));return ze(t,r=>{r&&Lt(e)("props updated",{},Qt.DEBUG)}),{propsReady:t,didMount:n}},Je(gr),{singleton:!0});function Xd(e,t){e==0?t():requestAnimationFrame(()=>Xd(e-1,t))}function Qd(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const xi=Ve(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o,scrollTargetReached:s},{didMount:i}])=>{const a=re(!0),l=re(0),c=re(!0);return pe(K(i,Ee(l),ve(([u,d])=>!!d),An(!1)),a),pe(K(i,Ee(l),ve(([u,d])=>!!d),An(!1)),c),ze(K(Ct(t,i),Ee(a,e,n,c),ve(([[,u],d,{sizeTree:f},h,m])=>u&&(!Ye(f)||Bd(h))&&!d&&!m),Ee(l)),([,u])=>{In(s,()=>{Te(c,!0)}),Xd(4,()=>{In(r,()=>{Te(a,!0)}),Te(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:l,initialItemFinalLocationReached:c}},Je(Dn,Bt,yi,yr),{singleton:!0});function ew(e){return e?e==="smooth"?"smooth":"auto":!1}const dF=(e,t)=>typeof e=="function"?ew(e(t)):t&&ew(e),fF=Ve(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:a},{log:l},{scrollingInProgress:c}])=>{const u=re(!1),d=Oe();let f=null;function h(p){Te(o,{index:"LAST",align:"end",behavior:p})}ze(K(Ct(K(we(e),ss(1)),a),Ee(we(u),n,s,c),de(([[p,y],b,v,g,T])=>{let S=y&&g,E="auto";return S&&(E=dF(b,v||T),S=S&&!!E),{totalCount:p,shouldFollow:S,followOutputBehavior:E}}),ve(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:y})=>{f&&(f(),f=null),f=In(t,()=>{Lt(l)("following output to ",{totalCount:p},Qt.DEBUG),h(y),f=null})});function m(p){const y=In(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Lt(l)("scrolling to bottom due to increased size",{},Qt.DEBUG),h("auto"))});setTimeout(y,100)}return ze(K(Ct(we(u),e,i),ve(([p,,y])=>p&&y),On(({value:p},[,y])=>({refreshed:p===y,value:y}),{refreshed:!1,value:0}),ve(({refreshed:p})=>p),Ee(u,e)),([,p])=>{Lt(s)&&m(p!==!1)}),ze(d,()=>{m(Lt(u)!==!1)}),ze(Ct(we(u),r),([p,y])=>{p&&!y.atBottom&&y.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:u,autoscrollToBottom:d}},Je(Dn,wi,yi,xi,yr,gr,Bt));function hF(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const tw=Ve(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Oe(),i=Oe(),a=Xt(K(s,de(hF)));return pe(K(a,de(l=>l.totalCount)),e),pe(K(a,de(l=>l.groupIndices)),t),pe(K(Ct(r,n,o),ve(([l,c])=>il(c)),de(([l,c,u])=>hn(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),et(),de(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},Je(Dn,Bt));function Si(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function nw(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const al="top",ll="bottom",rw="none";function ow(e,t,n){return typeof e=="number"?n===vi&&t===al||n===bi&&t===ll?e:0:n===vi?t===al?e.main:e.reverse:t===ll?e.main:e.reverse}function sw(e,t){return typeof e=="number"?e:e[t]||0}const Jd=Ve(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Oe(),i=re(0),a=re(0),l=re(0),c=Ft(K(Ct(we(e),we(t),we(r),we(s,Si),we(l),we(i),we(o),we(n),we(a)),de(([u,d,f,[h,m],p,y,b,v,g])=>{const T=u-v,S=y+b,E=Math.max(f-T,0);let C=rw;const I=sw(g,al),A=sw(g,ll);return h-=v,h+=f+b,m+=f+b,m-=v,h>u+S-I&&(C=vi),m<u-E+d+A&&(C=bi),C!==rw?[Math.max(T-f-ow(p,al,C)-I,0),T-E-b+d+ow(p,ll,C)+A]:null}),ve(u=>u!=null),et(Si)),[0,0]);return{listBoundary:s,overscan:l,topListHeight:i,increaseViewportBy:a,visibleRange:c}},Je(Bt),{singleton:!0});function pF(e,t,n){if(il(t)){const r=Q0(e,t);return[{index:hn(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ef={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function iw(e,t,n){if(e.length===0)return[];if(!il(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=ol(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let u;c.index===a.start?u={type:"group",index:l}:u={index:c.index-(l+1)+n,groupIndex:l},s.push({...u,size:c.size,offset:c.offset,originalIndex:c.index,data:c.data})}return s}function cl(e,t,n,r,o,s){const{lastSize:i,lastOffset:a,lastIndex:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const p=e[e.length-1];u=p.offset+p.size}const d=n-l,f=a+d*i+(d-1)*r,h=c,m=f-u;return{items:iw(e,o,s),topItems:iw(t,o,s),topListHeight:t.reduce((p,y)=>y.size+p,0),offsetTop:c,offsetBottom:m,top:h,bottom:u,totalCount:n,firstItemIndex:s}}function aw(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-i>=e)break;i++}const a=e+i,l=Qd(t,a),c=Array.from({length:a}).map((u,d)=>({index:d+l,size:0,offset:0,data:s[d+l]}));return cl(c,[],a,o,n,r)}const qr=Ve(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:a,topListHeight:l},{scrolledToInitialItem:c,initialTopMostItemIndex:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:m}])=>{const p=re([]),y=re(0),b=Oe();pe(s.topItemsIndexes,p);const v=Ft(K(Ct(h,m,we(i,Si),we(t),we(e),we(u),c,we(p),we(r),we(o),n),ve(([E,C,,I,,,,,,,A])=>{const O=A&&A.length!==I;return E&&!C&&!O}),de(([,,[E,C],I,A,O,F,_,V,k,M])=>{const L=A,{sizeTree:N,offsetTree:R}=L,z=Lt(y);if(I===0)return{...ef,totalCount:I};if(E===0&&C===0)return z===0?{...ef,totalCount:I}:aw(z,O,A,V,k,M||[]);if(Ye(N))return z>0?null:cl(pF(Qd(O,I),L,M),[],I,k,L,V);const D=[];if(_.length>0){const G=_[0],$=_[_.length-1];let j=0;for(const H of ol(N,G,$)){const Y=H.value,Q=Math.max(H.start,G),fe=Math.min(H.end,$);for(let U=Q;U<=fe;U++)D.push({index:U,size:Y,offset:j,data:M&&M[U]}),j+=Y}}if(!F)return cl([],D,I,k,L,V);const B=_.length>0?_[_.length-1]+1:0,Z=tF(R,E,C,B);if(Z.length===0)return null;const oe=I-1,te=tl([],G=>{for(const $ of Z){const j=$.value;let H=j.offset,Y=$.start;const Q=j.size;if(j.offset<E){Y+=Math.floor((E-j.offset+k)/(Q+k));const U=Y-$.start;H+=U*Q+U*k}Y<B&&(H+=(B-Y)*Q,Y=B);const fe=Math.min($.end,oe);for(let U=Y;U<=fe&&!(H>=C);U++)G.push({index:U,size:Q,offset:H,data:M&&M[U]}),H+=Q+k}});return cl(te,D,I,k,L,V)}),ve(E=>E!==null),et()),ef);pe(K(n,ve(Bd),de(E=>E==null?void 0:E.length)),t),pe(K(v,de(E=>E.topListHeight)),d),pe(d,l),pe(K(v,de(E=>[E.top,E.bottom])),a),pe(K(v,de(E=>E.items)),b);const g=Xt(K(v,ve(({items:E})=>E.length>0),Ee(t,n),ve(([{items:E},C])=>E[E.length-1].originalIndex===C-1),de(([,E,C])=>[E-1,C]),et(Si),de(([E])=>E))),T=Xt(K(v,mr(200),ve(({items:E,topItems:C})=>E.length>0&&E[0].originalIndex===C.length),de(({items:E})=>E[0].index),et())),S=Xt(K(v,ve(({items:E})=>E.length>0),de(({items:E})=>{let C=0,I=E.length-1;for(;E[C].type==="group"&&C<I;)C++;for(;E[I].type==="group"&&I>C;)I--;return{startIndex:E[C].index,endIndex:E[I].index}}),et(nw)));return{listState:v,topItemsIndexes:p,endReached:g,startReached:T,rangeChanged:S,itemsRendered:b,initialItemCount:y,...f}},Je(Dn,tw,Jd,xi,yi,wi,yr,qd),{singleton:!0}),mF=Ve(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(pe(K(a,Ee(s),ve(([,l])=>l!==0),Ee(o,e,t,r,n),de(([[,l],c,u,d,f,h=[]])=>aw(l,c,u,d,f,h))),i),{}),Je(Dn,xi,qr,yr),{singleton:!0}),lw=Ve(([{scrollVelocity:e}])=>{const t=re(!1),n=Oe(),r=re(!1);return pe(K(e,Ee(r,t,n),ve(([o,s])=>!!s),de(([o,s,i,a])=>{const{exit:l,enter:c}=s;if(i){if(l(o,a))return!1}else if(c(o,a))return!0;return i}),et()),t),ze(K(Ct(t,e,n),Ee(r)),([[o,s,i],a])=>o&&a&&a.change&&a.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Je(wi),{singleton:!0}),gF=Ve(([{topItemsIndexes:e}])=>{const t=re(0);return pe(K(t,ve(n=>n>0),de(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},Je(qr)),cw=Ve(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Oe(),i=Ft(K(Ct(e,r,t,n,o),de(([a,l,c,u,d])=>a+l+c+u+d.offsetBottom+d.bottom)),0);return pe(we(i),s),{totalListHeight:i,totalListHeightChanged:s}},Je(Bt,qr),{singleton:!0});function uw(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const yF=uw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),vF=Ve(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:a},{listState:l},{beforeUnshiftWith:c,shiftWithOffset:u,sizes:d,gap:f},{log:h},{recalcInProgress:m}])=>{const p=Xt(K(l,Ee(a),On(([,b,v,g],[{items:T,totalCount:S,bottom:E,offsetBottom:C},I])=>{const A=E+C;let O=0;return v===S&&b.length>0&&T.length>0&&(T[0].originalIndex===0&&b[0].originalIndex===0||(O=A-g,O!==0&&(O+=I))),[O,T,S,A]},[0,[],0,0]),ve(([b])=>b!==0),Ee(t,i,r,s,h,m),ve(([,b,v,g,,,T])=>!T&&!g&&b!==0&&v===vi),de(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},Qt.DEBUG),b))));function y(b){b>0?(Te(e,{top:-b,behavior:"auto"}),Te(n,0)):(Te(n,0),Te(e,{top:-b,behavior:"auto"}))}return ze(K(p,Ee(n,o)),([b,v,g])=>{g&&yF()?Te(n,v-b):y(-b)}),ze(K(Ct(Ft(o,!1),n,m),ve(([b,v,g])=>!b&&!g&&v!==0),de(([b,v])=>v),mr(1)),y),pe(K(u,de(b=>({top:-b}))),e),ze(K(c,Ee(d,f),de(([b,{lastSize:v,groupIndices:g,sizeTree:T},S])=>{function E(C){return C*(v+S)}if(g.length===0)return E(b);{let C=0;const I=mi(T,0);let A=0,O=0;for(;A<b;){A++,C+=I;let F=g.length===O+1?1/0:g[O+1]-g[O]-1;A+F>b&&(C-=I,F=b-A+1),A+=F,C+=E(F),O++}return C}})),b=>{Te(n,b),requestAnimationFrame(()=>{Te(e,{top:b}),requestAnimationFrame(()=>{Te(n,0),Te(m,!1)})})}),{deviation:n}},Je(Bt,wi,qr,Dn,gr,qd)),bF=Ve(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=re(0);return ze(K(e,Ee(r),ve(([,o])=>o!==0),de(([,o])=>({top:o}))),o=>{In(K(n,ss(1),ve(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Te(t,o)})})}),{initialScrollTop:r}},Je(yr,Bt,qr),{singleton:!0}),wF=Ve(([{viewportHeight:e},{totalListHeight:t}])=>{const n=re(!1),r=Ft(K(Ct(n,e,t),ve(([o])=>o),de(([,o,s])=>Math.max(0,o-s)),mr(0),et()),0);return{alignToBottom:n,paddingTopAddition:r}},Je(Bt,cw),{singleton:!0}),tf=Ve(([{scrollTo:e,scrollContainerState:t}])=>{const n=Oe(),r=Oe(),o=Oe(),s=re(!1),i=re(void 0);return pe(K(Ct(n,r),de(([{viewportHeight:a,scrollTop:l,scrollHeight:c},{offsetTop:u}])=>({scrollTop:Math.max(0,l-u),scrollHeight:c,viewportHeight:a}))),t),pe(K(e,Ee(r),de(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Je(Bt)),xF=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,SF=Ve(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:a,scrollingInProgress:l},{scrollToIndex:c}])=>{const u=Oe();return pe(K(u,Ee(e,o,t,s,i,a,r),Ee(n),de(([[d,f,h,m,p,y,b,v],g])=>{const{done:T,behavior:S,align:E,calculateViewLocation:C=xF,...I}=d,A=X0(d,f,m-1),O=gi(A,f.offsetTree,g)+p+y,F=O+hn(f.sizeTree,A)[1],_=v+y,V=v+h-b,k=C({itemTop:O,itemBottom:F,viewportTop:_,viewportBottom:V,locationParams:{behavior:S,align:E,...I}});return k?T&&In(K(l,ve(M=>M===!1),ss(Lt(l)?1:2)),T):T&&T(),k}),ve(d=>d!==null)),c),{scrollIntoView:u}},Je(Dn,Bt,yi,qr,gr),{singleton:!0}),TF=Ve(([{sizes:e,sizeRanges:t},{scrollTop:n,headerHeight:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=Oe(),u=re(void 0),d=re(null),f=re(null);return pe(a,d),pe(l,f),ze(K(c,Ee(e,n,i,d,f,r)),([h,m,p,y,b,v,g])=>{const T=oF(m.sizeTree);y&&b!==null&&v!==null&&(p=b.scrollTop-v.offsetTop),p-=g,h({ranges:T,scrollTop:p})}),pe(K(u,ve(Bd),de(EF)),o),pe(K(s,Ee(u),ve(([,h])=>h!==void 0),et(),de(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:u}},Je(Dn,Bt,xi,yr,tf));function EF(e){return{offset:e.scrollTop,index:0,align:"start"}}const CF=Ve(([e,t,n,r,o,s,i,a,l,c])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c}),Je(Jd,mF,yr,lw,cw,bF,wF,tf,SF,gr)),dw=Ve(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:a,groupIndices:l,statefulTotalCount:c,gap:u,sizes:d},{initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:m},p,y,b,{listState:v,topItemsIndexes:g,...T},{scrollToIndex:S},E,{topItemCount:C},{groupCounts:I},A])=>(pe(T.rangeChanged,A.scrollSeekRangeChanged),pe(K(A.windowViewportRect,de(O=>O.visibleHeight)),p.viewportHeight),{totalCount:e,data:i,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:m,topItemsIndexes:g,topItemCount:C,groupCounts:I,fixedItemHeight:n,defaultItemHeight:r,gap:u,...b,statefulTotalCount:c,listState:v,scrollToIndex:S,trackItemSizes:o,itemSize:s,groupIndices:l,...T,...A,...p,sizes:d,...y}),Je(Dn,xi,Bt,TF,fF,qr,yi,vF,gF,tw,CF)),nf="-webkit-sticky",fw="sticky",hw=uw(()=>{if(typeof document>"u")return fw;const e=document.createElement("div");return e.style.position=nf,e.style.position===nf?nf:fw});function rf(e,t){const n=w.useRef(null),r=w.useCallback(a=>{if(a===null||!a.offsetParent)return;const l=a.getBoundingClientRect(),c=l.width;let u,d;if(t){const f=t.getBoundingClientRect(),h=l.top-f.top;u=f.height-Math.max(0,h),d=h+t.scrollTop}else u=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:u,visibleWidth:c},e(n.current)},[e,t]),{callbackRef:o,ref:s}=zd(r),i=w.useCallback(()=>{r(s.current)},[r,s]);return w.useEffect(()=>{if(t){t.addEventListener("scroll",i);const a=new ResizeObserver(()=>{requestAnimationFrame(i)});return a.observe(t),()=>{t.removeEventListener("scroll",i),a.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const ul=w.createContext(void 0),pw=w.createContext(void 0);function of(e){return e}const PF=Ve(([e,t])=>({...e,...t}),Je(dw,Ve(()=>{const e=re(l=>`Item ${l}`),t=re(null),n=re(l=>`Group ${l}`),r=re({}),o=re(of),s=re("div"),i=re(Gr),a=(l,c=null)=>Ft(K(r,de(u=>u[l]),et()),c);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}))),kF=({height:e})=>w.createElement("div",{style:{height:e}}),IF={position:hw(),zIndex:1,overflowAnchor:"none"},AF={overflowAnchor:"none"},mw=w.memo(function({showTopList:t=!1}){const n=Ie("listState"),r=on("sizeRanges"),o=Ie("useWindowScroll"),s=Ie("customScrollParent"),i=on("windowScrollContainerState"),a=on("scrollContainerState"),l=s||o?i:a,c=Ie("itemContent"),u=Ie("context"),d=Ie("groupContent"),f=Ie("trackItemSizes"),h=Ie("itemSize"),m=Ie("log"),p=on("gap"),{callbackRef:y}=B0(r,h,f,t?Gr:l,m,p,s),[b,v]=w.useState(0);lf("deviation",k=>{b!==k&&v(k)});const g=Ie("EmptyPlaceholder"),T=Ie("ScrollSeekPlaceholder")||kF,S=Ie("ListComponent"),E=Ie("ItemComponent"),C=Ie("GroupComponent"),I=Ie("computeItemKey"),A=Ie("isSeeking"),O=Ie("groupIndices").length>0,F=Ie("alignToBottom"),_=Ie("initialItemFinalLocationReached"),V=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:F?"auto":0,..._?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&g?w.createElement(g,ut(g,u)):w.createElement(S,{...ut(S,u),ref:y,style:V,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const M=k.originalIndex,L=I(M+n.firstItemIndex,k.data,u);return A?w.createElement(T,{...ut(T,u),key:L,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?w.createElement(C,{...ut(C,u),key:L,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,style:IF},d(k.index,u)):w.createElement(E,{...ut(E,u),...gw(E,k.data),key:L,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:AF},O?c(k.index,k.groupIndex,k.data,u):c(k.index,k.data,u))}))}),OF={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},as=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),_F={width:"100%",position:hw(),top:0,zIndex:1};function ut(e,t){if(typeof e!="string")return{context:t}}function gw(e,t){return{item:typeof e=="string"?void 0:t}}const DF=w.memo(function(){const t=Ie("HeaderComponent"),n=on("headerHeight"),r=Ie("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=Ie("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),MF=w.memo(function(){const t=Ie("FooterComponent"),n=on("footerHeight"),r=Ie("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=Ie("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null});function sf({usePublisher:e,useEmitter:t,useEmitterValue:n}){return w.memo(function({style:s,children:i,...a}){const l=e("scrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("context"),{scrollerRef:h,scrollByCallback:m,scrollToCallback:p}=W0(l,u,c,d);return t("scrollTo",p),t("scrollBy",m),w.createElement(c,{ref:h,style:{...OF,...s},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...ut(c,f)},i)})}function af({usePublisher:e,useEmitter:t,useEmitterValue:n}){return w.memo(function({style:s,children:i,...a}){const l=e("windowScrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("totalListHeight"),f=n("deviation"),h=n("customScrollParent"),m=n("context"),{scrollerRef:p,scrollByCallback:y,scrollToCallback:b}=W0(l,u,c,Gr,h);return zL(()=>(p.current=h||window,()=>{p.current=null}),[p,h]),t("windowScrollTo",b),t("scrollBy",y),w.createElement(c,{style:{position:"relative",...s,...d!==0?{height:d+f}:{}},"data-virtuoso-scroller":!0,...a,...ut(c,m)},i)})}const NF=({children:e})=>{const t=w.useContext(ul),n=on("viewportHeight"),r=on("fixedItemHeight"),o=Ie("alignToBottom"),s=_n(w.useMemo(()=>hi(n,i=>fn(i,"height")),[n]));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),w.createElement("div",{style:as(o),ref:s,"data-viewport-type":"element"},e)},LF=({children:e})=>{const t=w.useContext(ul),n=on("windowViewportRect"),r=on("fixedItemHeight"),o=Ie("customScrollParent"),s=rf(n,o),i=Ie("alignToBottom");return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),w.createElement("div",{ref:s,style:as(i),"data-viewport-type":"window"},e)},FF=({children:e})=>{const t=Ie("TopItemListComponent")||"div",n=Ie("headerHeight"),r={..._F,marginTop:`${n}px`},o=Ie("context");return w.createElement(t,{style:r,...ut(t,o)},e)},VF=w.memo(function(t){const n=Ie("useWindowScroll"),r=Ie("topItemsIndexes").length>0,o=Ie("customScrollParent"),s=o||n?BF:RF,i=o||n?LF:NF;return w.createElement(s,{...t},r&&w.createElement(FF,null,w.createElement(mw,{showTopList:!0})),w.createElement(i,null,w.createElement(DF,null),w.createElement(mw,null),w.createElement(MF,null)))}),{Component:$F,usePublisher:on,useEmitterValue:Ie,useEmitter:lf}=Wd(PF,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},VF),RF=sf({usePublisher:on,useEmitterValue:Ie,useEmitter:lf}),BF=af({usePublisher:on,useEmitterValue:Ie,useEmitter:lf}),cf=$F,yw={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},jF={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:vw,ceil:bw,floor:dl,min:uf,max:Ti}=Math;function WF(e){return{...jF,items:e}}function ww(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function zF(e,t){return e&&e.column===t.column&&e.row===t.row}function fl(e,t){return e&&e.width===t.width&&e.height===t.height}const HF=Ve(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:a,scrollContainerState:l,footerHeight:c,headerHeight:u},d,f,{propsReady:h,didMount:m},{windowViewportRect:p,useWindowScroll:y,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:g},T])=>{const S=re(0),E=re(0),C=re(yw),I=re({height:0,width:0}),A=re({height:0,width:0}),O=Oe(),F=Oe(),_=re(0),V=re(null),k=re({row:0,column:0}),M=Oe(),L=Oe(),N=re(!1),R=re(0),z=re(!0),D=re(!1);ze(K(m,Ee(R),ve(([$,j])=>!!j)),()=>{Te(z,!1),Te(E,0)}),ze(K(Ct(m,z,A,I,R,D),ve(([$,j,H,Y,,Q])=>$&&!j&&H.height!==0&&Y.height!==0&&!Q)),([,,,,$])=>{Te(D,!0),Xd(1,()=>{Te(O,$)}),In(K(r),()=>{Te(n,[0,0]),Te(z,!0)})}),pe(K(L,ve($=>$!=null&&$.scrollTop>0),An(0)),E),ze(K(m,Ee(L),ve(([,$])=>$!=null)),([,$])=>{$&&(Te(I,$.viewport),Te(A,$==null?void 0:$.item),Te(k,$.gap),$.scrollTop>0&&(Te(N,!0),In(K(r,ss(1)),j=>{Te(N,!1)}),Te(i,{top:$.scrollTop})))}),pe(K(I,de(({height:$})=>$)),o),pe(K(Ct(we(I,fl),we(A,fl),we(k,($,j)=>$&&$.column===j.column&&$.row===j.row),we(r)),de(([$,j,H,Y])=>({viewport:$,item:j,gap:H,scrollTop:Y}))),M),pe(K(Ct(we(S),t,we(k,zF),we(A,fl),we(I,fl),we(V),we(E),we(N),we(z),we(R)),ve(([,,,,,,,$])=>!$),de(([$,[j,H],Y,Q,fe,U,Ae,,Ke,Be])=>{const{row:Ce,column:q}=Y,{height:ie,width:W}=Q,{width:ee}=fe;if(Ae===0&&($===0||ee===0))return yw;if(W===0){const Wt=Qd(Be,$),ro=Wt===0?Math.max(Ae-1,0):Wt;return WF(ww(Wt,ro,U))}const ye=Sw(ee,W,q);let ue,je;Ke?j===0&&H===0&&Ae>0?(ue=0,je=Ae-1):(ue=ye*dl((j+Ce)/(ie+Ce)),je=ye*bw((H+Ce)/(ie+Ce))-1,je=uf($-1,Ti(je,ye-1)),ue=uf(je,Ti(0,ue))):(ue=0,je=-1);const ne=ww(ue,je,U),{top:le,bottom:Ne}=xw(fe,Y,Q,ne),tt=bw($/ye),Vt=tt*ie+(tt-1)*Ce-Ne;return{items:ne,offsetTop:le,offsetBottom:Vt,top:le,bottom:Ne,itemHeight:ie,itemWidth:W}})),C),pe(K(V,ve($=>$!==null),de($=>$.length)),S),pe(K(Ct(I,A,C,k),ve(([$,j,{items:H}])=>H.length>0&&j.height!==0&&$.height!==0),de(([$,j,{items:H},Y])=>{const{top:Q,bottom:fe}=xw($,Y,j,H);return[Q,fe]}),et(Si)),n);const B=re(!1);pe(K(r,Ee(B),de(([$,j])=>j||$!==0)),B);const Z=Xt(K(we(C),ve(({items:$})=>$.length>0),Ee(S,B),ve(([{items:$},j,H])=>H&&$[$.length-1].index===j-1),de(([,$])=>$-1),et())),oe=Xt(K(we(C),ve(({items:$})=>$.length>0&&$[0].index===0),An(0),et())),te=Xt(K(we(C),Ee(N),ve(([{items:$},j])=>$.length>0&&!j),de(([{items:$}])=>({startIndex:$[0].index,endIndex:$[$.length-1].index})),et(nw),mr(0)));pe(te,f.scrollSeekRangeChanged),pe(K(O,Ee(I,A,S,k),de(([$,j,H,Y,Q])=>{const fe=J0($),{align:U,behavior:Ae,offset:Ke}=fe;let Be=fe.index;Be==="LAST"&&(Be=Y-1),Be=Ti(0,Be,uf(Y-1,Be));let Ce=df(j,Q,H,Be);return U==="end"?Ce=vw(Ce-j.height+H.height):U==="center"&&(Ce=vw(Ce-j.height/2+H.height/2)),Ke&&(Ce+=Ke),{top:Ce,behavior:Ae}})),i);const G=Ft(K(C,de($=>$.offsetBottom+$.bottom)),0);return pe(K(p,de($=>({width:$.visibleWidth,height:$.visibleHeight}))),I),{data:V,totalCount:S,viewportDimensions:I,itemDimensions:A,scrollTop:r,scrollHeight:F,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:O,smoothScrollTargetReached:a,windowViewportRect:p,windowScrollTo:g,useWindowScroll:y,customScrollParent:b,windowScrollContainerState:v,deviation:_,scrollContainerState:l,footerHeight:c,headerHeight:u,initialItemCount:E,gap:k,restoreStateFrom:L,...f,initialTopMostItemIndex:R,gridState:C,totalListHeight:G,...d,startReached:oe,endReached:Z,rangeChanged:te,stateChanged:M,propsReady:h,stateRestoreInProgress:N,...T}},Je(Jd,Bt,wi,lw,yr,tf,gr));function xw(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=df(e,t,n,r[0].index),i=df(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function df(e,t,n,r){const o=Sw(e.width,n.width,t.column),s=dl(r/o),i=s*n.height+Ti(0,s-1)*t.row;return i>0?i+t.row:i}function Sw(e,t,n){return Ti(1,dl((e+n)/(dl(t)+n)))}const UF=Ve(([e,t])=>({...e,...t}),Je(HF,Ve(()=>{const e=re(c=>`Item ${c}`),t=re({}),n=re(null),r=re("virtuoso-grid-item"),o=re("virtuoso-grid-list"),s=re(of),i=re("div"),a=re(Gr),l=(c,u=null)=>Ft(K(t,de(d=>d[c]),et()),u);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}))),GF=w.memo(function(){const t=ot("gridState"),n=ot("listClassName"),r=ot("itemClassName"),o=ot("itemContent"),s=ot("computeItemKey"),i=ot("isSeeking"),a=pn("scrollHeight"),l=ot("ItemComponent"),c=ot("ListComponent"),u=ot("ScrollSeekPlaceholder"),d=ot("context"),f=pn("itemDimensions"),h=pn("gap"),m=ot("log"),p=ot("stateRestoreInProgress"),y=_n(w.useMemo(()=>b=>{const v=b.parentElement.parentElement.scrollHeight;a(v);const g=b.firstChild;if(g){const{width:T,height:S}=g.getBoundingClientRect();f({width:T,height:S})}h({row:Ew("row-gap",getComputedStyle(b).rowGap,m),column:Ew("column-gap",getComputedStyle(b).columnGap,m)})},[a,f,h,m]));return p?null:w.createElement(c,{ref:y,className:n,...ut(c,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=s(b.index,b.data,d);return i?w.createElement(u,{key:v,...ut(u,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):w.createElement(l,{...ut(l,d),className:r,"data-index":b.index,key:v},o(b.index,b.data,d))}))}),YF=w.memo(function(){const t=ot("HeaderComponent"),n=pn("headerHeight"),r=ot("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=ot("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),qF=w.memo(function(){const t=ot("FooterComponent"),n=pn("footerHeight"),r=ot("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=ot("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),KF=({children:e})=>{const t=w.useContext(pw),n=pn("itemDimensions"),r=pn("viewportDimensions"),o=_n(w.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]));return w.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),w.createElement("div",{style:as(!1),ref:o},e)},ZF=({children:e})=>{const t=w.useContext(pw),n=pn("windowViewportRect"),r=pn("itemDimensions"),o=ot("customScrollParent"),s=rf(n,o);return w.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),w.createElement("div",{ref:s,style:as(!1)},e)},XF=w.memo(function({...t}){const n=ot("useWindowScroll"),r=ot("customScrollParent"),o=r||n?JF:QF,s=r||n?ZF:KF;return w.createElement(o,{...t},w.createElement(s,null,w.createElement(YF,null),w.createElement(GF,null),w.createElement(qF,null)))}),{Component:wB,usePublisher:pn,useEmitterValue:ot,useEmitter:Tw}=Wd(UF,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},XF),QF=sf({usePublisher:pn,useEmitterValue:ot,useEmitter:Tw}),JF=af({usePublisher:pn,useEmitterValue:ot,useEmitter:Tw});function Ew(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Qt.WARN),t==="normal"?0:parseInt(t??"0",10)}const e2=Ve(([e,t])=>({...e,...t}),Je(dw,Ve(()=>{const e=re(l=>w.createElement("td",null,"Item $",l)),t=re(null),n=re(null),r=re(null),o=re({}),s=re(of),i=re(Gr),a=(l,c=null)=>Ft(K(o,de(u=>u[l]),et()),c);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:o,computeItemKey:s,scrollerRef:i,TableComponent:a("Table","table"),TableHeadComponent:a("TableHead","thead"),TableFooterComponent:a("TableFoot","tfoot"),TableBodyComponent:a("TableBody","tbody"),TableRowComponent:a("TableRow","tr"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),FillerRow:a("FillerRow")}}))),t2=({height:e})=>w.createElement("tr",null,w.createElement("td",{style:{height:e}})),n2=({height:e})=>w.createElement("tr",null,w.createElement("td",{style:{height:e,padding:0,border:0}})),r2={overflowAnchor:"none"},o2=w.memo(function(){const t=He("listState"),n=mn("sizeRanges"),r=He("useWindowScroll"),o=He("customScrollParent"),s=mn("windowScrollContainerState"),i=mn("scrollContainerState"),a=o||r?s:i,l=He("itemContent"),c=He("trackItemSizes"),u=He("itemSize"),d=He("log"),{callbackRef:f,ref:h}=B0(n,u,c,a,d,void 0,o),[m,p]=w.useState(0);ff("deviation",L=>{m!==L&&(h.current.style.marginTop=`${L}px`,p(L))});const y=He("EmptyPlaceholder"),b=He("ScrollSeekPlaceholder")||t2,v=He("FillerRow")||n2,g=He("TableBodyComponent"),T=He("TableRowComponent"),S=He("computeItemKey"),E=He("isSeeking"),C=He("paddingTopAddition"),I=He("firstItemIndex"),A=He("statefulTotalCount"),O=He("context");if(A===0&&y)return w.createElement(y,ut(y,O));const F=t.offsetTop+C+m,_=t.offsetBottom,V=F>0?w.createElement(v,{height:F,key:"padding-top",context:O}):null,k=_>0?w.createElement(v,{height:_,key:"padding-bottom",context:O}):null,M=t.items.map(L=>{const N=L.originalIndex,R=S(N+I,L.data,O);return E?w.createElement(b,{...ut(b,O),key:R,index:L.index,height:L.size,type:L.type||"item"}):w.createElement(T,{...ut(T,O),...gw(T,L.data),key:R,"data-index":N,"data-known-size":L.size,"data-item-index":L.index,style:r2},l(L.index,L.data,O))});return w.createElement(g,{ref:f,"data-testid":"virtuoso-item-list",...ut(g,O)},[V,...M,k])}),s2=({children:e})=>{const t=w.useContext(ul),n=mn("viewportHeight"),r=mn("fixedItemHeight"),o=_n(w.useMemo(()=>hi(n,s=>fn(s,"height")),[n]));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),w.createElement("div",{style:as(!1),ref:o,"data-viewport-type":"element"},e)},i2=({children:e})=>{const t=w.useContext(ul),n=mn("windowViewportRect"),r=mn("fixedItemHeight"),o=He("customScrollParent"),s=rf(n,o);return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),w.createElement("div",{ref:s,style:as(!1),"data-viewport-type":"window"},e)},a2=w.memo(function(t){const n=He("useWindowScroll"),r=He("customScrollParent"),o=mn("fixedHeaderHeight"),s=mn("fixedFooterHeight"),i=He("fixedHeaderContent"),a=He("fixedFooterContent"),l=He("context"),c=_n(w.useMemo(()=>hi(o,v=>fn(v,"height")),[o])),u=_n(w.useMemo(()=>hi(s,v=>fn(v,"height")),[s])),d=r||n?u2:c2,f=r||n?i2:s2,h=He("TableComponent"),m=He("TableHeadComponent"),p=He("TableFooterComponent"),y=i?w.createElement(m,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:c,...ut(m,l)},i()):null,b=a?w.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:u,...ut(p,l)},a()):null;return w.createElement(d,{...t},w.createElement(f,null,w.createElement(h,{style:{borderSpacing:0,overflowAnchor:"none"},...ut(h,l)},[y,w.createElement(o2,{key:"TableBody"}),b])))}),{Component:l2,usePublisher:mn,useEmitterValue:He,useEmitter:ff}=Wd(e2,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},a2),c2=sf({usePublisher:mn,useEmitterValue:He,useEmitter:ff}),u2=af({usePublisher:mn,useEmitterValue:He,useEmitter:ff}),d2=l2,Cw=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:Me("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger",children:[s,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(D0,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(Py,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:x.jsx("div",{className:"w-full max-w-48 whitespace-break-spaces break-words",children:r})}):null,e?x.jsxs(w.Fragment,{children:[x.jsx(Ey,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),x.jsx(BI,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),Ei=w.forwardRef(({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:f="",name:h,title:m,componentName:p,placeholder:y,hideLeft:b=!1,required:v,disabled:g,reportStatus:T},S)=>{const E=B_(),C=T!==void 0?T:E.input.iconFeedback,I=d??h,A=Tt(),O=e??A.inputOptionalLabel;return x.jsxs("fieldset",{ref:S,form:u,disabled:g,"data-error":!!c,"aria-disabled":g,"data-component":p,"data-interactive":!!s,className:Me("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:I,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger",children:[x.jsx(Cw,{info:a,hideLeft:b,reportStatus:C,title:m,placeholder:y,children:O||n?x.jsxs(w.Fragment,{children:[v?null:x.jsx("span",{"aria-disabled":g,className:"text-opacity-70 aria-disabled:text-disabled",children:O}),n?x.jsx(w.Fragment,{children:n}):null]}):null}),x.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${f}`,children:[t?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,l,i?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:i}):null]})]}),x.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:c}),x.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})}),f2=e=>x.jsx(w.Fragment,{children:e.children}),h2={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},p2={caseSensitive:!1,sort:!1},m2=[],g2=w.forwardRef(function(t,n){return x.jsx(at.ul,{...t,ref:n,className:"w-full rounded-lg border-b border-tooltip-border last:border-transparent",children:x.jsx(er,{children:t.children})})}),y2=w.forwardRef(function({item:t,context:n,...r},o){return x.jsx(at.li,{...r,ref:o,className:"first:rounded-t-lg last:rounded-t-lg"})}),v2={List:g2,Item:y2},ls=300,hf=40,b2=w.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,emptyMessage:o,interactive:s,rightLabel:i,optionalText:a,container:l,hideLeft:c=!1,right:u,left:d,error:f,required:h=!1,...m},p)=>{const y=w.useRef(null),b=w.useRef(null),v=m.value??m.defaultValue??"",g=Tt(),[T,S]=w.useState(()=>Math.min(ls,hf*e.length)),[E,C]=w.useState(!1),[I,A]=w.useState(""),[O,F]=w.useState(v),[_,V]=w.useState(()=>{var q;return((q=e.find(ie=>ie.value===v))==null?void 0:q.label)??v}),[k,M]=w.useState(null),L=w.useRef(m2),N=t&&I!==""?[{value:I,label:I,"data-dynamic":"true"},...e]:e,R=new Ur(N,["value","label"],p2).search(I),z=()=>{C(!1),S(0)},D=R.filter(q=>q.hidden!==!0),B=t?void 0:`^(${e.map(q=>`${dc(q.value)}${q.label?"|"+dc(q.label):""}`).join("|")})$`;w.useEffect(()=>{if(m.value){const q=e.find(ie=>ie.value===m.value);F((q==null?void 0:q.label)??m.value)}},[m.value]),w.useEffect(()=>{E||S(0)},[E]),w.useEffect(()=>{if(!E)return;const q=G.floating;if(q.current===null)return;let ie=0;Array.from(q.current.querySelectorAll("li")).slice(0,Math.min(R.length,10)).forEach(ye=>{const ue=ye.getBoundingClientRect();ie+=ue.height});const ee=Math.min(ie,ls);S(ee)},[I,E]);const{x:Z,y:oe,strategy:te,refs:G,context:$}=Wr({open:E,transform:!0,strategy:"absolute",onOpenChange:C,whileElementsMounted:ii,middleware:[ai(4),Ob({padding:10,elementContext:"reference",apply(q){var ue;const ie=(ue=y.current)==null?void 0:ue.getBoundingClientRect().width,W=q.elements.floating.querySelector("ul"),ee=(W==null?void 0:W.getBoundingClientRect().height)||0,ye=Math.min(ee<hf?ls:ee,ls);xs.flushSync(()=>setTimeout(()=>{const je=(W==null?void 0:W.getBoundingClientRect().height)??0;return je<hf?void S(ye):void S(Math.min(je,ls))},50)),Object.assign(q.elements.floating.style,{width:`${ie}px`,maxWidth:`${ie}px`,maxHeight:`${ls}`})}})]}),j=f0($,h2),{getReferenceProps:H,getFloatingProps:Y,getItemProps:Q}=zr([Hr($,{role:"listbox"}),jr($),_d($,{cols:0,listRef:L,loop:!0,virtual:!0,allowEscape:!0,activeIndex:k,selectedIndex:k,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:q=>M(ie=>q??ie)})]);w.useEffect(()=>{const q=G.reference.current;if(q)return Os(q)},[]);const fe=(q,ie)=>{F(q.value);const W=G.reference.current;if(!W)return;W==null||W.setAttribute("data-value",q.value),W.value=q.value;const ee=new Event("change",{bubbles:!1,cancelable:!0});W.dispatchEvent(ee),m.onChange&&m.onChange(ee),V(q.label??""),z(),A(""),M(ie)},U=q=>{var W;const ie=q.target.value;return A(ie),!E&&ie===""?C(!0):(q.target.name=m.name||"",ie?C(!0):(W=m.onChange)==null?void 0:W.call(m,q))},Ae=()=>{var q;C(!0),A(""),(q=G.reference.current)==null||q.focus()},Ke=()=>{C(!0),A("")},Be=()=>{var q;(q=G.reference.current)==null||q.setAttribute("data-value",""),A(""),F(""),V(""),cc(G.reference.current),z()},Ce=m.id||m.name;return x.jsxs(Ei,{...m,left:d,error:f,ref:y,form:m.form,name:m.name,feedback:n,hideLeft:c,required:h,title:m.title,container:l,rightLabel:i,interactive:s,id:m.name||m.id,optionalText:a,componentName:"autocomplete",labelClassName:r,placeholder:m.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"transition-colors link:text-primary",onClick:Ae,children:[x.jsx(Su,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),O?x.jsx("button",{type:"button",onClick:Be,className:"transition-colors link:text-danger",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[x.jsx("input",{"data-shadow":"true",...H({...m,onChange:U,onFocus:Ke,pattern:B,ref:G.setReference,name:`${Ce}-shadow`,id:`${Ce}-shadow`,onClick:q=>q.currentTarget.focus(),onKeyDown(q){var ie,W;if(q.key==="ArrowDown"){let ee=k+1;return ee>R.length-1&&(ee=0),(ie=b.current)==null||ie.scrollIntoView({index:ee}),M(ee)}if(q.key==="ArrowUp"){let ee=k-1;return ee<0&&(ee=R.length-1),(W=b.current)==null||W.scrollIntoView({index:ee}),M(ee)}if(q.key==="Escape")return q.currentTarget.blur(),z();if(q.key==="Enter"){if(k!==null&&R[k])return q.preventDefault(),fe(R[k],k);if(R.length===1)return q.preventDefault(),fe(R[0],0)}}}),"data-value":O,"data-error":!!f,"data-name":Ce,"data-target":Ce,required:h,value:E?I:_||O,"aria-autocomplete":"list",autoComplete:"off",className:Me("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",m.className)}),x.jsx("input",{id:Ce,name:Ce,type:"hidden","data-origin":Ce,ref:p,required:h,defaultValue:m.value||O||void 0}),x.jsx(Rr,{preserveTabOrder:!0,children:E?x.jsx(Zo,{guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...Y({ref:G.setFloating,style:{...j.styles,position:te,left:(Z??0)+(O?26:18),top:oe??0}}),"data-floating":"true",className:"z-floating m-0 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[R.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-transparent",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:o||g.autocompleteEmpty})}):null,x.jsx(cf,{ref:b,data:D,components:v2,hidden:D.length===0,className:"rounded-lg border-floating-border bg-floating-background p-0 text-foreground",style:{height:T},itemContent:(q,ie)=>{const W=ie.Render??f2,ee=O===ie.value||O===ie.label,ye=k===q,ue=ie.label??ie.value;return x.jsx("button",{"data-value":ie.value,...Q({ref:je=>void(L.current[q]=je),role:"option",type:"button","aria-checked":ee,"aria-current":ee,"aria-selected":ee,"aria-busy":ie.disabled,onClick:()=>fe(ie,q),className:`cursor-pointer w-full p-2 text-left ${ee?"bg-primary-hover text-primary-foreground":""} ${ye?"bg-floating-hover text-floating-foreground":""}`}),children:x.jsx(W,{...m,label:ie.label,value:ie.value,children:ue})})}})]})}):null})]})});class cs extends Map{constructor(t){super(t),this.list=[],this.list=[],Array.isArray(t)&&(this.list=t),t instanceof cs&&(this.list=Array.from(t.entries()))}set(t,n){return super.set(t,n),this.list=(this.list??[]).concat([[t,n]]),this}delete(t){const n=super.delete(t);return this.list=Array.from(this.entries())??[],n}map(t){return this.list.map(n=>t(n[1]))}clone(){return new cs(this)}}const pf=w.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>x.jsxs("label",{"data-task":t,"data-component":"checkbox","data-disabled":a.disabled,"aria-disabled":a.disabled,className:Me("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[x.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:Me("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,x.jsx("span",{"data-name":"checkbox-label",className:Me("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),w2=e=>x.jsx(w.Fragment,{children:e.children}),x2={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},S2={caseSensitive:!1,sort:!1},Pw=[],T2=w.forwardRef(function(t,n){return x.jsx(at.ul,{...t,ref:n,className:"w-full rounded-b-lg border-b border-tooltip-border last:border-transparent",children:x.jsx(er,{children:t.children})})}),E2=w.forwardRef(function({item:t,context:n,...r},o){return x.jsx(at.li,{...r,ref:o,className:"last:rounded-t-lg"})}),C2={List:T2,Item:E2},P2=e=>{const t=Tt(),n=w.useRef(null),r=w.Children.count(e.children),[o,s]=w.useState(!1);return w.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement.getBoundingClientRect(),l=Array.from(n.current.querySelectorAll("[data-component='tag']")).reduce((u,d)=>u+d.getBoundingClientRect().width,0);if(n.current.querySelectorAll("[data-multicounter]").length&&r<=3)return s(!1);if(l>i.width)return s(!0)},[r]),x.jsx("span",{ref:n,className:"flex flex-nowrap gap-x-2",children:o?x.jsxs(fc,{size:"small","data-multicounter":"true",children:[r," ",t.multiComboboxSelectedLabel]}):e.children})},k2=()=>{},I2=w.forwardRef(({left:e,error:t,right:n,options:r,container:o,rightLabel:s,interactive:i,emptyMessage:a,optionalText:l,selectedLabel:c,labelClassName:u,feedback:d=null,hideLeft:f=!1,required:h=!1,dynamicOption:m=!1,...p},y)=>{const b=w.useMemo(()=>new cs(r.map(W=>[W.value,W])),[r]),v=w.useRef(null),g=w.useRef(null),T=p.value??p.defaultValue??Pw,S=Tt(),[E,C]=w.useState(0),[I,A]=w.useState(!1),[O,F]=w.useState(""),[_,V]=w.useState(()=>{const W=new cs;return T.forEach(ee=>{const ye=b.get(ee);return ye?W.set(ee,ye):void 0}),W}),k=w.useMemo(()=>Array.from(_.keys()),[_]),[M,L]=w.useState(()=>{const W=new Set(T);return r.reduce((ee,ye)=>W.has(ye.value)?[...ee,ye.label??ye.value]:ee,[])??T}),[N,R]=w.useState(null),z=w.useRef(Pw),D=m&&O!==""?[{value:O,label:O,"data-dynamic":"true"},...r]:r,B=new Ur(D,["value","label"],S2).search(O);w.useEffect(()=>{I||C(0)},[I]),w.useEffect(()=>{p.value&&V(new cs(p.value.map(W=>[W,b.get(W)])))},[p.value,b]);const{x:Z,y:oe,strategy:te,refs:G,context:$}=Wr({open:I,transform:!0,strategy:"absolute",onOpenChange:A,whileElementsMounted:ii,middleware:[ai(4),Ob({padding:10,elementContext:"reference",apply(W){var ue;const ee=(ue=v.current)==null?void 0:ue.getBoundingClientRect().width,ye=360;xs.flushSync(()=>setTimeout(()=>C(ye),200)),Object.assign(W.elements.floating.style,{width:`${ee}px`,maxWidth:`${ee}px`,maxHeight:`${ye}px`,height:`${ye}px`})}})]}),j=f0($,x2),{getReferenceProps:H,getFloatingProps:Y,getItemProps:Q}=zr([Hr($,{role:"listbox"}),jr($),_d($,{cols:0,listRef:z,loop:!0,virtual:!0,allowEscape:!0,activeIndex:N,selectedIndex:N,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:W=>R(ee=>W??ee)})]);w.useEffect(()=>{const W=G.reference.current;if(W)return Os(W)},[]);const fe=(W,ee)=>{const ye=_.clone();_.has(W.value)?ye.delete(W.value):ye.set(W.value,W),V(ye);const ue=G.reference.current;if(!ue)return;ue==null||ue.setAttribute("data-value",W.value),ue.value=Array.from(ye.values());const je=new Event("change",{bubbles:!1,cancelable:!0});ue.dispatchEvent(je),p.onChange&&p.onChange(je),L(ne=>ne.concat(W.label??"")),F(""),R(ee)},U=W=>{const ee=W.target.value;return F(ee),!I&&ee===""?A(!0):(W.target.name=p.name||"",ee?A(!0):void 0)},Ae=()=>{var W;A(!0),F(""),(W=G.reference.current)==null||W.focus()},Ke=()=>{A(!0),F("")},Be=()=>{var W;(W=G.reference.current)==null||W.setAttribute("data-value",""),F(""),cc(G.reference.current),A(!1)},Ce=p.id||p.name,q=_.map(W=>x.jsx(fc,{size:"small",children:W.label??W.value},`multicombobox-${W.value}-x`)),ie=B.filter(W=>W.hidden!==!0);return x.jsxs(Ei,{...p,left:e,error:t,ref:v,form:p.form,name:p.name,feedback:d,hideLeft:f,required:h,title:p.title,container:o,rightLabel:s,interactive:i,id:p.name||p.id,optionalText:l,componentName:"autocomplete",labelClassName:u,placeholder:p.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"transition-colors link:text-primary",onClick:Ae,children:[x.jsx(Su,{size:20}),x.jsx("span",{className:"sr-only",children:S.inputCaretDown})]}),_?x.jsx("button",{type:"button",onClick:Be,className:"transition-colors link:text-danger",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[x.jsx("button",{...H({...p,onFocus:Ke,id:`${Ce}-shadow`,name:`${Ce}-shadow`,ref:G.setReference}),type:"button","data-name":Ce,"data-target":Ce,"data-shadow":"true","data-error":!!t,"aria-autocomplete":"list","data-value":k.join(","),value:I?O:M||_,className:Me("input placeholder-input-mask group h-input-height w-full","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary","flex flex-row items-center gap-2 whitespace-nowrap text-left","truncate overflow-ellipsis",p.className),children:x.jsx(P2,{label:c,children:q})}),x.jsx("input",{id:Ce,name:Ce,type:"hidden","data-origin":Ce,ref:y,required:h,defaultValue:p.value||k||void 0}),x.jsx(Rr,{preserveTabOrder:!0,children:I?x.jsx(Zo,{guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("div",{...Y({ref:G.setFloating,style:{...j.styles,position:te,left:(Z??0)+(_?26:18),top:oe??0}}),"data-floating":"true",className:"z-floating m-0 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[x.jsx("input",{autoFocus:!0,value:O,onChange:U,title:p.title,placeholder:S.multiComboboxInnerPlaceholder,onKeyDown:W=>{var ee,ye;if(W.key==="ArrowDown"){let ue=N+1;return ue>B.length-1&&(ue=0),(ee=g.current)==null||ee.scrollIntoView({index:ue}),R(ue)}if(W.key==="ArrowUp"){let ue=N-1;return ue<0&&(ue=B.length-1),(ye=g.current)==null||ye.scrollIntoView({index:ue}),R(ue)}if(W.key==="Escape")return W.currentTarget.blur(),A(!1);if(W.key==="Enter"){if(N!==null&&B[N])return W.preventDefault(),fe(B[N],N);if(B.length===1)return W.preventDefault(),fe(B[0],0)}},className:"input placeholder-input-mask group mb-1 h-10 w-full flex-1 border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary"}),B.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-transparent",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:a||S.autocompleteEmpty})}):null,x.jsx(cf,{ref:g,data:ie,components:C2,hidden:ie.length===0,style:{height:_.size===0?E-49:E-86},className:"border-floating-border bg-floating-background p-0 text-foreground",itemContent:(W,ee)=>{const ye=ee.Render??w2,ue=_.has(ee.value)||_.has(ee.label??""),je=N===W,ne=ee.label??ee.value;return x.jsx("button",{"data-value":ee.value,...Q({ref:le=>void(z.current[W]=le),role:"option",type:"button","aria-checked":ue,"aria-current":ue,"aria-selected":ue,"aria-busy":ee.disabled,onClick:()=>fe(ee,W)}),className:`focus:bg-floating-hover hover:bg-floating-hover w-full cursor-pointer p-2 text-left ${ue||je?"bg-floating-hover text-floating-foreground":""}`,children:x.jsx(pf,{onChange:k2,checked:ue,"aria-checked":ue,onClick:le=>(le.stopPropagation(),void le.preventDefault()),children:x.jsx(ye,{...p,label:ee.label,value:ee.value,children:ne})})})}}),_.size===0?null:x.jsx("div",{className:"sticky bottom-0 flex w-full flex-nowrap items-center gap-2 overflow-x-auto rounded-b-lg bg-floating-background p-2",children:q})]})}):null})]})}),kw=(e,t,n,r)=>w.forwardRef(({info:s,left:i,next:a,error:l,right:c,container:u,rightLabel:d,interactive:f,optionalText:h,type:m="text",labelClassName:p,feedback:y=null,hideLeft:b=!1,...v},g)=>{const T=e,S=v.id??v.name,E=w.useRef(null);return w.useEffect(()=>{if(E.current===null)return;const C=E.current,I=Os(E.current),A=r==null?void 0:r(C),O=F=>{const _=F;if(_.key==="Enter"&&C.enterKeyHint==="next"){const V=C.getAttribute("data-next");if(V){const k=document.getElementById(V);if(k)return k.focus(),void _.preventDefault()}}};return C.addEventListener("keydown",O),()=>{A==null||A(),I(),C.removeEventListener("keydown",O)}},[]),x.jsx(Ei,{...n,info:s,left:i,error:l,right:c,form:v.form,name:v.name,feedback:y,hideLeft:b,title:v.title,container:u,rightLabel:d,disabled:v.disabled,interactive:f,required:v.required,componentName:t,id:v.name||v.id,optionalText:h,labelClassName:p,placeholder:v.placeholder,children:x.jsx(T,{...n,...v,id:S,name:S,type:m,"data-next":a,"aria-busy":v.disabled,"aria-disabled":v.disabled,"aria-readonly":v.readOnly,ref:lc(g,E),className:Me("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","resize-y group-focus-within:border-primary group-hover:border-primary","disabled:cursor-not-allowed disabled:text-disabled",v.className)})})}),Ci=kw(lv,"input",{type:"text"}),Iw=new Date(1970,11,31),mf={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},Aw={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},A2={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},gf=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},O2=w.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||zu(),l=w.useId(),c=Tt(),u=w.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=w.useState(e||void 0),[h,m]=w.useState(!1),p=gf(u,Iw).flatMap(C=>Pt.keyof(mf,C.type)?mf[C.type](C.value):[]),y=gf(u,Iw).reduce((C,I)=>C+(Pt.keyof(Aw,I.type)?Aw[I.type](I.value):""),""),[b,v]=w.useState(d?gf(u,d).reduce((C,I)=>C+(Pt.keyof(mf,I.type)?A2[I.type](d,I.value):""),""):""),g=C=>{const I=C.target.value;if(v(I),p.length===I.length&&p.every((O,F)=>{const _=I.charAt(F);return typeof O=="string"?_===O:O.test(_)})){const O=Mo(ZO(I,y,new Date));return f(O),r==null?void 0:r(O)}return f(void 0),r==null?void 0:r(void 0)},T=C=>(f(C),r==null||r(C),v(C?XA(C,y):"")),S=My(d),E=S?d.toISOString():void 0;return x.jsx(Ci,{...s,mask:p,value:b,id:void 0,name:void 0,className:"uppercase","data-value":E,formNoValidate:!h,"data-target":s.name,"data-component":"date-picker",onChange:g,required:s.required??!0,error:h?void 0:s.error,placeholder:s.placeholder??y,right:x.jsxs(w.Fragment,{children:[x.jsx("input",{"data-origin":s.name,defaultValue:E,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),x.jsx(Qo,{open:h,onChange:m,trigger:x.jsxs("span",{"aria-labelledby":l,children:[x.jsx("span",{id:l,className:"sr-only",children:c.datePickerCalendarButtonLabel}),x.jsx($I,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(Iv,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:T,disabledDate:n,date:S?d:void 0})})]})})}),_2=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],D2=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],M2=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],N2=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Ow=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function _w(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?N2:M2:t.binary?D2:_2,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=Ow(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=Ow(Number(e),t.locale,i),c=n[a];return s+l+r+c}var yf={exports:{}},hl={exports:{}},$e={};/** @license React v16.13.1
212
+ `)},TL=0,rs=[];function EL(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(TL++)[0],s=P.useState(T0)[0],i=P.useRef(e);P.useEffect(function(){i.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Ld([e.lockRef.current],(e.shards||[]).map(O0),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var b=Ja(p),y=n.current,g="deltaX"in p?p.deltaX:y[0]-b[0],T="deltaY"in p?p.deltaY:y[1]-b[1],S,E=p.target,C=Math.abs(g)>Math.abs(T)?"h":"v";if("touches"in p&&C==="h"&&E.type==="range")return!1;var I=P0(C,E);if(!I)return!0;if(I?S=C:(S=C==="v"?"h":"v",I=P0(C,E)),!I)return!1;if(!r.current&&"changedTouches"in p&&(g||T)&&(r.current=S),!S)return!0;var A=r.current||S;return wL(A,v,p,A==="h"?g:T,!0)},[]),l=P.useCallback(function(p){var v=p;if(!(!rs.length||rs[rs.length-1]!==s)){var b="deltaY"in v?A0(v):Ja(v),y=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&xL(S.delta,b)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var g=(i.current.shards||[]).map(O0).filter(Boolean).filter(function(S){return S.contains(v.target)}),T=g.length>0?a(v,g[0]):!i.current.noIsolation;T&&v.cancelable&&v.preventDefault()}}},[]),c=P.useCallback(function(p,v,b,y){var g={name:p,delta:v,target:b,should:y,shadowParent:CL(b)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(T){return T!==g})},1)},[]),u=P.useCallback(function(p){n.current=Ja(p),r.current=void 0},[]),d=P.useCallback(function(p){c(p.type,A0(p),p.target,a(p,e.lockRef.current))},[]),f=P.useCallback(function(p){c(p.type,Ja(p),p.target,a(p,e.lockRef.current))},[]);P.useEffect(function(){return rs.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ns),document.addEventListener("touchmove",l,ns),document.addEventListener("touchstart",u,ns),function(){rs=rs.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,ns),document.removeEventListener("touchmove",l,ns),document.removeEventListener("touchstart",u,ns)}},[]);var h=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(s,{styles:SL(o)}):null,h?P.createElement(hL,{gapMode:e.gapMode}):null)}function CL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const PL=eL(S0,EL);var _0=P.forwardRef(function(e,t){return P.createElement(Xa,kn({},e,{ref:t,sideCar:PL}))});_0.classNames=Xa.classNames;const kL=(e,t)=>Yi()?t:window.matchMedia(e).matches,IL=(e,t=!0)=>{const[n,r]=w.useState(t);return w.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(kL(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},dn="600ms",AL={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:dn},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:dn},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:dn}},OL={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:dn},exit:{translateX:["0%","30%"],opacity:0,animationDuration:dn}},Bd={drawer:e=>e==="left"?AL:OL,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:dn,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:dn,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:dn,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:dn},enter:{opacity:1,scale:[1.05,1],animationDuration:dn},exit:{opacity:0,scale:.97,animationDuration:dn}}},_L=po("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),DL={top:0,left:0,right:0,bottom:-1},ML=e=>e*.62,NL=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=ML(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(at.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:DL,whileDrag:{cursor:"grabbing"},className:Me("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},jd={drawer:"right",sheet:"none",dialog:"none"},LL=({open:e,title:t,footer:n,asChild:r,trigger:o,children:s,layoutId:i,onChange:a,className:l,resizer:c=!0,closable:u=!0,forceType:d=!1,overlayClassName:f="",type:h="dialog",position:m,overlayClickClose:p=!1,...v})=>{const b=w.useId(),y=w.useId(),g=IL("(min-width: 64rem)"),T=h!=="dialog",S=g?h==="drawer"?m:jd[h]:d?jd[h]:jd.sheet,E=g||d?Bd[h]:Bd.sheet,C=typeof E=="function"?E(S):E,I=g||d?h:"sheet",{refs:A,context:O}=Wr({open:e,onOpenChange:a}),L=hi(O),_=Hr(O),V=jr(O,{escapeKey:!0,referencePress:!0,outsidePress:p}),{getReferenceProps:k,getFloatingProps:M}=zr([L,_,V]),F=o,N=_r(void 0),R=()=>a(!1);return x.jsxs(w.Fragment,{children:[o?x.jsx(w.Fragment,{children:r?x.jsx(Vo,{ref:A.setReference,...k({layoutId:i}),children:F}):x.jsx(at.button,{ref:A.setReference,...k(),layoutId:i,type:"button",children:F})}):null,x.jsx(Rr,{children:x.jsx(er,{mode:"wait",presenceAffectsLayout:!0,children:e?x.jsx(_0,{enabled:!0,forwardProps:!0,removeScrollBar:!0,inert:!0,noIsolation:!0,children:x.jsx(AN,{lockScroll:!0,className:Me(`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${I==="drawer"?"":"flex items-start justify-center p-10"}`,f),children:x.jsx(Zo,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:O,children:x.jsxs(at.div,{...v,exit:"exit",animate:"enter",initial:"initial",variants:C,"data-component":"modal",ref:A.setFloating,"aria-modal":e,layoutId:i,"aria-labelledby":b,"aria-describedby":y,className:Me(_L({position:S,type:I}),l),style:I==="drawer"?{width:N}:{height:N},...M(),children:[t?x.jsx("header",{className:"relative w-full",children:t?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:t}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s}),n?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:n}):null,u?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(ku,{})})}):null,T&&c?x.jsx(NL,{onChange:a,parent:A.floating,position:S,sheet:I==="sheet",value:N}):null]})})})}):null})})]})},FL=e=>x.jsx(at.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),D0=({as:e,title:t,children:n,placement:r,open:o,focus:s=!0,hover:i=!0,enabled:a=!0,popover:l=!0,followCursor:c=!1,onChange:u=hc,...d})=>{const[f,h]=w.useState(o??!1),m=w.useRef(null),p=e||"span",v=_=>{h(_),u==null||u(_)},{refs:b,floatingStyles:y,context:g}=Wr({open:f,placement:r,transform:!0,strategy:"absolute",whileElementsMounted:ai,onOpenChange:o?void 0:v,middleware:[xd(),li(5),Sd({fallbackAxisSideDirection:"start"}),_b({padding:5,element:m})]}),T=Hb(g,{move:!0,delay:{open:m0},enabled:a?i:!1,handleClose:l?p0():null}),S=LN(g,{enabled:a?s:!1}),E=hi(g,{enabled:a?l:!1}),C=jr(g,{enabled:a}),I=Hr(g,{role:"tooltip",enabled:a}),A=_N(g,{enabled:!!a&&!!c}),{getReferenceProps:O,getFloatingProps:L}=zr([I,C,A,s?S:void 0,i?T:void 0,l?E:void 0]);return w.useEffect(()=>h(o===void 0?!1:o),[o]),x.jsxs(w.Fragment,{children:[x.jsx(p,{ref:b.setReference,...O(d),children:t}),f&&x.jsx(Rr,{preserveTabOrder:!0,children:x.jsxs(mo,{...L(),ref:b.setFloating,style:y,className:"isolate z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(Rb,{ref:m,context:g,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),n]})})]})};class el{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)el.getDescendantProperty(a[l],s,r);else s&&el.getDescendantProperty(a,s,r)}else r.push(t);return r}}class Ur{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=Ur.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=el.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=Ur.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=Ur.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return Ur.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const tl=0,pr=1,os=2,M0=4;function pi(e,t){return n=>e(t(n))}function VL(e,t){return t(e)}function N0(e,t){return n=>e(t,n)}function L0(e,t){return()=>e(t)}function nl(e,t){return t(e),e}function Je(...e){return e}function $L(e){e()}function F0(e){return()=>e}function RL(...e){return()=>{e.map($L)}}function Wd(e){return e!==void 0}function Gr(){}function ze(e,t){return e(pr,t)}function Te(e,t){e(tl,t)}function zd(e){e(os)}function Lt(e){return e(M0)}function pe(e,t){return ze(e,N0(t,tl))}function In(e,t){const n=e(pr,r=>{n(),t(r)});return n}function Oe(){const e=[];return(t,n)=>{switch(t){case os:e.splice(0,e.length);return;case pr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case tl:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function re(e){let t=e;const n=Oe();return(r,o)=>{switch(r){case pr:o(t);break;case tl:t=o;break;case M0:return t}return n(r,o)}}function BL(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case pr:return s?n===s?void 0:(r(),n=s,t=ze(e,s),t):(r(),Gr);case os:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Xt(e){return nl(Oe(),t=>pe(e,t))}function Ft(e,t){return nl(re(t),n=>pe(e,n))}function jL(...e){return t=>e.reduceRight(VL,t)}function K(e,...t){const n=jL(...t);return(r,o)=>{switch(r){case pr:return ze(e,n(o));case os:zd(e);return}}}function V0(e,t){return e===t}function et(e=V0){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function ve(e){return t=>n=>{e(n)&&t(n)}}function de(e){return t=>pi(t,e)}function An(e){return t=>()=>t(e)}function On(e,t){return n=>r=>n(t=e(t,r))}function ss(e){return t=>n=>{e>0?e--:t(n)}}function mr(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function $0(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ee(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);ze(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>s([i].concat(t));n===o?a():r=a}}function R0(...e){return function(t,n){switch(t){case pr:return RL(...e.map(r=>ze(r,n)));case os:return;default:throw new Error(`unrecognized action ${t}`)}}}function we(e,t=V0){return K(e,et(t))}function Ct(...e){const t=Oe(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);ze(s,l=>{n[i]=l,r=r|a,r===o&&Te(t,n)})}),function(s,i){switch(s){case pr:return r===o&&i(n),ze(t,i);case os:return zd(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ve(e,t=[],{singleton:n}={singleton:!0}){return{id:WL(),constructor:e,dependencies:t,singleton:n}}const WL=()=>Symbol();function zL(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const a=o(s.map(l=>n(l)));return i&&t.set(r,a),a};return n(e)}function HL(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const rl=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Hd(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=w.createContext({});function l(b,y){b.propsReady&&Te(b.propsReady,!1);for(const g of r){const T=b[t.required[g]];Te(T,y[g])}for(const g of o)if(g in y){const T=b[t.optional[g]];Te(T,y[g])}b.propsReady&&Te(b.propsReady,!0)}function c(b){return s.reduce((y,g)=>(y[g]=T=>{const S=b[t.methods[g]];Te(S,T)},y),{})}function u(b){return i.reduce((y,g)=>(y[g]=BL(b[t.events[g]]),y),{})}const d=w.forwardRef((b,y)=>{const{children:g,...T}=b,[S]=w.useState(()=>nl(zL(e),C=>l(C,T))),[E]=w.useState(L0(u,S));return rl(()=>{for(const C of i)C in T&&ze(E[C],T[C]);return()=>{Object.values(E).map(zd)}},[T,E,S]),rl(()=>{l(S,T)}),w.useImperativeHandle(y,F0(c(S))),w.createElement(a.Provider,{value:S},n?w.createElement(n,HL([...r,...o,...i],T),g):g)}),f=b=>w.useCallback(N0(Te,w.useContext(a)[b]),[b]),h=b=>{const g=w.useContext(a)[b],T=w.useCallback(S=>ze(g,S),[g]);return w.useSyncExternalStore(T,()=>Lt(g),()=>Lt(g))},m=b=>{const g=w.useContext(a)[b],[T,S]=w.useState(L0(Lt,g));return rl(()=>ze(g,E=>{E!==T&&S(F0(E))}),[g,T]),T},p=w.version.startsWith("18")?h:m;return{Component:d,usePublisher:f,useEmitterValue:p,useEmitter:(b,y)=>{const T=w.useContext(a)[b];rl(()=>ze(T,y),[y,T])}}}const UL=typeof document<"u"?w.useLayoutEffect:w.useEffect;var Qt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Qt||{});const GL={0:"debug",1:"log",2:"warn",3:"error"},YL=()=>typeof globalThis>"u"?window:globalThis,gr=Ve(()=>{const e=re(3);return{log:re((n,r,o=1)=>{var s;const i=(s=YL().VIRTUOSO_LOG_LEVEL)!=null?s:Lt(e);o>=i&&console[GL[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Ud(e,t=!0){const n=w.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=w.useMemo(()=>new ResizeObserver(s=>{requestAnimationFrame(()=>{const i=s[0].target;i.offsetParent!==null&&e(i)})}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function _n(e,t=!0){return Ud(e,t).callbackRef}function B0(e,t,n,r,o,s,i){const a=w.useCallback(l=>{const c=qL(l.children,t,"offsetHeight",o);let u=l.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;const d=u.lastElementChild.dataset.viewportType==="window",f=i?i.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:u.scrollTop,h=i?i.scrollHeight:d?document.documentElement.scrollHeight:u.scrollHeight,m=i?i.offsetHeight:d?window.innerHeight:u.offsetHeight;r({scrollTop:Math.max(f,0),scrollHeight:h,viewportHeight:m}),s==null||s(KL("row-gap",getComputedStyle(l).rowGap,o)),c!==null&&e(c)},[e,t,o,s,i,r]);return Ud(a,n)}function qL(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(!a||a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),u=t(a,n);if(u===0&&r("Zero-sized element, this should not happen",{child:a},Qt.ERROR),u===c)continue;const d=s[s.length-1];s.length===0||d.size!==u||d.endIndex!==l-1?s.push({startIndex:l,endIndex:l,size:u}):s[s.length-1].endIndex++}return s}function KL(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Qt.WARN),t==="normal"?0:parseInt(t??"0",10)}function fn(e,t){return Math.round(e.getBoundingClientRect()[t])}function j0(e,t){return Math.abs(e-t)<1.01}function W0(e,t,n,r=Gr,o){const s=w.useRef(null),i=w.useRef(null),a=w.useRef(null),l=w.useCallback(d=>{const f=d.target,h=f===window||f===document,m=h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,p=h?document.documentElement.scrollHeight:f.scrollHeight,v=h?window.innerHeight:f.offsetHeight,b=()=>{e({scrollTop:Math.max(m,0),scrollHeight:p,viewportHeight:v})};d.suppressFlushSync?b():xs.flushSync(b),i.current!==null&&(m===i.current||m<=0||m===p-v)&&(i.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);w.useEffect(()=>{const d=o||s.current;return r(o||s.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[s,l,n,r,o]);function c(d){const f=s.current;if(!f||"offsetHeight"in f&&f.offsetHeight===0)return;const h=d.behavior==="smooth";let m,p,v;f===window?(p=Math.max(fn(document.documentElement,"height"),document.documentElement.scrollHeight),m=window.innerHeight,v=document.documentElement.scrollTop):(p=f.scrollHeight,m=fn(f,"height"),v=f.scrollTop);const b=p-m;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),j0(m,p)||d.top===v){e({scrollTop:v,scrollHeight:p,viewportHeight:m}),h&&t(!0);return}h?(i.current=d.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,i.current=null,t(!0)},1e3)):i.current=null,f.scrollTo(d)}function u(d){s.current.scrollBy(d)}return{scrollerRef:s,scrollByCallback:u,scrollToCallback:c}}const Bt=Ve(()=>{const e=Oe(),t=Oe(),n=re(0),r=Oe(),o=re(0),s=Oe(),i=Oe(),a=re(0),l=re(0),c=re(0),u=re(0),d=Oe(),f=Oe(),h=re(!1);return pe(K(e,de(({scrollTop:m})=>m)),t),pe(K(e,de(({scrollHeight:m})=>m)),i),pe(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:a,fixedHeaderHeight:l,fixedFooterHeight:c,footerHeight:u,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:d,scrollBy:f,statefulScrollTop:o,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),mi={lvl:0};function z0(e,t,n,r=mi,o=mi){return{k:e,v:t,lvl:n,l:r,r:o}}function Ye(e){return e===mi}function is(){return mi}function Gd(e,t){if(Ye(e))return mi;const{k:n,l:r,r:o}=e;if(t===n){if(Ye(r))return o;if(Ye(o))return r;{const[s,i]=H0(r);return ol(wt(e,{k:s,v:i,l:U0(r)}))}}else return t<n?ol(wt(e,{l:Gd(r,t)})):ol(wt(e,{r:Gd(o,t)}))}function gi(e,t){if(!Ye(e))return t===e.k?e.v:t<e.k?gi(e.l,t):gi(e.r,t)}function hn(e,t,n="k"){if(Ye(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=hn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return hn(e.l,t,n)}function Jt(e,t,n){return Ye(e)?z0(t,n,1):t===e.k?wt(e,{k:t,v:n}):t<e.k?G0(wt(e,{l:Jt(e.l,t,n)})):G0(wt(e,{r:Jt(e.r,t,n)}))}function Yd(e,t,n){if(Ye(e))return[];const{k:r,v:o,l:s,r:i}=e;let a=[];return r>t&&(a=a.concat(Yd(s,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(Yd(i,t,n))),a}function Yr(e){return Ye(e)?[]:[...Yr(e.l),{k:e.k,v:e.v},...Yr(e.r)]}function H0(e){return Ye(e.r)?[e.k,e.v]:H0(e.r)}function U0(e){return Ye(e.r)?e.l:ol(wt(e,{r:U0(e.r)}))}function wt(e,t){return z0(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function qd(e){return Ye(e)||e.lvl>e.r.lvl}function G0(e){return Kd(q0(e))}function ol(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(qd(t))return q0(wt(e,{lvl:r-1}));if(!Ye(t)&&!Ye(t.r))return wt(t.r,{l:wt(t,{r:t.r.l}),r:wt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(qd(e))return Kd(wt(e,{lvl:r-1}));if(!Ye(n)&&!Ye(n.l)){const o=n.l,s=qd(o)?n.lvl-1:n.lvl;return wt(o,{l:wt(e,{r:o.l,lvl:r-1}),r:Kd(wt(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function sl(e,t,n){if(Ye(e))return[];const r=hn(e,t)[0];return ZL(Yd(e,r,n))}function Y0(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({start:r,end:a-1,value:o}),r=a,o=l}return s.push({start:r,end:1/0,value:o}),s}function ZL(e){return Y0(e,({k:t,v:n})=>({index:t,value:n}))}function Kd(e){const{r:t,lvl:n}=e;return!Ye(t)&&!Ye(t.r)&&t.lvl===n&&t.r.lvl===n?wt(t,{l:wt(e,{r:t.l}),lvl:n+1}):e}function q0(e){const{l:t}=e;return!Ye(t)&&t.lvl===e.lvl?wt(t,{r:wt(e,{l:t.r})}):e}function il(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function K0(e,t,n){return e[il(e,t,n)]}function XL(e,t,n,r){const o=il(e,t,r),s=il(e,n,r,o);return e.slice(o,s+1)}const Zd=Ve(()=>({recalcInProgress:re(!1)}),[],{singleton:!0});function QL(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Z0(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function JL(e,t){let n=Ye(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),Ye(e)){e=Jt(e,0,o);continue}const a=sl(e,s-1,i+1);if(a.some(QL(r)))continue;let l=!1,c=!1;for(const{start:u,end:d,value:f}of a)l?(i>=u||o===f)&&(e=Gd(e,u)):(c=f!==o,l=!0),d>i&&i>=u&&f!==o&&(e=Jt(e,i+1,f));c&&(e=Jt(e,s,o))}return[e,n]}function eF(){return{offsetTree:[],sizeTree:is(),groupOffsetTree:is(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Xd({index:e},t){return t===e?0:t<e?-1:1}function tF({offset:e},t){return t===e?0:t<e?-1:1}function nF(e){return{index:e.index,value:e}}function rF(e,t,n,r=0){return r>0&&(t=Math.max(t,K0(e,r,Xd).offset)),Y0(XL(e,t,n,tF),nF)}function Qd(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=il(o,t-1,Xd),a=o[l].offset;const u=hn(n,t-1);s=u[0],i=u[1],o.length&&o[l].size===hn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of sl(n,t,1/0)){const d=c-s,f=d*i+a+d*r;o.push({offset:f,size:u,index:c}),s=c,a=f,i=u}return{offsetTree:o,lastIndex:s,lastOffset:a,lastSize:i}}function oF(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Qt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&Ye(s)&&t.length===2){const f=t[0].size,h=t[1].size;i=n.reduce((m,p)=>Jt(Jt(m,p,f),p+1,h),i)}else[i,a]=JL(i,t);if(i===s)return e;const{offsetTree:l,lastIndex:c,lastSize:u,lastOffset:d}=Qd(e.offsetTree,a,i,o);return{sizeTree:i,offsetTree:l,lastIndex:c,lastOffset:d,lastSize:u,groupOffsetTree:n.reduce((f,h)=>Jt(f,h,yi(h,l,o)),is()),groupIndices:n}}function yi(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=K0(t,e,Xd),i=e-o,a=s*i+(i-1)*n+r;return a>0?a+n:a}function sF(e){return typeof e.groupIndex<"u"}function X0(e,t,n){if(sF(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=Q0(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function Q0(e,t){if(!al(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function al(e){return!Ye(e.groupOffsetTree)}function iF(e){return Yr(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const aF={offsetHeight:"height",offsetWidth:"width"},Dn=Ve(([{log:e},{recalcInProgress:t}])=>{const n=Oe(),r=Oe(),o=Ft(r,0),s=Oe(),i=Oe(),a=re(0),l=re([]),c=re(void 0),u=re(void 0),d=re((S,E)=>fn(S,aF[E])),f=re(void 0),h=re(0),m=eF(),p=Ft(K(n,Ee(l,e,h),On(oF,m),et()),m),v=Ft(K(l,et(),On((S,E)=>({prev:S.current,current:E}),{prev:[],current:[]}),de(({prev:S})=>S)),[]);pe(K(l,ve(S=>S.length>0),Ee(p,h),de(([S,E,C])=>{const I=S.reduce((A,O,L)=>Jt(A,O,yi(O,E.offsetTree,C)||L),is());return{...E,groupIndices:S,groupOffsetTree:I}})),p),pe(K(r,Ee(p),ve(([S,{lastIndex:E}])=>S<E),de(([S,{lastIndex:E,lastSize:C}])=>[{startIndex:S,endIndex:E,size:C}])),n),pe(c,u);const b=Ft(K(c,de(S=>S===void 0)),!0);pe(K(u,ve(S=>S!==void 0&&Ye(Lt(p).sizeTree)),de(S=>[{startIndex:0,endIndex:0,size:S}])),n);const y=Xt(K(n,Ee(p),On(({sizes:S},[E,C])=>({changed:C!==S,sizes:C}),{changed:!1,sizes:m}),de(S=>S.changed)));ze(K(a,On((S,E)=>({diff:S.prev-E,prev:E}),{diff:0,prev:0}),de(S=>S.diff)),S=>{const{groupIndices:E}=Lt(p);if(S>0)Te(t,!0),Te(s,S+Z0(S,E));else if(S<0){const C=Lt(v);C.length>0&&(S-=Z0(-S,C)),Te(i,S)}}),ze(K(a,Ee(e)),([S,E])=>{S<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Qt.ERROR)});const g=Xt(s);pe(K(s,Ee(p),de(([S,E])=>{const C=E.groupIndices.length>0,I=[],A=E.lastSize;if(C){const O=gi(E.sizeTree,0);let L=0,_=0;for(;L<S;){const M=E.groupIndices[_],F=E.groupIndices.length===_+1?1/0:E.groupIndices[_+1]-M-1;I.push({startIndex:M,endIndex:M,size:O}),I.push({startIndex:M+1,endIndex:M+1+F-1,size:A}),_++,L+=F+1}const V=Yr(E.sizeTree);return L!==S&&V.shift(),V.reduce((M,{k:F,v:N})=>{let R=M.ranges;return M.prevSize!==0&&(R=[...M.ranges,{startIndex:M.prevIndex,endIndex:F+S-1,size:M.prevSize}]),{ranges:R,prevIndex:F+S,prevSize:N}},{ranges:I,prevIndex:S,prevSize:0}).ranges}return Yr(E.sizeTree).reduce((O,{k:L,v:_})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:L+S-1,size:O.prevSize}],prevIndex:L+S,prevSize:_}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const T=Xt(K(i,Ee(p,h),de(([S,{offsetTree:E},C])=>{const I=-S;return yi(I,E,C)})));return pe(K(i,Ee(p,h),de(([S,E,C])=>{if(E.groupIndices.length>0){if(Ye(E.sizeTree))return E;let A=is();const O=Lt(v);let L=0,_=0,V=0;for(;L<-S;){V=O[_];const M=O[_+1]-V-1;_++,L+=M+1}if(A=Yr(E.sizeTree).reduce((M,{k:F,v:N})=>Jt(M,Math.max(0,F+S),N),A),L!==-S){const M=gi(E.sizeTree,V);A=Jt(A,0,M);const F=hn(E.sizeTree,-S+1)[1];A=Jt(A,1,F)}return{...E,sizeTree:A,...Qd(E.offsetTree,0,A,C)}}else{const A=Yr(E.sizeTree).reduce((O,{k:L,v:_})=>Jt(O,Math.max(0,L+S),_),is());return{...E,sizeTree:A,...Qd(E.offsetTree,0,A,C)}}})),p),{data:f,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:u,fixedItemSize:c,unshiftWith:s,shiftWith:i,shiftWithOffset:T,beforeUnshiftWith:g,firstItemIndex:a,gap:h,sizes:p,listRefresh:y,statefulTotalCount:o,trackItemSizes:b,itemSize:d}},Je(gr,Zd),{singleton:!0}),lF=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function J0(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!lF)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const vi=Ve(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:a,headerHeight:l,footerHeight:c,fixedHeaderHeight:u,fixedFooterHeight:d},{log:f}])=>{const h=Oe(),m=Oe(),p=re(0);let v=null,b=null,y=null;function g(){v&&(v(),v=null),y&&(y(),y=null),b&&(clearTimeout(b),b=null),Te(o,!1)}return pe(K(h,Ee(e,s,t,p,l,c,f),Ee(r,u,d),de(([[T,S,E,C,I,A,O,L],_,V,k])=>{const M=J0(T),{align:F,behavior:N,offset:R}=M,z=C-1,D=X0(M,S,z);let B=yi(D,S.offsetTree,_)+A;F==="end"?(B+=V+hn(S.sizeTree,D)[1]-E+k,D===z&&(B+=O)):F==="center"?B+=(V+hn(S.sizeTree,D)[1]-E+k)/2:B-=I,R&&(B+=R);const Z=oe=>{g(),oe?(L("retrying to scroll to",{location:T},Qt.DEBUG),Te(h,T)):(Te(m,!0),L("list did not change, scroll successful",{},Qt.DEBUG))};if(g(),N==="smooth"){let oe=!1;y=ze(n,te=>{oe=oe||te}),v=In(a,()=>{Z(oe)})}else v=In(K(n,cF(150)),Z);return b=setTimeout(()=>{g()},1200),Te(o,!0),L("scrolling from index to",{index:D,top:B,behavior:N},Qt.DEBUG),{top:B,behavior:N}})),i),{scrollToIndex:h,scrollTargetReached:m,topListHeight:p}},Je(Dn,Bt,gr),{singleton:!0});function cF(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const bi="up",wi="down",uF="none",dF={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},fF=0,xi=Ve(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=re(!1),a=re(!0),l=Oe(),c=Oe(),u=re(4),d=re(fF),f=Ft(K(R0(K(we(t),ss(1),An(!0)),K(we(t),ss(1),An(!1),$0(100))),et()),!1),h=Ft(K(R0(K(s,An(!0)),K(s,An(!1),$0(200))),et()),!1);pe(K(Ct(we(t),we(d)),de(([y,g])=>y<=g),et()),a),pe(K(a,mr(50)),c);const m=Xt(K(Ct(e,we(n),we(r),we(o),we(u)),On((y,[{scrollTop:g,scrollHeight:T},S,E,C,I])=>{const A=g+S-T>-I,O={viewportHeight:S,scrollTop:g,scrollHeight:T};if(A){let _,V;return g>y.state.scrollTop?(_="SCROLLED_DOWN",V=y.state.scrollTop-g):(_="SIZE_DECREASED",V=y.state.scrollTop-g||y.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:_,scrollTopDelta:V}}let L;return O.scrollHeight>y.state.scrollHeight?L="SIZE_INCREASED":S<y.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":g<y.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:O}},dF),et((y,g)=>y&&y.atBottom===g.atBottom))),p=Ft(K(e,On((y,{scrollTop:g,scrollHeight:T,viewportHeight:S})=>{if(j0(y.scrollHeight,T))return{scrollTop:g,scrollHeight:T,jump:0,changed:!1};{const E=T-(g+S)<1;return y.scrollTop!==g&&E?{scrollHeight:T,scrollTop:g,jump:y.scrollTop-g,changed:!0}:{scrollHeight:T,scrollTop:g,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),ve(y=>y.changed),de(y=>y.jump)),0);pe(K(m,de(y=>y.atBottom)),i),pe(K(i,mr(50)),l);const v=re(wi);pe(K(e,de(({scrollTop:y})=>y),et(),On((y,g)=>Lt(h)?{direction:y.direction,prevScrollTop:g}:{direction:g<y.prevScrollTop?bi:wi,prevScrollTop:g},{direction:wi,prevScrollTop:0}),de(y=>y.direction)),v),pe(K(e,mr(50),An(uF)),v);const b=re(0);return pe(K(f,ve(y=>!y),An(0)),b),pe(K(t,mr(100),Ee(f),ve(([y,g])=>!!g),On(([y,g],[T])=>[g,T],[0,0]),de(([y,g])=>g-y)),b),{isScrolling:f,isAtTop:a,isAtBottom:i,atBottomState:m,atTopStateChange:c,atBottomStateChange:l,scrollDirection:v,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Je(Bt)),yr=Ve(([{log:e}])=>{const t=re(!1),n=Xt(K(t,ve(r=>r),et()));return ze(t,r=>{r&&Lt(e)("props updated",{},Qt.DEBUG)}),{propsReady:t,didMount:n}},Je(gr),{singleton:!0});function Jd(e,t){e==0?t():requestAnimationFrame(()=>Jd(e-1,t))}function ef(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Si=Ve(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o,scrollTargetReached:s},{didMount:i}])=>{const a=re(!0),l=re(0),c=re(!0);return pe(K(i,Ee(l),ve(([u,d])=>!!d),An(!1)),a),pe(K(i,Ee(l),ve(([u,d])=>!!d),An(!1)),c),ze(K(Ct(t,i),Ee(a,e,n,c),ve(([[,u],d,{sizeTree:f},h,m])=>u&&(!Ye(f)||Wd(h))&&!d&&!m),Ee(l)),([,u])=>{In(s,()=>{Te(c,!0)}),Jd(4,()=>{In(r,()=>{Te(a,!0)}),Te(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:l,initialItemFinalLocationReached:c}},Je(Dn,Bt,vi,yr),{singleton:!0});function ew(e){return e?e==="smooth"?"smooth":"auto":!1}const hF=(e,t)=>typeof e=="function"?ew(e(t)):t&&ew(e),pF=Ve(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:a},{log:l},{scrollingInProgress:c}])=>{const u=re(!1),d=Oe();let f=null;function h(p){Te(o,{index:"LAST",align:"end",behavior:p})}ze(K(Ct(K(we(e),ss(1)),a),Ee(we(u),n,s,c),de(([[p,v],b,y,g,T])=>{let S=v&&g,E="auto";return S&&(E=hF(b,y||T),S=S&&!!E),{totalCount:p,shouldFollow:S,followOutputBehavior:E}}),ve(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:v})=>{f&&(f(),f=null),f=In(t,()=>{Lt(l)("following output to ",{totalCount:p},Qt.DEBUG),h(v),f=null})});function m(p){const v=In(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Lt(l)("scrolling to bottom due to increased size",{},Qt.DEBUG),h("auto"))});setTimeout(v,100)}return ze(K(Ct(we(u),e,i),ve(([p,,v])=>p&&v),On(({value:p},[,v])=>({refreshed:p===v,value:v}),{refreshed:!1,value:0}),ve(({refreshed:p})=>p),Ee(u,e)),([,p])=>{Lt(s)&&m(p!==!1)}),ze(d,()=>{m(Lt(u)!==!1)}),ze(Ct(we(u),r),([p,v])=>{p&&!v.atBottom&&v.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:u,autoscrollToBottom:d}},Je(Dn,xi,vi,Si,yr,gr,Bt));function mF(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const tw=Ve(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Oe(),i=Oe(),a=Xt(K(s,de(mF)));return pe(K(a,de(l=>l.totalCount)),e),pe(K(a,de(l=>l.groupIndices)),t),pe(K(Ct(r,n,o),ve(([l,c])=>al(c)),de(([l,c,u])=>hn(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),et(),de(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},Je(Dn,Bt));function Ti(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function nw(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const ll="top",cl="bottom",rw="none";function ow(e,t,n){return typeof e=="number"?n===bi&&t===ll||n===wi&&t===cl?e:0:n===bi?t===ll?e.main:e.reverse:t===cl?e.main:e.reverse}function sw(e,t){return typeof e=="number"?e:e[t]||0}const tf=Ve(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Oe(),i=re(0),a=re(0),l=re(0),c=Ft(K(Ct(we(e),we(t),we(r),we(s,Ti),we(l),we(i),we(o),we(n),we(a)),de(([u,d,f,[h,m],p,v,b,y,g])=>{const T=u-y,S=v+b,E=Math.max(f-T,0);let C=rw;const I=sw(g,ll),A=sw(g,cl);return h-=y,h+=f+b,m+=f+b,m-=y,h>u+S-I&&(C=bi),m<u-E+d+A&&(C=wi),C!==rw?[Math.max(T-f-ow(p,ll,C)-I,0),T-E-b+d+ow(p,cl,C)+A]:null}),ve(u=>u!=null),et(Ti)),[0,0]);return{listBoundary:s,overscan:l,topListHeight:i,increaseViewportBy:a,visibleRange:c}},Je(Bt),{singleton:!0});function gF(e,t,n){if(al(t)){const r=Q0(e,t);return[{index:hn(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const nf={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function iw(e,t,n){if(e.length===0)return[];if(!al(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=sl(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let u;c.index===a.start?u={type:"group",index:l}:u={index:c.index-(l+1)+n,groupIndex:l},s.push({...u,size:c.size,offset:c.offset,originalIndex:c.index,data:c.data})}return s}function ul(e,t,n,r,o,s){const{lastSize:i,lastOffset:a,lastIndex:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const p=e[e.length-1];u=p.offset+p.size}const d=n-l,f=a+d*i+(d-1)*r,h=c,m=f-u;return{items:iw(e,o,s),topItems:iw(t,o,s),topListHeight:t.reduce((p,v)=>v.size+p,0),offsetTop:c,offsetBottom:m,top:h,bottom:u,totalCount:n,firstItemIndex:s}}function aw(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-i>=e)break;i++}const a=e+i,l=ef(t,a),c=Array.from({length:a}).map((u,d)=>({index:d+l,size:0,offset:0,data:s[d+l]}));return ul(c,[],a,o,n,r)}const qr=Ve(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:a,topListHeight:l},{scrolledToInitialItem:c,initialTopMostItemIndex:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:m}])=>{const p=re([]),v=re(0),b=Oe();pe(s.topItemsIndexes,p);const y=Ft(K(Ct(h,m,we(i,Ti),we(t),we(e),we(u),c,we(p),we(r),we(o),n),ve(([E,C,,I,,,,,,,A])=>{const O=A&&A.length!==I;return E&&!C&&!O}),de(([,,[E,C],I,A,O,L,_,V,k,M])=>{const F=A,{sizeTree:N,offsetTree:R}=F,z=Lt(v);if(I===0)return{...nf,totalCount:I};if(E===0&&C===0)return z===0?{...nf,totalCount:I}:aw(z,O,A,V,k,M||[]);if(Ye(N))return z>0?null:ul(gF(ef(O,I),F,M),[],I,k,F,V);const D=[];if(_.length>0){const G=_[0],$=_[_.length-1];let j=0;for(const H of sl(N,G,$)){const Y=H.value,Q=Math.max(H.start,G),fe=Math.min(H.end,$);for(let U=Q;U<=fe;U++)D.push({index:U,size:Y,offset:j,data:M&&M[U]}),j+=Y}}if(!L)return ul([],D,I,k,F,V);const B=_.length>0?_[_.length-1]+1:0,Z=rF(R,E,C,B);if(Z.length===0)return null;const oe=I-1,te=nl([],G=>{for(const $ of Z){const j=$.value;let H=j.offset,Y=$.start;const Q=j.size;if(j.offset<E){Y+=Math.floor((E-j.offset+k)/(Q+k));const U=Y-$.start;H+=U*Q+U*k}Y<B&&(H+=(B-Y)*Q,Y=B);const fe=Math.min($.end,oe);for(let U=Y;U<=fe&&!(H>=C);U++)G.push({index:U,size:Q,offset:H,data:M&&M[U]}),H+=Q+k}});return ul(te,D,I,k,F,V)}),ve(E=>E!==null),et()),nf);pe(K(n,ve(Wd),de(E=>E==null?void 0:E.length)),t),pe(K(y,de(E=>E.topListHeight)),d),pe(d,l),pe(K(y,de(E=>[E.top,E.bottom])),a),pe(K(y,de(E=>E.items)),b);const g=Xt(K(y,ve(({items:E})=>E.length>0),Ee(t,n),ve(([{items:E},C])=>E[E.length-1].originalIndex===C-1),de(([,E,C])=>[E-1,C]),et(Ti),de(([E])=>E))),T=Xt(K(y,mr(200),ve(({items:E,topItems:C})=>E.length>0&&E[0].originalIndex===C.length),de(({items:E})=>E[0].index),et())),S=Xt(K(y,ve(({items:E})=>E.length>0),de(({items:E})=>{let C=0,I=E.length-1;for(;E[C].type==="group"&&C<I;)C++;for(;E[I].type==="group"&&I>C;)I--;return{startIndex:E[C].index,endIndex:E[I].index}}),et(nw)));return{listState:y,topItemsIndexes:p,endReached:g,startReached:T,rangeChanged:S,itemsRendered:b,initialItemCount:v,...f}},Je(Dn,tw,tf,Si,vi,xi,yr,Zd),{singleton:!0}),yF=Ve(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(pe(K(a,Ee(s),ve(([,l])=>l!==0),Ee(o,e,t,r,n),de(([[,l],c,u,d,f,h=[]])=>aw(l,c,u,d,f,h))),i),{}),Je(Dn,Si,qr,yr),{singleton:!0}),lw=Ve(([{scrollVelocity:e}])=>{const t=re(!1),n=Oe(),r=re(!1);return pe(K(e,Ee(r,t,n),ve(([o,s])=>!!s),de(([o,s,i,a])=>{const{exit:l,enter:c}=s;if(i){if(l(o,a))return!1}else if(c(o,a))return!0;return i}),et()),t),ze(K(Ct(t,e,n),Ee(r)),([[o,s,i],a])=>o&&a&&a.change&&a.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Je(xi),{singleton:!0}),vF=Ve(([{topItemsIndexes:e}])=>{const t=re(0);return pe(K(t,ve(n=>n>0),de(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},Je(qr)),cw=Ve(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Oe(),i=Ft(K(Ct(e,r,t,n,o),de(([a,l,c,u,d])=>a+l+c+u+d.offsetBottom+d.bottom)),0);return pe(we(i),s),{totalListHeight:i,totalListHeightChanged:s}},Je(Bt,qr),{singleton:!0});function uw(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const bF=uw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),wF=Ve(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:a},{listState:l},{beforeUnshiftWith:c,shiftWithOffset:u,sizes:d,gap:f},{log:h},{recalcInProgress:m}])=>{const p=Xt(K(l,Ee(a),On(([,b,y,g],[{items:T,totalCount:S,bottom:E,offsetBottom:C},I])=>{const A=E+C;let O=0;return y===S&&b.length>0&&T.length>0&&(T[0].originalIndex===0&&b[0].originalIndex===0||(O=A-g,O!==0&&(O+=I))),[O,T,S,A]},[0,[],0,0]),ve(([b])=>b!==0),Ee(t,i,r,s,h,m),ve(([,b,y,g,,,T])=>!T&&!g&&b!==0&&y===bi),de(([[b],,,,,y])=>(y("Upward scrolling compensation",{amount:b},Qt.DEBUG),b))));function v(b){b>0?(Te(e,{top:-b,behavior:"auto"}),Te(n,0)):(Te(n,0),Te(e,{top:-b,behavior:"auto"}))}return ze(K(p,Ee(n,o)),([b,y,g])=>{g&&bF()?Te(n,y-b):v(-b)}),ze(K(Ct(Ft(o,!1),n,m),ve(([b,y,g])=>!b&&!g&&y!==0),de(([b,y])=>y),mr(1)),v),pe(K(u,de(b=>({top:-b}))),e),ze(K(c,Ee(d,f),de(([b,{lastSize:y,groupIndices:g,sizeTree:T},S])=>{function E(C){return C*(y+S)}if(g.length===0)return E(b);{let C=0;const I=gi(T,0);let A=0,O=0;for(;A<b;){A++,C+=I;let L=g.length===O+1?1/0:g[O+1]-g[O]-1;A+L>b&&(C-=I,L=b-A+1),A+=L,C+=E(L),O++}return C}})),b=>{Te(n,b),requestAnimationFrame(()=>{Te(e,{top:b}),requestAnimationFrame(()=>{Te(n,0),Te(m,!1)})})}),{deviation:n}},Je(Bt,xi,qr,Dn,gr,Zd)),xF=Ve(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=re(0);return ze(K(e,Ee(r),ve(([,o])=>o!==0),de(([,o])=>({top:o}))),o=>{In(K(n,ss(1),ve(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Te(t,o)})})}),{initialScrollTop:r}},Je(yr,Bt,qr),{singleton:!0}),SF=Ve(([{viewportHeight:e},{totalListHeight:t}])=>{const n=re(!1),r=Ft(K(Ct(n,e,t),ve(([o])=>o),de(([,o,s])=>Math.max(0,o-s)),mr(0),et()),0);return{alignToBottom:n,paddingTopAddition:r}},Je(Bt,cw),{singleton:!0}),rf=Ve(([{scrollTo:e,scrollContainerState:t}])=>{const n=Oe(),r=Oe(),o=Oe(),s=re(!1),i=re(void 0);return pe(K(Ct(n,r),de(([{viewportHeight:a,scrollTop:l,scrollHeight:c},{offsetTop:u}])=>({scrollTop:Math.max(0,l-u),scrollHeight:c,viewportHeight:a}))),t),pe(K(e,Ee(r),de(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Je(Bt)),TF=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,EF=Ve(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:a,scrollingInProgress:l},{scrollToIndex:c}])=>{const u=Oe();return pe(K(u,Ee(e,o,t,s,i,a,r),Ee(n),de(([[d,f,h,m,p,v,b,y],g])=>{const{done:T,behavior:S,align:E,calculateViewLocation:C=TF,...I}=d,A=X0(d,f,m-1),O=yi(A,f.offsetTree,g)+p+v,L=O+hn(f.sizeTree,A)[1],_=y+v,V=y+h-b,k=C({itemTop:O,itemBottom:L,viewportTop:_,viewportBottom:V,locationParams:{behavior:S,align:E,...I}});return k?T&&In(K(l,ve(M=>M===!1),ss(Lt(l)?1:2)),T):T&&T(),k}),ve(d=>d!==null)),c),{scrollIntoView:u}},Je(Dn,Bt,vi,qr,gr),{singleton:!0}),CF=Ve(([{sizes:e,sizeRanges:t},{scrollTop:n,headerHeight:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=Oe(),u=re(void 0),d=re(null),f=re(null);return pe(a,d),pe(l,f),ze(K(c,Ee(e,n,i,d,f,r)),([h,m,p,v,b,y,g])=>{const T=iF(m.sizeTree);v&&b!==null&&y!==null&&(p=b.scrollTop-y.offsetTop),p-=g,h({ranges:T,scrollTop:p})}),pe(K(u,ve(Wd),de(PF)),o),pe(K(s,Ee(u),ve(([,h])=>h!==void 0),et(),de(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:u}},Je(Dn,Bt,Si,yr,rf));function PF(e){return{offset:e.scrollTop,index:0,align:"start"}}const kF=Ve(([e,t,n,r,o,s,i,a,l,c])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c}),Je(tf,yF,yr,lw,cw,xF,SF,rf,EF,gr)),dw=Ve(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:a,groupIndices:l,statefulTotalCount:c,gap:u,sizes:d},{initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:m},p,v,b,{listState:y,topItemsIndexes:g,...T},{scrollToIndex:S},E,{topItemCount:C},{groupCounts:I},A])=>(pe(T.rangeChanged,A.scrollSeekRangeChanged),pe(K(A.windowViewportRect,de(O=>O.visibleHeight)),p.viewportHeight),{totalCount:e,data:i,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:m,topItemsIndexes:g,topItemCount:C,groupCounts:I,fixedItemHeight:n,defaultItemHeight:r,gap:u,...b,statefulTotalCount:c,listState:y,scrollToIndex:S,trackItemSizes:o,itemSize:s,groupIndices:l,...T,...A,...p,sizes:d,...v}),Je(Dn,Si,Bt,CF,pF,qr,vi,wF,vF,tw,kF)),of="-webkit-sticky",fw="sticky",hw=uw(()=>{if(typeof document>"u")return fw;const e=document.createElement("div");return e.style.position=of,e.style.position===of?of:fw});function sf(e,t){const n=w.useRef(null),r=w.useCallback(a=>{if(a===null||!a.offsetParent)return;const l=a.getBoundingClientRect(),c=l.width;let u,d;if(t){const f=t.getBoundingClientRect(),h=l.top-f.top;u=f.height-Math.max(0,h),d=h+t.scrollTop}else u=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:u,visibleWidth:c},e(n.current)},[e,t]),{callbackRef:o,ref:s}=Ud(r),i=w.useCallback(()=>{r(s.current)},[r,s]);return w.useEffect(()=>{if(t){t.addEventListener("scroll",i);const a=new ResizeObserver(()=>{requestAnimationFrame(i)});return a.observe(t),()=>{t.removeEventListener("scroll",i),a.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const dl=w.createContext(void 0),pw=w.createContext(void 0);function af(e){return e}const IF=Ve(([e,t])=>({...e,...t}),Je(dw,Ve(()=>{const e=re(l=>`Item ${l}`),t=re(null),n=re(l=>`Group ${l}`),r=re({}),o=re(af),s=re("div"),i=re(Gr),a=(l,c=null)=>Ft(K(r,de(u=>u[l]),et()),c);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}))),AF=({height:e})=>w.createElement("div",{style:{height:e}}),OF={position:hw(),zIndex:1,overflowAnchor:"none"},_F={overflowAnchor:"none"},mw=w.memo(function({showTopList:t=!1}){const n=Ie("listState"),r=on("sizeRanges"),o=Ie("useWindowScroll"),s=Ie("customScrollParent"),i=on("windowScrollContainerState"),a=on("scrollContainerState"),l=s||o?i:a,c=Ie("itemContent"),u=Ie("context"),d=Ie("groupContent"),f=Ie("trackItemSizes"),h=Ie("itemSize"),m=Ie("log"),p=on("gap"),{callbackRef:v}=B0(r,h,f,t?Gr:l,m,p,s),[b,y]=w.useState(0);uf("deviation",k=>{b!==k&&y(k)});const g=Ie("EmptyPlaceholder"),T=Ie("ScrollSeekPlaceholder")||AF,S=Ie("ListComponent"),E=Ie("ItemComponent"),C=Ie("GroupComponent"),I=Ie("computeItemKey"),A=Ie("isSeeking"),O=Ie("groupIndices").length>0,L=Ie("alignToBottom"),_=Ie("initialItemFinalLocationReached"),V=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:L?"auto":0,..._?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&g?w.createElement(g,ut(g,u)):w.createElement(S,{...ut(S,u),ref:v,style:V,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const M=k.originalIndex,F=I(M+n.firstItemIndex,k.data,u);return A?w.createElement(T,{...ut(T,u),key:F,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?w.createElement(C,{...ut(C,u),key:F,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,style:OF},d(k.index,u)):w.createElement(E,{...ut(E,u),...gw(E,k.data),key:F,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:_F},O?c(k.index,k.groupIndex,k.data,u):c(k.index,k.data,u))}))}),DF={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},as=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),MF={width:"100%",position:hw(),top:0,zIndex:1};function ut(e,t){if(typeof e!="string")return{context:t}}function gw(e,t){return{item:typeof e=="string"?void 0:t}}const NF=w.memo(function(){const t=Ie("HeaderComponent"),n=on("headerHeight"),r=Ie("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=Ie("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),LF=w.memo(function(){const t=Ie("FooterComponent"),n=on("footerHeight"),r=Ie("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=Ie("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null});function lf({usePublisher:e,useEmitter:t,useEmitterValue:n}){return w.memo(function({style:s,children:i,...a}){const l=e("scrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("context"),{scrollerRef:h,scrollByCallback:m,scrollToCallback:p}=W0(l,u,c,d);return t("scrollTo",p),t("scrollBy",m),w.createElement(c,{ref:h,style:{...DF,...s},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...ut(c,f)},i)})}function cf({usePublisher:e,useEmitter:t,useEmitterValue:n}){return w.memo(function({style:s,children:i,...a}){const l=e("windowScrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("totalListHeight"),f=n("deviation"),h=n("customScrollParent"),m=n("context"),{scrollerRef:p,scrollByCallback:v,scrollToCallback:b}=W0(l,u,c,Gr,h);return UL(()=>(p.current=h||window,()=>{p.current=null}),[p,h]),t("windowScrollTo",b),t("scrollBy",v),w.createElement(c,{style:{position:"relative",...s,...d!==0?{height:d+f}:{}},"data-virtuoso-scroller":!0,...a,...ut(c,m)},i)})}const FF=({children:e})=>{const t=w.useContext(dl),n=on("viewportHeight"),r=on("fixedItemHeight"),o=Ie("alignToBottom"),s=_n(w.useMemo(()=>pi(n,i=>fn(i,"height")),[n]));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),w.createElement("div",{style:as(o),ref:s,"data-viewport-type":"element"},e)},VF=({children:e})=>{const t=w.useContext(dl),n=on("windowViewportRect"),r=on("fixedItemHeight"),o=Ie("customScrollParent"),s=sf(n,o),i=Ie("alignToBottom");return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),w.createElement("div",{ref:s,style:as(i),"data-viewport-type":"window"},e)},$F=({children:e})=>{const t=Ie("TopItemListComponent")||"div",n=Ie("headerHeight"),r={...MF,marginTop:`${n}px`},o=Ie("context");return w.createElement(t,{style:r,...ut(t,o)},e)},RF=w.memo(function(t){const n=Ie("useWindowScroll"),r=Ie("topItemsIndexes").length>0,o=Ie("customScrollParent"),s=o||n?WF:jF,i=o||n?VF:FF;return w.createElement(s,{...t},r&&w.createElement($F,null,w.createElement(mw,{showTopList:!0})),w.createElement(i,null,w.createElement(NF,null),w.createElement(mw,null),w.createElement(LF,null)))}),{Component:BF,usePublisher:on,useEmitterValue:Ie,useEmitter:uf}=Hd(IF,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},RF),jF=lf({usePublisher:on,useEmitterValue:Ie,useEmitter:uf}),WF=cf({usePublisher:on,useEmitterValue:Ie,useEmitter:uf}),df=BF,yw={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},zF={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:vw,ceil:bw,floor:fl,min:ff,max:Ei}=Math;function HF(e){return{...zF,items:e}}function ww(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function UF(e,t){return e&&e.column===t.column&&e.row===t.row}function hl(e,t){return e&&e.width===t.width&&e.height===t.height}const GF=Ve(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:a,scrollContainerState:l,footerHeight:c,headerHeight:u},d,f,{propsReady:h,didMount:m},{windowViewportRect:p,useWindowScroll:v,customScrollParent:b,windowScrollContainerState:y,windowScrollTo:g},T])=>{const S=re(0),E=re(0),C=re(yw),I=re({height:0,width:0}),A=re({height:0,width:0}),O=Oe(),L=Oe(),_=re(0),V=re(null),k=re({row:0,column:0}),M=Oe(),F=Oe(),N=re(!1),R=re(0),z=re(!0),D=re(!1);ze(K(m,Ee(R),ve(([$,j])=>!!j)),()=>{Te(z,!1),Te(E,0)}),ze(K(Ct(m,z,A,I,R,D),ve(([$,j,H,Y,,Q])=>$&&!j&&H.height!==0&&Y.height!==0&&!Q)),([,,,,$])=>{Te(D,!0),Jd(1,()=>{Te(O,$)}),In(K(r),()=>{Te(n,[0,0]),Te(z,!0)})}),pe(K(F,ve($=>$!=null&&$.scrollTop>0),An(0)),E),ze(K(m,Ee(F),ve(([,$])=>$!=null)),([,$])=>{$&&(Te(I,$.viewport),Te(A,$==null?void 0:$.item),Te(k,$.gap),$.scrollTop>0&&(Te(N,!0),In(K(r,ss(1)),j=>{Te(N,!1)}),Te(i,{top:$.scrollTop})))}),pe(K(I,de(({height:$})=>$)),o),pe(K(Ct(we(I,hl),we(A,hl),we(k,($,j)=>$&&$.column===j.column&&$.row===j.row),we(r)),de(([$,j,H,Y])=>({viewport:$,item:j,gap:H,scrollTop:Y}))),M),pe(K(Ct(we(S),t,we(k,UF),we(A,hl),we(I,hl),we(V),we(E),we(N),we(z),we(R)),ve(([,,,,,,,$])=>!$),de(([$,[j,H],Y,Q,fe,U,Ae,,Ke,Be])=>{const{row:Ce,column:q}=Y,{height:ie,width:W}=Q,{width:ee}=fe;if(Ae===0&&($===0||ee===0))return yw;if(W===0){const Wt=ef(Be,$),ro=Wt===0?Math.max(Ae-1,0):Wt;return HF(ww(Wt,ro,U))}const ye=Sw(ee,W,q);let ue,je;Ke?j===0&&H===0&&Ae>0?(ue=0,je=Ae-1):(ue=ye*fl((j+Ce)/(ie+Ce)),je=ye*bw((H+Ce)/(ie+Ce))-1,je=ff($-1,Ei(je,ye-1)),ue=ff(je,Ei(0,ue))):(ue=0,je=-1);const ne=ww(ue,je,U),{top:le,bottom:Ne}=xw(fe,Y,Q,ne),tt=bw($/ye),Vt=tt*ie+(tt-1)*Ce-Ne;return{items:ne,offsetTop:le,offsetBottom:Vt,top:le,bottom:Ne,itemHeight:ie,itemWidth:W}})),C),pe(K(V,ve($=>$!==null),de($=>$.length)),S),pe(K(Ct(I,A,C,k),ve(([$,j,{items:H}])=>H.length>0&&j.height!==0&&$.height!==0),de(([$,j,{items:H},Y])=>{const{top:Q,bottom:fe}=xw($,Y,j,H);return[Q,fe]}),et(Ti)),n);const B=re(!1);pe(K(r,Ee(B),de(([$,j])=>j||$!==0)),B);const Z=Xt(K(we(C),ve(({items:$})=>$.length>0),Ee(S,B),ve(([{items:$},j,H])=>H&&$[$.length-1].index===j-1),de(([,$])=>$-1),et())),oe=Xt(K(we(C),ve(({items:$})=>$.length>0&&$[0].index===0),An(0),et())),te=Xt(K(we(C),Ee(N),ve(([{items:$},j])=>$.length>0&&!j),de(([{items:$}])=>({startIndex:$[0].index,endIndex:$[$.length-1].index})),et(nw),mr(0)));pe(te,f.scrollSeekRangeChanged),pe(K(O,Ee(I,A,S,k),de(([$,j,H,Y,Q])=>{const fe=J0($),{align:U,behavior:Ae,offset:Ke}=fe;let Be=fe.index;Be==="LAST"&&(Be=Y-1),Be=Ei(0,Be,ff(Y-1,Be));let Ce=hf(j,Q,H,Be);return U==="end"?Ce=vw(Ce-j.height+H.height):U==="center"&&(Ce=vw(Ce-j.height/2+H.height/2)),Ke&&(Ce+=Ke),{top:Ce,behavior:Ae}})),i);const G=Ft(K(C,de($=>$.offsetBottom+$.bottom)),0);return pe(K(p,de($=>({width:$.visibleWidth,height:$.visibleHeight}))),I),{data:V,totalCount:S,viewportDimensions:I,itemDimensions:A,scrollTop:r,scrollHeight:L,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:O,smoothScrollTargetReached:a,windowViewportRect:p,windowScrollTo:g,useWindowScroll:v,customScrollParent:b,windowScrollContainerState:y,deviation:_,scrollContainerState:l,footerHeight:c,headerHeight:u,initialItemCount:E,gap:k,restoreStateFrom:F,...f,initialTopMostItemIndex:R,gridState:C,totalListHeight:G,...d,startReached:oe,endReached:Z,rangeChanged:te,stateChanged:M,propsReady:h,stateRestoreInProgress:N,...T}},Je(tf,Bt,xi,lw,yr,rf,gr));function xw(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=hf(e,t,n,r[0].index),i=hf(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function hf(e,t,n,r){const o=Sw(e.width,n.width,t.column),s=fl(r/o),i=s*n.height+Ei(0,s-1)*t.row;return i>0?i+t.row:i}function Sw(e,t,n){return Ei(1,fl((e+n)/(fl(t)+n)))}const YF=Ve(([e,t])=>({...e,...t}),Je(GF,Ve(()=>{const e=re(c=>`Item ${c}`),t=re({}),n=re(null),r=re("virtuoso-grid-item"),o=re("virtuoso-grid-list"),s=re(af),i=re("div"),a=re(Gr),l=(c,u=null)=>Ft(K(t,de(d=>d[c]),et()),u);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}))),qF=w.memo(function(){const t=ot("gridState"),n=ot("listClassName"),r=ot("itemClassName"),o=ot("itemContent"),s=ot("computeItemKey"),i=ot("isSeeking"),a=pn("scrollHeight"),l=ot("ItemComponent"),c=ot("ListComponent"),u=ot("ScrollSeekPlaceholder"),d=ot("context"),f=pn("itemDimensions"),h=pn("gap"),m=ot("log"),p=ot("stateRestoreInProgress"),v=_n(w.useMemo(()=>b=>{const y=b.parentElement.parentElement.scrollHeight;a(y);const g=b.firstChild;if(g){const{width:T,height:S}=g.getBoundingClientRect();f({width:T,height:S})}h({row:Ew("row-gap",getComputedStyle(b).rowGap,m),column:Ew("column-gap",getComputedStyle(b).columnGap,m)})},[a,f,h,m]));return p?null:w.createElement(c,{ref:v,className:n,...ut(c,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const y=s(b.index,b.data,d);return i?w.createElement(u,{key:y,...ut(u,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):w.createElement(l,{...ut(l,d),className:r,"data-index":b.index,key:y},o(b.index,b.data,d))}))}),KF=w.memo(function(){const t=ot("HeaderComponent"),n=pn("headerHeight"),r=ot("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=ot("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),ZF=w.memo(function(){const t=ot("FooterComponent"),n=pn("footerHeight"),r=ot("headerFooterTag"),o=_n(w.useMemo(()=>i=>n(fn(i,"height")),[n])),s=ot("context");return t?w.createElement(r,{ref:o},w.createElement(t,ut(t,s))):null}),XF=({children:e})=>{const t=w.useContext(pw),n=pn("itemDimensions"),r=pn("viewportDimensions"),o=_n(w.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]));return w.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),w.createElement("div",{style:as(!1),ref:o},e)},QF=({children:e})=>{const t=w.useContext(pw),n=pn("windowViewportRect"),r=pn("itemDimensions"),o=ot("customScrollParent"),s=sf(n,o);return w.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),w.createElement("div",{ref:s,style:as(!1)},e)},JF=w.memo(function({...t}){const n=ot("useWindowScroll"),r=ot("customScrollParent"),o=r||n?t2:e2,s=r||n?QF:XF;return w.createElement(o,{...t},w.createElement(s,null,w.createElement(KF,null),w.createElement(qF,null),w.createElement(ZF,null)))}),{Component:xB,usePublisher:pn,useEmitterValue:ot,useEmitter:Tw}=Hd(YF,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},JF),e2=lf({usePublisher:pn,useEmitterValue:ot,useEmitter:Tw}),t2=cf({usePublisher:pn,useEmitterValue:ot,useEmitter:Tw});function Ew(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Qt.WARN),t==="normal"?0:parseInt(t??"0",10)}const n2=Ve(([e,t])=>({...e,...t}),Je(dw,Ve(()=>{const e=re(l=>w.createElement("td",null,"Item $",l)),t=re(null),n=re(null),r=re(null),o=re({}),s=re(af),i=re(Gr),a=(l,c=null)=>Ft(K(o,de(u=>u[l]),et()),c);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:o,computeItemKey:s,scrollerRef:i,TableComponent:a("Table","table"),TableHeadComponent:a("TableHead","thead"),TableFooterComponent:a("TableFoot","tfoot"),TableBodyComponent:a("TableBody","tbody"),TableRowComponent:a("TableRow","tr"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),FillerRow:a("FillerRow")}}))),r2=({height:e})=>w.createElement("tr",null,w.createElement("td",{style:{height:e}})),o2=({height:e})=>w.createElement("tr",null,w.createElement("td",{style:{height:e,padding:0,border:0}})),s2={overflowAnchor:"none"},i2=w.memo(function(){const t=He("listState"),n=mn("sizeRanges"),r=He("useWindowScroll"),o=He("customScrollParent"),s=mn("windowScrollContainerState"),i=mn("scrollContainerState"),a=o||r?s:i,l=He("itemContent"),c=He("trackItemSizes"),u=He("itemSize"),d=He("log"),{callbackRef:f,ref:h}=B0(n,u,c,a,d,void 0,o),[m,p]=w.useState(0);pf("deviation",F=>{m!==F&&(h.current.style.marginTop=`${F}px`,p(F))});const v=He("EmptyPlaceholder"),b=He("ScrollSeekPlaceholder")||r2,y=He("FillerRow")||o2,g=He("TableBodyComponent"),T=He("TableRowComponent"),S=He("computeItemKey"),E=He("isSeeking"),C=He("paddingTopAddition"),I=He("firstItemIndex"),A=He("statefulTotalCount"),O=He("context");if(A===0&&v)return w.createElement(v,ut(v,O));const L=t.offsetTop+C+m,_=t.offsetBottom,V=L>0?w.createElement(y,{height:L,key:"padding-top",context:O}):null,k=_>0?w.createElement(y,{height:_,key:"padding-bottom",context:O}):null,M=t.items.map(F=>{const N=F.originalIndex,R=S(N+I,F.data,O);return E?w.createElement(b,{...ut(b,O),key:R,index:F.index,height:F.size,type:F.type||"item"}):w.createElement(T,{...ut(T,O),...gw(T,F.data),key:R,"data-index":N,"data-known-size":F.size,"data-item-index":F.index,style:s2},l(F.index,F.data,O))});return w.createElement(g,{ref:f,"data-testid":"virtuoso-item-list",...ut(g,O)},[V,...M,k])}),a2=({children:e})=>{const t=w.useContext(dl),n=mn("viewportHeight"),r=mn("fixedItemHeight"),o=_n(w.useMemo(()=>pi(n,s=>fn(s,"height")),[n]));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),w.createElement("div",{style:as(!1),ref:o,"data-viewport-type":"element"},e)},l2=({children:e})=>{const t=w.useContext(dl),n=mn("windowViewportRect"),r=mn("fixedItemHeight"),o=He("customScrollParent"),s=sf(n,o);return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),w.createElement("div",{ref:s,style:as(!1),"data-viewport-type":"window"},e)},c2=w.memo(function(t){const n=He("useWindowScroll"),r=He("customScrollParent"),o=mn("fixedHeaderHeight"),s=mn("fixedFooterHeight"),i=He("fixedHeaderContent"),a=He("fixedFooterContent"),l=He("context"),c=_n(w.useMemo(()=>pi(o,y=>fn(y,"height")),[o])),u=_n(w.useMemo(()=>pi(s,y=>fn(y,"height")),[s])),d=r||n?f2:d2,f=r||n?l2:a2,h=He("TableComponent"),m=He("TableHeadComponent"),p=He("TableFooterComponent"),v=i?w.createElement(m,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:c,...ut(m,l)},i()):null,b=a?w.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:u,...ut(p,l)},a()):null;return w.createElement(d,{...t},w.createElement(f,null,w.createElement(h,{style:{borderSpacing:0,overflowAnchor:"none"},...ut(h,l)},[v,w.createElement(i2,{key:"TableBody"}),b])))}),{Component:u2,usePublisher:mn,useEmitterValue:He,useEmitter:pf}=Hd(n2,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},c2),d2=lf({usePublisher:mn,useEmitterValue:He,useEmitter:pf}),f2=cf({usePublisher:mn,useEmitterValue:He,useEmitter:pf}),h2=u2,Cw=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>x.jsxs("div",{className:Me("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger",children:[s,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(D0,{as:"button",type:"button",title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(Py,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:x.jsx("div",{className:"w-full max-w-48 whitespace-break-spaces break-words",children:r})}):null,e?x.jsxs(w.Fragment,{children:[x.jsx(Ey,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),x.jsx(WI,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),Ci=w.forwardRef(({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:f="",name:h,title:m,componentName:p,placeholder:v,hideLeft:b=!1,required:y,disabled:g,reportStatus:T},S)=>{const E=W_(),C=T!==void 0?T:E.input.iconFeedback,I=d??h,A=Tt(),O=e??A.inputOptionalLabel;return x.jsxs("fieldset",{ref:S,form:u,disabled:g,"data-error":!!c,"aria-disabled":g,"data-component":p,"data-interactive":!!s,className:Me("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:I,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger",children:[x.jsx(Cw,{info:a,hideLeft:b,reportStatus:C,title:m,placeholder:v,children:O||n?x.jsxs(w.Fragment,{children:[y?null:x.jsx("span",{"aria-disabled":g,className:"text-opacity-70 aria-disabled:text-disabled",children:O}),n?x.jsx(w.Fragment,{children:n}):null]}):null}),x.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${f}`,children:[t?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,l,i?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:i}):null]})]}),x.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:c}),x.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})}),p2=e=>x.jsx(w.Fragment,{children:e.children}),m2={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},g2={caseSensitive:!1,sort:!1},y2=[],v2=w.forwardRef(function(t,n){return x.jsx(at.ul,{...t,ref:n,className:"w-full rounded-lg border-b border-tooltip-border last:border-transparent",children:x.jsx(er,{children:t.children})})}),b2=w.forwardRef(function({item:t,context:n,...r},o){return x.jsx(at.li,{...r,ref:o,className:"first:rounded-t-lg last:rounded-t-lg"})}),w2={List:v2,Item:b2},ls=320,mf=40,x2=w.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,emptyMessage:o,interactive:s,rightLabel:i,optionalText:a,container:l,hideLeft:c=!1,right:u,left:d,error:f,required:h=!1,...m},p)=>{const v=w.useRef(null),b=w.useRef(null),y=m.value??m.defaultValue??"",g=Tt(),[T,S]=w.useState(()=>Math.min(ls,mf*e.length)),[E,C]=w.useState(!1),[I,A]=w.useState(""),[O,L]=w.useState(y),[_,V]=w.useState(()=>{var q;return((q=e.find(ie=>ie.value===y))==null?void 0:q.label)??y}),[k,M]=w.useState(null),F=w.useRef(y2),N=t&&I!==""?[{value:I,label:I,"data-dynamic":"true"},...e]:e,R=new Ur(N,["value","label"],g2).search(I),z=()=>{C(!1),S(0)},D=R.filter(q=>q.hidden!==!0),B=t?void 0:`^(${e.map(q=>`${fc(q.value)}${q.label?"|"+fc(q.label):""}`).join("|")})$`;w.useEffect(()=>{if(m.value){const q=e.find(ie=>ie.value===m.value);L((q==null?void 0:q.label)??m.value)}},[m.value]),w.useEffect(()=>{E||S(0)},[E]),w.useEffect(()=>{if(!E)return;const q=G.floating;if(q.current===null)return;let ie=0;Array.from(q.current.querySelectorAll("li")).slice(0,Math.min(R.length,10)).forEach(ye=>{const ue=ye.getBoundingClientRect();ie+=ue.height});const ee=Math.min(ie,ls);S(ee)},[I,E]);const{x:Z,y:oe,strategy:te,refs:G,context:$}=Wr({open:E,transform:!0,strategy:"absolute",onOpenChange:C,whileElementsMounted:ai,middleware:[li(4),Ob({padding:10,elementContext:"reference",apply(q){var ue;const ie=(ue=v.current)==null?void 0:ue.getBoundingClientRect().width,W=q.elements.floating.querySelector("ul"),ee=(W==null?void 0:W.getBoundingClientRect().height)||0,ye=Math.min(ee<mf?ls:ee,ls);xs.flushSync(()=>setTimeout(()=>{const je=(W==null?void 0:W.getBoundingClientRect().height)??0;return je<mf?void S(ye):void S(Math.min(je,ls))},50)),Object.assign(q.elements.floating.style,{width:`${ie}px`,maxWidth:`${ie}px`,maxHeight:`${ls}`})}})]}),j=f0($,m2),{getReferenceProps:H,getFloatingProps:Y,getItemProps:Q}=zr([Hr($,{role:"listbox"}),jr($),Md($,{cols:0,listRef:F,loop:!0,virtual:!0,allowEscape:!0,activeIndex:k,selectedIndex:k,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:q=>M(ie=>q??ie)})]);w.useEffect(()=>{const q=G.reference.current;if(q)return Os(q)},[]);const fe=(q,ie)=>{L(q.value);const W=G.reference.current;if(!W)return;W==null||W.setAttribute("data-value",q.value),W.value=q.value;const ee=new Event("change",{bubbles:!1,cancelable:!0});W.dispatchEvent(ee),m.onChange&&m.onChange(ee),V(q.label??""),z(),A(""),M(ie)},U=q=>{var W;const ie=q.target.value;return A(ie),!E&&ie===""?C(!0):(q.target.name=m.name||"",ie?C(!0):(W=m.onChange)==null?void 0:W.call(m,q))},Ae=()=>{var q;C(!0),A(""),(q=G.reference.current)==null||q.focus()},Ke=()=>{C(!0),A("")},Be=()=>{var q;(q=G.reference.current)==null||q.setAttribute("data-value",""),A(""),L(""),V(""),uc(G.reference.current),z()},Ce=m.id||m.name;return x.jsxs(Ci,{...m,left:d,error:f,ref:v,form:m.form,name:m.name,feedback:n,hideLeft:c,required:h,title:m.title,container:l,rightLabel:i,interactive:s,id:m.name||m.id,optionalText:a,componentName:"autocomplete",labelClassName:r,placeholder:m.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"p-2 transition-colors link:text-primary md:p-1",onClick:Ae,children:[x.jsx(Eu,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),O?x.jsx("button",{type:"button",onClick:Be,className:"p-2 transition-colors link:text-danger md:p-1",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[x.jsx("input",{"data-shadow":"true",...H({...m,onChange:U,onFocus:Ke,pattern:B,ref:G.setReference,name:`${Ce}-shadow`,id:`${Ce}-shadow`,onClick:q=>q.currentTarget.focus(),onKeyDown(q){var ie,W;if(q.key==="ArrowDown"){let ee=k+1;return ee>R.length-1&&(ee=0),(ie=b.current)==null||ie.scrollIntoView({index:ee}),M(ee)}if(q.key==="ArrowUp"){let ee=k-1;return ee<0&&(ee=R.length-1),(W=b.current)==null||W.scrollIntoView({index:ee}),M(ee)}if(q.key==="Escape")return q.currentTarget.blur(),z();if(q.key==="Enter"){if(k!==null&&R[k])return q.preventDefault(),fe(R[k],k);if(R.length===1)return q.preventDefault(),fe(R[0],0)}}}),"data-value":O,"data-error":!!f,"data-name":Ce,"data-target":Ce,required:h,value:E?I:_||O,"aria-autocomplete":"list",autoComplete:"off",className:Me("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",m.className)}),x.jsx("input",{id:Ce,name:Ce,type:"hidden","data-origin":Ce,ref:p,required:h,defaultValue:m.value||O||void 0}),x.jsx(Rr,{preserveTabOrder:!0,children:E?x.jsx(Zo,{guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("ul",{...Y({ref:G.setFloating,style:{...j.styles,position:te,left:(Z??0)+(O?26:18),top:oe??0}}),"data-floating":"true",className:"isolate z-floating m-0 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[R.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-transparent",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:o||g.autocompleteEmpty})}):null,x.jsx(df,{ref:b,data:D,components:w2,hidden:D.length===0,className:"rounded-lg border-floating-border bg-floating-background p-0 text-foreground",style:{height:T},itemContent:(q,ie)=>{const W=ie.Render??p2,ee=O===ie.value||O===ie.label,ye=k===q,ue=ie.label??ie.value;return x.jsx("button",{"data-value":ie.value,...Q({ref:je=>void(F.current[q]=je),role:"option",type:"button","aria-checked":ee,"aria-current":ee,"aria-selected":ee,"aria-busy":ie.disabled,onClick:()=>fe(ie,q),className:`cursor-pointer w-full p-2 text-left ${ee?"bg-primary-hover text-primary-foreground":""} ${ye?"bg-floating-hover text-floating-foreground":""}`}),children:x.jsx(W,{...m,label:ie.label,value:ie.value,children:ue})})}})]})}):null})]})});class cs extends Map{constructor(t){super(t),this.list=[],this.list=[],Array.isArray(t)&&(this.list=t),t instanceof cs&&(this.list=Array.from(t.entries()))}set(t,n){return super.set(t,n),this.list=(this.list??[]).concat([[t,n]]),this}delete(t){const n=super.delete(t);return this.list=Array.from(this.entries())??[],n}map(t){return this.list.map(n=>t(n[1]))}clone(){return new cs(this)}}const gf=w.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>x.jsxs("label",{"data-task":t,"data-component":"checkbox","data-disabled":a.disabled,"aria-disabled":a.disabled,className:Me("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[x.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:Me("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,x.jsx("span",{"data-name":"checkbox-label",className:Me("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),S2=e=>x.jsx(w.Fragment,{children:e.children}),T2={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},E2={caseSensitive:!1,sort:!1},Pw=[],C2=w.forwardRef(function(t,n){return x.jsx(at.ul,{...t,ref:n,className:"w-full rounded-b-lg border-b border-tooltip-border last:border-transparent",children:x.jsx(er,{children:t.children})})}),P2=w.forwardRef(function({item:t,context:n,...r},o){return x.jsx(at.li,{...r,ref:o,className:"last:rounded-t-lg"})}),k2={List:C2,Item:P2},I2=e=>{const t=Tt(),n=w.useRef(null),r=w.Children.count(e.children),[o,s]=w.useState(!1);return w.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement.getBoundingClientRect(),l=Array.from(n.current.querySelectorAll("[data-component='tag']")).reduce((u,d)=>u+d.getBoundingClientRect().width,0);if(n.current.querySelectorAll("[data-multicounter]").length&&r<=3)return s(!1);if(l>i.width)return s(!0)},[r]),x.jsx("span",{ref:n,className:"flex flex-nowrap gap-x-2",children:o?x.jsxs(pc,{size:"small","data-multicounter":"true",children:[r," ",t.multiComboboxSelectedLabel]}):e.children})},A2=w.forwardRef(({left:e,error:t,right:n,options:r,container:o,rightLabel:s,interactive:i,emptyMessage:a,optionalText:l,selectedLabel:c,labelClassName:u,feedback:d=null,hideLeft:f=!1,required:h=!1,dynamicOption:m=!1,...p},v)=>{const b=w.useMemo(()=>new cs(r.map(W=>[W.value,W])),[r]),y=w.useRef(null),g=w.useRef(null),T=p.value??p.defaultValue??Pw,S=Tt(),[E,C]=w.useState(0),[I,A]=w.useState(!1),[O,L]=w.useState(""),[_,V]=w.useState(()=>{const W=new cs;return T.forEach(ee=>{const ye=b.get(ee);return ye?W.set(ee,ye):void 0}),W}),k=w.useMemo(()=>Array.from(_.keys()),[_]),[M,F]=w.useState(()=>{const W=new Set(T);return r.reduce((ee,ye)=>W.has(ye.value)?[...ee,ye.label??ye.value]:ee,[])??T}),[N,R]=w.useState(null),z=w.useRef(Pw),D=m&&O!==""?[{value:O,label:O,"data-dynamic":"true"},...r]:r,B=new Ur(D,["value","label"],E2).search(O);w.useEffect(()=>{I||C(0)},[I]),w.useEffect(()=>{p.value&&V(new cs(p.value.map(W=>[W,b.get(W)])))},[p.value,b]);const{x:Z,y:oe,strategy:te,refs:G,context:$}=Wr({open:I,transform:!0,strategy:"absolute",onOpenChange:A,whileElementsMounted:ai,middleware:[li(4),Ob({padding:10,elementContext:"reference",apply(W){var ue;const ee=(ue=y.current)==null?void 0:ue.getBoundingClientRect().width,ye=360;xs.flushSync(()=>setTimeout(()=>C(ye),200)),Object.assign(W.elements.floating.style,{width:`${ee}px`,maxWidth:`${ee}px`,maxHeight:`${ye}px`,height:`${ye}px`})}})]}),j=f0($,T2),{getReferenceProps:H,getFloatingProps:Y,getItemProps:Q}=zr([Hr($,{role:"listbox"}),jr($),Md($,{cols:0,listRef:z,loop:!0,virtual:!0,allowEscape:!0,activeIndex:N,selectedIndex:N,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:W=>R(ee=>W??ee)})]);w.useEffect(()=>{const W=G.reference.current;if(W)return Os(W)},[]);const fe=(W,ee)=>{const ye=_.clone();_.has(W.value)?ye.delete(W.value):ye.set(W.value,W),V(ye);const ue=G.reference.current;if(!ue)return;ue==null||ue.setAttribute("data-value",W.value),ue.value=Array.from(ye.values());const je=new Event("change",{bubbles:!1,cancelable:!0});ue.dispatchEvent(je),p.onChange&&p.onChange(je),F(ne=>ne.concat(W.label??"")),L(""),R(ee)},U=W=>{const ee=W.target.value;return L(ee),!I&&ee===""?A(!0):(W.target.name=p.name||"",ee?A(!0):void 0)},Ae=()=>{var W;A(!0),L(""),(W=G.reference.current)==null||W.focus()},Ke=()=>{A(!0),L("")},Be=()=>{var W;(W=G.reference.current)==null||W.setAttribute("data-value",""),L(""),uc(G.reference.current),A(!1)},Ce=p.id||p.name,q=_.map(W=>x.jsx(pc,{size:"small",children:W.label??W.value},`multicombobox-${W.value}-x`)),ie=B.filter(W=>W.hidden!==!0);return x.jsxs(Ci,{...p,left:e,error:t,ref:y,form:p.form,name:p.name,feedback:d,hideLeft:f,required:h,title:p.title,container:o,rightLabel:s,interactive:i,id:p.name||p.id,optionalText:l,componentName:"autocomplete",labelClassName:u,placeholder:p.placeholder,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"transition-colors link:text-primary",onClick:Ae,children:[x.jsx(Eu,{size:20}),x.jsx("span",{className:"sr-only",children:S.inputCaretDown})]}),_?x.jsx("button",{type:"button",onClick:Be,className:"transition-colors link:text-danger",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[x.jsx("button",{...H({...p,onFocus:Ke,id:`${Ce}-shadow`,name:`${Ce}-shadow`,ref:G.setReference}),type:"button","data-name":Ce,"data-target":Ce,"data-shadow":"true","data-error":!!t,"aria-autocomplete":"list","data-value":k.join(","),value:I?O:M||_,className:Me("input placeholder-input-mask group h-input-height w-full","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary","flex flex-row items-center gap-2 whitespace-nowrap text-left","truncate overflow-ellipsis",p.className),children:x.jsx(I2,{label:c,children:q})}),x.jsx("input",{id:Ce,name:Ce,type:"hidden","data-origin":Ce,ref:v,required:h,defaultValue:p.value||k||void 0}),x.jsx(Rr,{preserveTabOrder:!0,children:I?x.jsx(Zo,{guards:!0,returnFocus:!1,context:$,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsxs("div",{...Y({ref:G.setFloating,style:{...j.styles,position:te,left:(Z??0)+(_?26:18),top:oe??0}}),"data-floating":"true",className:"isolate z-floating m-0 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:[x.jsx("input",{autoFocus:!0,value:O,onChange:U,title:p.title,placeholder:S.multiComboboxInnerPlaceholder,onKeyDown:W=>{var ee,ye;if(W.key==="ArrowDown"){let ue=N+1;return ue>B.length-1&&(ue=0),(ee=g.current)==null||ee.scrollIntoView({index:ue}),R(ue)}if(W.key==="ArrowUp"){let ue=N-1;return ue<0&&(ue=B.length-1),(ye=g.current)==null||ye.scrollIntoView({index:ue}),R(ue)}if(W.key==="Escape")return W.currentTarget.blur(),A(!1);if(W.key==="Enter"){if(N!==null&&B[N])return W.preventDefault(),fe(B[N],N);if(B.length===1)return W.preventDefault(),fe(B[0],0)}},className:"input placeholder-input-mask group mb-1 h-10 w-full flex-1 border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary"}),B.length===0?x.jsx("li",{role:"option",className:"w-full border-b border-tooltip-border last:border-transparent",children:x.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:a||S.autocompleteEmpty})}):null,x.jsx(df,{ref:g,data:ie,components:k2,hidden:ie.length===0,style:{height:_.size===0?E-49:E-86},className:"border-floating-border bg-floating-background p-0 text-foreground",itemContent:(W,ee)=>{const ye=ee.Render??S2,ue=_.has(ee.value)||_.has(ee.label??""),je=N===W,ne=ee.label??ee.value;return x.jsx("button",{"data-value":ee.value,...Q({ref:le=>void(z.current[W]=le),role:"option",type:"button","aria-checked":ue,"aria-current":ue,"aria-selected":ue,"aria-busy":ee.disabled,onClick:()=>fe(ee,W)}),className:`w-full cursor-pointer p-2 text-left hover:bg-floating-hover focus:bg-floating-hover ${ue||je?"bg-floating-hover text-floating-foreground":""}`,children:x.jsx(gf,{onChange:hc,checked:ue,"aria-checked":ue,onClick:le=>(le.stopPropagation(),void le.preventDefault()),children:x.jsx(ye,{...p,label:ee.label,value:ee.value,children:ne})})})}}),_.size===0?null:x.jsx("div",{className:"sticky bottom-0 flex w-full flex-nowrap items-center gap-2 overflow-x-auto rounded-b-lg bg-floating-background p-2",children:q})]})}):null})]})}),kw=(e,t,n,r)=>w.forwardRef(({info:s,left:i,next:a,error:l,right:c,container:u,rightLabel:d,interactive:f,optionalText:h,type:m="text",labelClassName:p,feedback:v=null,hideLeft:b=!1,...y},g)=>{const T=e,S=y.id??y.name,E=w.useRef(null);return w.useEffect(()=>{if(E.current===null)return;const C=E.current,I=Os(E.current),A=r==null?void 0:r(C),O=L=>{const _=L;if(_.key==="Enter"&&C.enterKeyHint==="next"){const V=C.getAttribute("data-next");if(V){const k=document.getElementById(V);if(k)return k.focus(),void _.preventDefault()}}};return C.addEventListener("keydown",O),()=>{A==null||A(),I(),C.removeEventListener("keydown",O)}},[]),x.jsx(Ci,{...n,info:s,left:i,error:l,right:c,form:y.form,name:y.name,feedback:v,hideLeft:b,title:y.title,container:u,rightLabel:d,disabled:y.disabled,interactive:f,required:y.required,componentName:t,id:y.name||y.id,optionalText:h,labelClassName:p,placeholder:y.placeholder,children:x.jsx(T,{...n,...y,id:S,name:S,type:m,"data-next":a,"aria-busy":y.disabled,"aria-disabled":y.disabled,"aria-readonly":y.readOnly,ref:cc(g,E),className:Me("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","resize-y group-focus-within:border-primary group-hover:border-primary","disabled:cursor-not-allowed disabled:text-disabled",y.className)})})}),Pi=kw(lv,"input",{type:"text"}),Iw=new Date(1970,11,31),yf={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},Aw={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},O2={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},vf=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},_2=w.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=t||Uu(),l=w.useId(),c=Tt(),u=w.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[d,f]=w.useState(e||void 0),[h,m]=w.useState(!1),p=vf(u,Iw).flatMap(C=>Pt.keyof(yf,C.type)?yf[C.type](C.value):[]),v=vf(u,Iw).reduce((C,I)=>C+(Pt.keyof(Aw,I.type)?Aw[I.type](I.value):""),""),[b,y]=w.useState(d?vf(u,d).reduce((C,I)=>C+(Pt.keyof(yf,I.type)?O2[I.type](d,I.value):""),""):""),g=C=>{const I=C.target.value;if(y(I),p.length===I.length&&p.every((O,L)=>{const _=I.charAt(L);return typeof O=="string"?_===O:O.test(_)})){const O=Mo(QO(I,v,new Date));return f(O),r==null?void 0:r(O)}return f(void 0),r==null?void 0:r(void 0)},T=C=>(f(C),r==null||r(C),y(C?JA(C,v):"")),S=My(d),E=S?d.toISOString():void 0;return x.jsx(Pi,{...s,mask:p,value:b,id:void 0,name:void 0,className:"uppercase","data-value":E,formNoValidate:!h,"data-target":s.name,"data-component":"date-picker",onChange:g,required:s.required??!0,error:h?void 0:s.error,placeholder:s.placeholder??v,right:x.jsxs(w.Fragment,{children:[x.jsx("input",{"data-origin":s.name,defaultValue:E,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),x.jsx(Qo,{open:h,onChange:m,trigger:x.jsxs("span",{"aria-labelledby":l,children:[x.jsx("span",{id:l,className:"sr-only",children:c.datePickerCalendarButtonLabel}),x.jsx(BI,{})]}),buttonProps:{"aria-describedby":l},children:x.jsx(Iv,{...s,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:T,disabledDate:n,date:S?d:void 0})})]})})}),D2=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],M2=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],N2=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],L2=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Ow=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function _w(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?L2:N2:t.binary?M2:D2,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=Ow(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=Ow(Number(e),t.locale,i),c=n[a];return s+l+r+c}var bf={exports:{}},pl={exports:{}},$e={};/** @license React v16.13.1
213
213
  * react-is.production.min.js
214
214
  *
215
215
  * Copyright (c) Facebook, Inc. and its affiliates.
216
216
  *
217
217
  * This source code is licensed under the MIT license found in the
218
218
  * LICENSE file in the root directory of this source tree.
219
- */var Dw;function L2(){if(Dw)return $e;Dw=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function g(S){if(typeof S=="object"&&S!==null){var E=S.$$typeof;switch(E){case t:switch(S=S.type,S){case l:case c:case r:case s:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case m:case h:case i:return S;default:return E}}case n:return E}}}function T(S){return g(S)===c}return $e.AsyncMode=l,$e.ConcurrentMode=c,$e.ContextConsumer=a,$e.ContextProvider=i,$e.Element=t,$e.ForwardRef=u,$e.Fragment=r,$e.Lazy=m,$e.Memo=h,$e.Portal=n,$e.Profiler=s,$e.StrictMode=o,$e.Suspense=d,$e.isAsyncMode=function(S){return T(S)||g(S)===l},$e.isConcurrentMode=T,$e.isContextConsumer=function(S){return g(S)===a},$e.isContextProvider=function(S){return g(S)===i},$e.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},$e.isForwardRef=function(S){return g(S)===u},$e.isFragment=function(S){return g(S)===r},$e.isLazy=function(S){return g(S)===m},$e.isMemo=function(S){return g(S)===h},$e.isPortal=function(S){return g(S)===n},$e.isProfiler=function(S){return g(S)===s},$e.isStrictMode=function(S){return g(S)===o},$e.isSuspense=function(S){return g(S)===d},$e.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===s||S===o||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===h||S.$$typeof===i||S.$$typeof===a||S.$$typeof===u||S.$$typeof===y||S.$$typeof===b||S.$$typeof===v||S.$$typeof===p)},$e.typeOf=g,$e}var Re={};/** @license React v16.13.1
219
+ */var Dw;function F2(){if(Dw)return $e;Dw=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function g(S){if(typeof S=="object"&&S!==null){var E=S.$$typeof;switch(E){case t:switch(S=S.type,S){case l:case c:case r:case s:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case m:case h:case i:return S;default:return E}}case n:return E}}}function T(S){return g(S)===c}return $e.AsyncMode=l,$e.ConcurrentMode=c,$e.ContextConsumer=a,$e.ContextProvider=i,$e.Element=t,$e.ForwardRef=u,$e.Fragment=r,$e.Lazy=m,$e.Memo=h,$e.Portal=n,$e.Profiler=s,$e.StrictMode=o,$e.Suspense=d,$e.isAsyncMode=function(S){return T(S)||g(S)===l},$e.isConcurrentMode=T,$e.isContextConsumer=function(S){return g(S)===a},$e.isContextProvider=function(S){return g(S)===i},$e.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},$e.isForwardRef=function(S){return g(S)===u},$e.isFragment=function(S){return g(S)===r},$e.isLazy=function(S){return g(S)===m},$e.isMemo=function(S){return g(S)===h},$e.isPortal=function(S){return g(S)===n},$e.isProfiler=function(S){return g(S)===s},$e.isStrictMode=function(S){return g(S)===o},$e.isSuspense=function(S){return g(S)===d},$e.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===s||S===o||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===h||S.$$typeof===i||S.$$typeof===a||S.$$typeof===u||S.$$typeof===v||S.$$typeof===b||S.$$typeof===y||S.$$typeof===p)},$e.typeOf=g,$e}var Re={};/** @license React v16.13.1
220
220
  * react-is.development.js
221
221
  *
222
222
  * Copyright (c) Facebook, Inc. and its affiliates.
223
223
  *
224
224
  * This source code is licensed under the MIT license found in the
225
225
  * LICENSE file in the root directory of this source tree.
226
- */var Mw;function F2(){return Mw||(Mw=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function g(U){return typeof U=="string"||typeof U=="function"||U===r||U===c||U===s||U===o||U===d||U===f||typeof U=="object"&&U!==null&&(U.$$typeof===m||U.$$typeof===h||U.$$typeof===i||U.$$typeof===a||U.$$typeof===u||U.$$typeof===y||U.$$typeof===b||U.$$typeof===v||U.$$typeof===p)}function T(U){if(typeof U=="object"&&U!==null){var Ae=U.$$typeof;switch(Ae){case t:var Ke=U.type;switch(Ke){case l:case c:case r:case s:case o:case d:return Ke;default:var Be=Ke&&Ke.$$typeof;switch(Be){case a:case u:case m:case h:case i:return Be;default:return Ae}}case n:return Ae}}}var S=l,E=c,C=a,I=i,A=t,O=u,F=r,_=m,V=h,k=n,M=s,L=o,N=d,R=!1;function z(U){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(U)||T(U)===l}function D(U){return T(U)===c}function B(U){return T(U)===a}function Z(U){return T(U)===i}function oe(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function te(U){return T(U)===u}function G(U){return T(U)===r}function $(U){return T(U)===m}function j(U){return T(U)===h}function H(U){return T(U)===n}function Y(U){return T(U)===s}function Q(U){return T(U)===o}function fe(U){return T(U)===d}Re.AsyncMode=S,Re.ConcurrentMode=E,Re.ContextConsumer=C,Re.ContextProvider=I,Re.Element=A,Re.ForwardRef=O,Re.Fragment=F,Re.Lazy=_,Re.Memo=V,Re.Portal=k,Re.Profiler=M,Re.StrictMode=L,Re.Suspense=N,Re.isAsyncMode=z,Re.isConcurrentMode=D,Re.isContextConsumer=B,Re.isContextProvider=Z,Re.isElement=oe,Re.isForwardRef=te,Re.isFragment=G,Re.isLazy=$,Re.isMemo=j,Re.isPortal=H,Re.isProfiler=Y,Re.isStrictMode=Q,Re.isSuspense=fe,Re.isValidElementType=g,Re.typeOf=T}()),Re}var Nw;function Lw(){return Nw||(Nw=1,process.env.NODE_ENV==="production"?hl.exports=L2():hl.exports=F2()),hl.exports}/*
226
+ */var Mw;function V2(){return Mw||(Mw=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function g(U){return typeof U=="string"||typeof U=="function"||U===r||U===c||U===s||U===o||U===d||U===f||typeof U=="object"&&U!==null&&(U.$$typeof===m||U.$$typeof===h||U.$$typeof===i||U.$$typeof===a||U.$$typeof===u||U.$$typeof===v||U.$$typeof===b||U.$$typeof===y||U.$$typeof===p)}function T(U){if(typeof U=="object"&&U!==null){var Ae=U.$$typeof;switch(Ae){case t:var Ke=U.type;switch(Ke){case l:case c:case r:case s:case o:case d:return Ke;default:var Be=Ke&&Ke.$$typeof;switch(Be){case a:case u:case m:case h:case i:return Be;default:return Ae}}case n:return Ae}}}var S=l,E=c,C=a,I=i,A=t,O=u,L=r,_=m,V=h,k=n,M=s,F=o,N=d,R=!1;function z(U){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(U)||T(U)===l}function D(U){return T(U)===c}function B(U){return T(U)===a}function Z(U){return T(U)===i}function oe(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function te(U){return T(U)===u}function G(U){return T(U)===r}function $(U){return T(U)===m}function j(U){return T(U)===h}function H(U){return T(U)===n}function Y(U){return T(U)===s}function Q(U){return T(U)===o}function fe(U){return T(U)===d}Re.AsyncMode=S,Re.ConcurrentMode=E,Re.ContextConsumer=C,Re.ContextProvider=I,Re.Element=A,Re.ForwardRef=O,Re.Fragment=L,Re.Lazy=_,Re.Memo=V,Re.Portal=k,Re.Profiler=M,Re.StrictMode=F,Re.Suspense=N,Re.isAsyncMode=z,Re.isConcurrentMode=D,Re.isContextConsumer=B,Re.isContextProvider=Z,Re.isElement=oe,Re.isForwardRef=te,Re.isFragment=G,Re.isLazy=$,Re.isMemo=j,Re.isPortal=H,Re.isProfiler=Y,Re.isStrictMode=Q,Re.isSuspense=fe,Re.isValidElementType=g,Re.typeOf=T}()),Re}var Nw;function Lw(){return Nw||(Nw=1,process.env.NODE_ENV==="production"?pl.exports=F2():pl.exports=V2()),pl.exports}/*
227
227
  object-assign
228
228
  (c) Sindre Sorhus
229
229
  @license MIT
230
- */var vf,Fw;function V2(){if(Fw)return vf;Fw=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return vf=o()?Object.assign:function(s,i){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},vf}var bf,Vw;function wf(){if(Vw)return bf;Vw=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return bf=e,bf}var xf,$w;function Rw(){return $w||($w=1,xf=Function.call.bind(Object.prototype.hasOwnProperty)),xf}var Sf,Bw;function $2(){if(Bw)return Sf;Bw=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wf(),n={},r=Rw();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](i,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sf=o,Sf}var Tf,jw;function R2(){if(jw)return Tf;jw=1;var e=Lw(),t=V2(),n=wf(),r=Rw(),o=$2(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return Tf=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(D){var B=D&&(c&&D[c]||D[u]);if(typeof B=="function")return B}var f="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:v(),arrayOf:g,element:T(),elementType:S(),instanceOf:E,node:O(),objectOf:I,oneOf:C,oneOfType:A,shape:_,exact:V};function m(D,B){return D===B?D!==0||1/D===1/B:D!==D&&B!==B}function p(D,B){this.message=D,this.data=B&&typeof B=="object"?B:{},this.stack=""}p.prototype=Error.prototype;function y(D){if(process.env.NODE_ENV!=="production")var B={},Z=0;function oe(G,$,j,H,Y,Q,fe){if(H=H||f,Q=Q||j,fe!==n){if(l){var U=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw U.name="Invariant Violation",U}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ae=H+":"+j;!B[Ae]&&Z<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+H+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),B[Ae]=!0,Z++)}}return $[j]==null?G?$[j]===null?new p("The "+Y+" `"+Q+"` is marked as required "+("in `"+H+"`, but its value is `null`.")):new p("The "+Y+" `"+Q+"` is marked as required in "+("`"+H+"`, but its value is `undefined`.")):null:D($,j,H,Y,Q)}var te=oe.bind(null,!1);return te.isRequired=oe.bind(null,!0),te}function b(D){function B(Z,oe,te,G,$,j){var H=Z[oe],Y=L(H);if(Y!==D){var Q=N(H);return new p("Invalid "+G+" `"+$+"` of type "+("`"+Q+"` supplied to `"+te+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return y(B)}function v(){return y(i)}function g(D){function B(Z,oe,te,G,$){if(typeof D!="function")return new p("Property `"+$+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var j=Z[oe];if(!Array.isArray(j)){var H=L(j);return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected an array."))}for(var Y=0;Y<j.length;Y++){var Q=D(j,Y,te,G,$+"["+Y+"]",n);if(Q instanceof Error)return Q}return null}return y(B)}function T(){function D(B,Z,oe,te,G){var $=B[Z];if(!a($)){var j=L($);return new p("Invalid "+te+" `"+G+"` of type "+("`"+j+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return y(D)}function S(){function D(B,Z,oe,te,G){var $=B[Z];if(!e.isValidElementType($)){var j=L($);return new p("Invalid "+te+" `"+G+"` of type "+("`"+j+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return y(D)}function E(D){function B(Z,oe,te,G,$){if(!(Z[oe]instanceof D)){var j=D.name||f,H=z(Z[oe]);return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected ")+("instance of `"+j+"`."))}return null}return y(B)}function C(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function B(Z,oe,te,G,$){for(var j=Z[oe],H=0;H<D.length;H++)if(m(j,D[H]))return null;var Y=JSON.stringify(D,function(fe,U){var Ae=N(U);return Ae==="symbol"?String(U):U});return new p("Invalid "+G+" `"+$+"` of value `"+String(j)+"` "+("supplied to `"+te+"`, expected one of "+Y+"."))}return y(B)}function I(D){function B(Z,oe,te,G,$){if(typeof D!="function")return new p("Property `"+$+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var j=Z[oe],H=L(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected an object."));for(var Y in j)if(r(j,Y)){var Q=D(j,Y,te,G,$+"."+Y,n);if(Q instanceof Error)return Q}return null}return y(B)}function A(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var B=0;B<D.length;B++){var Z=D[B];if(typeof Z!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+R(Z)+" at index "+B+"."),i}function oe(te,G,$,j,H){for(var Y=[],Q=0;Q<D.length;Q++){var fe=D[Q],U=fe(te,G,$,j,H,n);if(U==null)return null;U.data&&r(U.data,"expectedType")&&Y.push(U.data.expectedType)}var Ae=Y.length>0?", expected one of type ["+Y.join(", ")+"]":"";return new p("Invalid "+j+" `"+H+"` supplied to "+("`"+$+"`"+Ae+"."))}return y(oe)}function O(){function D(B,Z,oe,te,G){return k(B[Z])?null:new p("Invalid "+te+" `"+G+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return y(D)}function F(D,B,Z,oe,te){return new p((D||"React class")+": "+B+" type `"+Z+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function _(D){function B(Z,oe,te,G,$){var j=Z[oe],H=L(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type `"+H+"` "+("supplied to `"+te+"`, expected `object`."));for(var Y in D){var Q=D[Y];if(typeof Q!="function")return F(te,G,$,Y,N(Q));var fe=Q(j,Y,te,G,$+"."+Y,n);if(fe)return fe}return null}return y(B)}function V(D){function B(Z,oe,te,G,$){var j=Z[oe],H=L(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type `"+H+"` "+("supplied to `"+te+"`, expected `object`."));var Y=t({},Z[oe],D);for(var Q in Y){var fe=D[Q];if(r(D,Q)&&typeof fe!="function")return F(te,G,$,Q,N(fe));if(!fe)return new p("Invalid "+G+" `"+$+"` key `"+Q+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(Z[oe],null," ")+`
231
- Valid keys: `+JSON.stringify(Object.keys(D),null," "));var U=fe(j,Q,te,G,$+"."+Q,n);if(U)return U}return null}return y(B)}function k(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(k);if(D===null||a(D))return!0;var B=d(D);if(B){var Z=B.call(D),oe;if(B!==D.entries){for(;!(oe=Z.next()).done;)if(!k(oe.value))return!1}else for(;!(oe=Z.next()).done;){var te=oe.value;if(te&&!k(te[1]))return!1}}else return!1;return!0;default:return!1}}function M(D,B){return D==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function L(D){var B=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":M(B,D)?"symbol":B}function N(D){if(typeof D>"u"||D===null)return""+D;var B=L(D);if(B==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return B}function R(D){var B=N(D);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function z(D){return!D.constructor||!D.constructor.name?f:D.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Tf}var Ef,Ww;function B2(){if(Ww)return Ef;Ww=1;var e=wf();function t(){}function n(){}return n.resetWarningCache=t,Ef=function(){function r(i,a,l,c,u,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Ef}if(process.env.NODE_ENV!=="production"){var j2=Lw(),W2=!0;yf.exports=R2()(j2.isElement,W2)}else yf.exports=B2()();var z2=yf.exports;const qe=Qx(z2);var H2=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Pi(e,t){var n=U2(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function U2(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=H2.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var G2=[".DS_Store","Thumbs.db"];function Y2(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return pl(e)&&q2(e.dataTransfer)?[2,Q2(e.dataTransfer,e.type)]:K2(e)?[2,Z2(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,X2(e)]:[2,[]]})})}function q2(e){return pl(e)}function K2(e){return pl(e)&&pl(e.target)}function pl(e){return typeof e=="object"&&e!==null}function Z2(e){return Cf(e.target.files).map(function(t){return Pi(t)})}function X2(e){return Jo(this,void 0,void 0,function(){var t;return es(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Pi(r)})]}})})}function Q2(e,t){return Jo(this,void 0,void 0,function(){var n,r;return es(this,function(o){switch(o.label){case 0:return e.items?(n=Cf(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(J2))]):[3,2];case 1:return r=o.sent(),[2,zw(Hw(r))];case 2:return[2,zw(Cf(e.files).map(function(s){return Pi(s)}))]}})})}function zw(e){return e.filter(function(t){return G2.indexOf(t.name)===-1})}function Cf(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function J2(e){if(typeof e.webkitGetAsEntry!="function")return Uw(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Gw(t):Uw(e)}function Hw(e){return e.reduce(function(t,n){return Md(Md([],b0(t),!1),b0(Array.isArray(n)?Hw(n):[n]),!1)},[])}function Uw(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Pi(t);return Promise.resolve(n)}function eV(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return[2,e.isDirectory?Gw(e):tV(e)]})})}function Gw(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(a){return Jo(i,void 0,void 0,function(){var l,c,u;return es(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(eV)),o.push(u),s(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}s()})}function tV(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Pi(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var nV=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var a=i.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):o===a})}return!0};function Yw(e){return sV(e)||oV(e)||Xw(e)||rV()}function rV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
232
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sV(e){if(Array.isArray(e))return Pf(e)}function qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Kw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(n),!0).forEach(function(r){Zw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ki(e,t){return lV(e)||aV(e,t)||Xw(e,t)||iV()}function iV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
233
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xw(e,t){if(e){if(typeof e=="string")return Pf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pf(e,t)}}function Pf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function lV(e){if(Array.isArray(e))return e}var cV="file-invalid-type",uV="file-too-large",dV="file-too-small",fV="too-many-files",hV=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:cV,message:"File type must be ".concat(n)}},Qw=function(t){return{code:uV,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Jw=function(t){return{code:dV,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},pV={code:fV,message:"Too many files"};function ex(e,t){var n=e.type==="application/x-moz-file"||nV(e,t);return[n,n?null:hV(t)]}function tx(e,t,n){if(Kr(e.size))if(Kr(t)&&Kr(n)){if(e.size>n)return[!1,Qw(n)];if(e.size<t)return[!1,Jw(t)]}else{if(Kr(t)&&e.size<t)return[!1,Jw(t)];if(Kr(n)&&e.size>n)return[!1,Qw(n)]}return[!0,null]}function Kr(e){return e!=null}function mV(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(l){var c=ex(l,n),u=ki(c,1),d=u[0],f=tx(l,r,o),h=ki(f,1),m=h[0],p=a?a(l):null;return d&&m&&!p})}function ml(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function gl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function nx(e){e.preventDefault()}function gV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yV(e){return e.indexOf("Edge/")!==-1}function vV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gV(e)||yV(e)}function Mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(a){return!ml(r)&&a&&a.apply(void 0,[r].concat(s)),ml(r)})}}function bV(){return"showOpenFilePicker"in window}function wV(e){if(Kr(e)){var t=Object.entries(e).filter(function(n){var r=ki(n,2),o=r[0],s=r[1],i=!0;return rx(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(ox))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=ki(r,2),s=o[0],i=o[1];return Kw(Kw({},n),{},Zw({},s,i))},{});return[{description:"Files",accept:t}]}return e}function xV(e){if(Kr(e))return Object.entries(e).reduce(function(t,n){var r=ki(n,2),o=r[0],s=r[1];return[].concat(Yw(t),[o],Yw(s))},[]).filter(function(t){return rx(t)||ox(t)}).join(",")}function SV(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function TV(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function rx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function ox(e){return/^.*\.[\w]+$/.test(e)}var EV=["children"],CV=["open"],PV=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],kV=["refKey","onChange","onClick"];function IV(e){return _V(e)||OV(e)||sx(e)||AV()}function AV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
234
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _V(e){if(Array.isArray(e))return If(e)}function kf(e,t){return NV(e)||MV(e,t)||sx(e,t)||DV()}function DV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
235
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sx(e,t){if(e){if(typeof e=="string")return If(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return If(e,t)}}function If(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function NV(e){if(Array.isArray(e))return e}function ix(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ix(Object(n),!0).forEach(function(r){Af(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ix(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Af(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yl(e,t){if(e==null)return{};var n=LV(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Of=w.forwardRef(function(e,t){var n=e.children,r=yl(e,EV),o=lx(r),s=o.open,i=yl(o,CV);return w.useImperativeHandle(t,function(){return{open:s}},[s]),w.createElement(w.Fragment,null,n(st(st({},i),{},{open:s})))});Of.displayName="Dropzone";var ax={disabled:!1,getFilesFromEvent:Y2,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Of.defaultProps=ax,Of.propTypes={children:qe.func,accept:qe.objectOf(qe.arrayOf(qe.string)),multiple:qe.bool,preventDropOnDocument:qe.bool,noClick:qe.bool,noKeyboard:qe.bool,noDrag:qe.bool,noDragEventsBubbling:qe.bool,minSize:qe.number,maxSize:qe.number,maxFiles:qe.number,disabled:qe.bool,getFilesFromEvent:qe.func,onFileDialogCancel:qe.func,onFileDialogOpen:qe.func,useFsAccessApi:qe.bool,autoFocus:qe.bool,onDragEnter:qe.func,onDragLeave:qe.func,onDragOver:qe.func,onDrop:qe.func,onDropAccepted:qe.func,onDropRejected:qe.func,onError:qe.func,validator:qe.func};var _f={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function lx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=st(st({},ax),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,y=t.onFileDialogOpen,b=t.useFsAccessApi,v=t.autoFocus,g=t.preventDropOnDocument,T=t.noClick,S=t.noKeyboard,E=t.noDrag,C=t.noDragEventsBubbling,I=t.onError,A=t.validator,O=w.useMemo(function(){return xV(n)},[n]),F=w.useMemo(function(){return wV(n)},[n]),_=w.useMemo(function(){return typeof y=="function"?y:cx},[y]),V=w.useMemo(function(){return typeof p=="function"?p:cx},[p]),k=w.useRef(null),M=w.useRef(null),L=w.useReducer(FV,_f),N=kf(L,2),R=N[0],z=N[1],D=R.isFocused,B=R.isFileDialogActive,Z=w.useRef(typeof window<"u"&&window.isSecureContext&&b&&bV()),oe=function(){!Z.current&&B&&setTimeout(function(){if(M.current){var le=M.current.files;le.length||(z({type:"closeDialog"}),V())}},300)};w.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[M,B,V,Z]);var te=w.useRef([]),G=function(le){k.current&&k.current.contains(le.target)||(le.preventDefault(),te.current=[])};w.useEffect(function(){return g&&(document.addEventListener("dragover",nx,!1),document.addEventListener("drop",G,!1)),function(){g&&(document.removeEventListener("dragover",nx),document.removeEventListener("drop",G))}},[k,g]),w.useEffect(function(){return!r&&v&&k.current&&k.current.focus(),function(){}},[k,v,r]);var $=w.useCallback(function(ne){I?I(ne):console.error(ne)},[I]),j=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne),te.current=[].concat(IV(te.current),[ne.target]),gl(ne)&&Promise.resolve(o(ne)).then(function(le){if(!(ml(ne)&&!C)){var Ne=le.length,tt=Ne>0&&mV({files:le,accept:O,minSize:i,maxSize:s,multiple:a,maxFiles:l,validator:A}),Ot=Ne>0&&!tt;z({isDragAccept:tt,isDragReject:Ot,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ne)}}).catch(function(le){return $(le)})},[o,c,$,C,O,i,s,a,l,A]),H=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne);var le=gl(ne);if(le&&ne.dataTransfer)try{ne.dataTransfer.dropEffect="copy"}catch{}return le&&d&&d(ne),!1},[d,C]),Y=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne);var le=te.current.filter(function(tt){return k.current&&k.current.contains(tt)}),Ne=le.indexOf(ne.target);Ne!==-1&&le.splice(Ne,1),te.current=le,!(le.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),gl(ne)&&u&&u(ne))},[k,u,C]),Q=w.useCallback(function(ne,le){var Ne=[],tt=[];ne.forEach(function(Ot){var Vt=ex(Ot,O),Wt=kf(Vt,2),ro=Wt[0],bs=Wt[1],ws=tx(Ot,i,s),Vl=kf(ws,2),sh=Vl[0],ih=Vl[1],ah=A?A(Ot):null;if(ro&&sh&&!ah)Ne.push(Ot);else{var lh=[bs,ih];ah&&(lh=lh.concat(ah)),tt.push({file:Ot,errors:lh.filter(function(oB){return oB})})}}),(!a&&Ne.length>1||a&&l>=1&&Ne.length>l)&&(Ne.forEach(function(Ot){tt.push({file:Ot,errors:[pV]})}),Ne.splice(0)),z({acceptedFiles:Ne,fileRejections:tt,type:"setFiles"}),f&&f(Ne,tt,le),tt.length>0&&m&&m(tt,le),Ne.length>0&&h&&h(Ne,le)},[z,a,O,i,s,l,f,h,m,A]),fe=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne),te.current=[],gl(ne)&&Promise.resolve(o(ne)).then(function(le){ml(ne)&&!C||Q(le,ne)}).catch(function(le){return $(le)}),z({type:"reset"})},[o,Q,$,C]),U=w.useCallback(function(){if(Z.current){z({type:"openDialog"}),_();var ne={multiple:a,types:F};window.showOpenFilePicker(ne).then(function(le){return o(le)}).then(function(le){Q(le,null),z({type:"closeDialog"})}).catch(function(le){SV(le)?(V(le),z({type:"closeDialog"})):TV(le)?(Z.current=!1,M.current?(M.current.value=null,M.current.click()):$(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):$(le)});return}M.current&&(z({type:"openDialog"}),_(),M.current.value=null,M.current.click())},[z,_,V,b,Q,$,F,a]),Ae=w.useCallback(function(ne){!k.current||!k.current.isEqualNode(ne.target)||(ne.key===" "||ne.key==="Enter"||ne.keyCode===32||ne.keyCode===13)&&(ne.preventDefault(),U())},[k,U]),Ke=w.useCallback(function(){z({type:"focus"})},[]),Be=w.useCallback(function(){z({type:"blur"})},[]),Ce=w.useCallback(function(){T||(vV()?setTimeout(U,0):U())},[T,U]),q=function(le){return r?null:le},ie=function(le){return S?null:q(le)},W=function(le){return E?null:q(le)},ee=function(le){C&&le.stopPropagation()},ye=w.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=ne.refKey,Ne=le===void 0?"ref":le,tt=ne.role,Ot=ne.onKeyDown,Vt=ne.onFocus,Wt=ne.onBlur,ro=ne.onClick,bs=ne.onDragEnter,ws=ne.onDragOver,Vl=ne.onDragLeave,sh=ne.onDrop,ih=yl(ne,PV);return st(st(Af({onKeyDown:ie(Mn(Ot,Ae)),onFocus:ie(Mn(Vt,Ke)),onBlur:ie(Mn(Wt,Be)),onClick:q(Mn(ro,Ce)),onDragEnter:W(Mn(bs,j)),onDragOver:W(Mn(ws,H)),onDragLeave:W(Mn(Vl,Y)),onDrop:W(Mn(sh,fe)),role:typeof tt=="string"&&tt!==""?tt:"presentation"},Ne,k),!r&&!S?{tabIndex:0}:{}),ih)}},[k,Ae,Ke,Be,Ce,j,H,Y,fe,S,E,r]),ue=w.useCallback(function(ne){ne.stopPropagation()},[]),je=w.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=ne.refKey,Ne=le===void 0?"ref":le,tt=ne.onChange,Ot=ne.onClick,Vt=yl(ne,kV),Wt=Af({accept:O,multiple:a,type:"file",style:{display:"none"},onChange:q(Mn(tt,fe)),onClick:q(Mn(Ot,ue)),tabIndex:-1},Ne,M);return st(st({},Wt),Vt)}},[M,n,a,fe,r]);return st(st({},R),{},{isFocused:D&&!r,getRootProps:ye,getInputProps:je,rootRef:k,inputRef:M,open:q(U)})}function FV(e,t){switch(t.type){case"focus":return st(st({},e),{},{isFocused:!0});case"blur":return st(st({},e),{},{isFocused:!1});case"openDialog":return st(st({},_f),{},{isFileDialogActive:!0});case"closeDialog":return st(st({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return st(st({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return st(st({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return st({},_f);default:return e}}function cx(){}const VV={isImage:e=>e.type.includes("image")},$V=e=>{const[t,n]=w.useState({url:"",type:"",size:""});return w.useEffect(()=>{if(VV.isImage(e.file)){const r=URL.createObjectURL(e.file);return n({url:r,type:"img",size:_w(e.file.size)}),()=>{URL.revokeObjectURL(r)}}n({url:"",type:e.file.type,size:_w(e.file.size)})},[e.file]),t.type==="img"?x.jsxs("div",{className:"gap-jade-200 flex w-full flex-row items-center justify-between",children:[x.jsxs("header",{className:"gap-jade-200 flex flex-row items-center",children:[x.jsx("img",{src:t.url,className:"size-jade-500 rounded-jade-xsmall",alt:`Miniatura do arquivo ${e.file.name}`}),x.jsxs("div",{className:"flex flex-col",children:[x.jsx("span",{children:e.file.name}),x.jsx("span",{children:t.size})]})]}),x.jsx(go,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:x.jsx(Oo,{})})]}):x.jsxs("div",{className:"gap-jade-200 flex w-full flex-row items-center justify-between",children:[x.jsxs("header",{className:"flex flex-row items-center gap-4",children:[x.jsx(Cy,{size:48}),x.jsxs("div",{className:"flex flex-col items-start justify-start text-left",children:[x.jsx("span",{children:e.file.name}),x.jsx("span",{children:t.size})]})]}),x.jsx(go,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:x.jsx(Oo,{className:"text-danger"})})]})},RV=e=>x.jsx("ul",{className:"space-y-jade-200 w-full",children:e.files.map(t=>x.jsx($V,{onDeleteFile:e.onDeleteFile,file:t},t.name))}),BV=e=>e.isDragActive?x.jsx("p",{children:"Solte os arquivos selecionados"}):e.files.length>0?x.jsx(RV,{onDeleteFile:e.onDeleteFile,files:e.files}):x.jsx(w.Fragment,{children:e.idle}),jV=x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[x.jsx(YI,{size:64}),x.jsxs("p",{children:["You can drag your files or"," ",x.jsx("button",{className:"text-primary underline",type:"button",children:"drag to here"})]})]}),WV=({idle:e=jV,onDeleteFile:t,onDrop:n,...r})=>{var u;const[o,s]=w.useState([]),i=d=>{n==null||n(d),s(d)},{getRootProps:a,getInputProps:l,isDragActive:c}=lx({onDrop:i});return x.jsxs("div",{...a(),"data-active":(u=r.files)!=null&&u.length?r.files.length>0:!1,className:"flex flex-col items-center justify-center rounded-lg border-2 border-card-border p-6 text-foreground data-[active=true]:border-solid data-[active=false]:border-dashed data-[active=true]:bg-card-background",children:[x.jsx("input",{...l(r),name:r.name,id:r.name}),x.jsx(BV,{onDeleteFile:t,isDragActive:c,idle:e,files:r.files??o})]})},zV=["INPUT","SELECT"],ux=e=>{if(!e)return;Array.from(e.elements).forEach(n=>{zV.includes(n.tagName)&&(n.tagName==="INPUT"&&(n.value=n.defaultValue),n.tagName==="SELECT"&&(n.value=""),n.setAttribute("data-initialized","false"))})},HV=e=>{const t=n=>{var r;n.persist(),n.preventDefault(),(r=e.onSubmit)==null||r.call(e,n)};return x.jsx("form",{...e,onSubmit:t})},UV=({children:e,className:t="",size:n,...r})=>x.jsxs("label",{"data-component":"radiobox","data-disabled":r.disabled,"aria-disabled":r.disabled,className:"group flex items-center gap-2 font-normal data-[disabled=true]:cursor-not-allowed",children:[x.jsx("input",{...r,type:"radio",className:Me("app form-radio inline-block h-4 w-4 appearance-none rounded-full border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",t),...r}),e]}),Zr=w.forwardRef(({required:e=!0,options:t,info:n,selectContainer:r="",feedback:o=null,labelClassName:s,interactive:i,rightLabel:a,optionalText:l,container:c,hideLeft:u=!1,right:d,left:f,error:h,...m},p)=>{const y=Tt(),b=w.useRef(null),v=m.id??m.name;w.useImperativeHandle(p,()=>b.current),w.useEffect(()=>{if(b.current===null)return;const T=new AbortController,S=b.current,E=Os(b.current);return S.addEventListener("change",()=>S.setAttribute("data-selected","true"),{once:!0,signal:T.signal}),()=>{E(),T.abort()}},[]);const g=()=>{var T;return(T=b.current)==null?void 0:T.focus()};return x.jsx(Ei,{info:n,left:f,error:h,form:m.form,name:m.name,feedback:o,hideLeft:u,required:e,title:m.title,container:c,componentName:"select",rightLabel:a,interactive:i,id:m.name||m.id,optionalText:l,labelClassName:s,placeholder:m.placeholder,right:x.jsx("label",{htmlFor:v,children:x.jsxs("button",{onClick:g,type:"button",className:"mt-2 transition-colors hover:text-primary",children:[x.jsx(Su,{size:20}),x.jsx("span",{className:"sr-only",children:y.inputCaretDown})]})}),children:x.jsxs("select",{...m,id:v,name:v,value:m.value,required:e,ref:lc(p,b),"data-selected":!!m.value||!1,defaultValue:m.value?void 0:"",title:typeof m.title=="string"?m.title:void 0,className:Me("input select group h-10 w-full flex-1 appearance-none rounded-md","bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder","outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error","data-[selected=false]:text-input-placeholder",m.className),children:[x.jsx("option",{value:"",disabled:!0,hidden:!0,children:m.placeholder}),t.map(T=>w.createElement("option",{...T,value:T.value,children:T.label??T.value,key:`${v}-select-option-${T.value}`}))]})})}),Df=e=>{const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),t},GV=w.forwardRef(({children:e,container:t,error:n,...r},o)=>{const s=w.useId(),[i,a]=w.useState(r.checked??!1),l=i,c=w.useRef(null),u=Df(r.onChange);w.useImperativeHandle(o,()=>c.current),w.useEffect(()=>{if(c.current!==null&&u.current){const f=h=>{h.target.checked=!h.target.checked,u.current&&u.current(h)};return c.current.addEventListener("change",f),()=>{var h;return(h=c.current)==null?void 0:h.removeEventListener("change",f)}}},[]);const d=()=>{var h,m;const f=!((h=c.current)!=null&&h.checked);a(f),(m=r==null?void 0:r.onCheck)==null||m.call(r,f),c.current!==null&&(c.current.checked=f,c.current.dispatchEvent(new Event("change",{bubbles:!0})))};return x.jsxs("fieldset",{className:Me("flex flex-col flex-wrap justify-center",t),"data-component":"switch",children:[x.jsxs("span",{className:"flex flex-row flex-wrap items-center",children:[x.jsx("input",{...r,checked:l,"data-checked":l,"data-trigger":"change",hidden:!0,id:r.id||s,onChange:f=>a(f.target.checked),ref:c,type:"checkbox"}),x.jsx("button",{type:"button",role:"switch",onClick:d,"aria-checked":l,"data-checked":l,"aria-labelledby":`${s}-label`,className:"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary",children:x.jsx("span",{"aria-hidden":"true","data-checked":l,className:"inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"})}),x.jsx("label",{htmlFor:r.id||s,className:"ml-3 inline-block text-sm",id:`${s}-label`,children:x.jsx("span",{className:"font-medium text-foreground",children:e})})]}),x.jsx("span",{className:"mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden",children:n})]})}),YV=e=>{const[t,n]=SI();return w.useEffect(()=>{const r=t.current;if(!r)return;const o=s=>{const i=s.target,a=Array.from(r.querySelectorAll("input[data-task=true]")),l=a.every(u=>u.checked),c=a.indexOf(i);l&&c!==-1&&n("input",{scale:[1,1.35,1],rotate:[0,20,-20,0]},{duration:.5,delay:kI(.075,{from:c})})};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),x.jsx("fieldset",{...e,"data-component":"task-list",ref:t})},qV=kw("textarea","textarea",{container:"w-full"},e=>{const t=()=>{const n=e.value.split(`
236
- `);if(e.style.height="auto",n.length>1)return void(e.style.height=`${e.scrollHeight}px`)};return e.addEventListener("input",t),()=>e.removeEventListener("input",t)}),KV=e=>{const[t,n]=w.useState(0);return w.useEffect(()=>{const r=e.current;if(!r)return;const o=r.parentElement;if(!o)return;const s=()=>{n(o.clientHeight)};return o.addEventListener("resize",s),s(),()=>{o.removeEventListener("resize",s)}},[]),t},ZV={Item:w.forwardRef(function(t,n){return x.jsx("li",{...t,ref:n,className:"flex items-center gap-1 justify-between"})}),List:w.forwardRef(function(t,n){return x.jsx("ul",{...t,ref:n,className:"space-y-3"})})},XV=e=>{const t=w.useRef(null),n=KV(t);return x.jsxs("div",{className:"flex flex-row gap-4",ref:t,children:[x.jsxs("div",{className:"py-8 space-y-4 min-w-64 w-fit flex flex-col whitespace-nowrap rounded-lg border border-card-border",children:[x.jsx("header",{className:"border-b border-card-border pb-2"}),x.jsxs("div",{className:"px-8 space-y-2",children:[x.jsx(Ci,{rightLabel:"",title:"Search",placeholder:"Looking for..."}),x.jsx(cf,{height:n,useWindowScroll:!0,data:e.source,components:ZV,itemContent:(r,o)=>x.jsx(w.Fragment,{children:x.jsx(pf,{children:x.jsx(e.Item,{data:o})})})})]})]}),x.jsx("div",{children:x.jsx(go,{children:x.jsx(Tu,{})})}),x.jsx("div",{})]})};var QV=Object.defineProperty,dx=Object.getOwnPropertySymbols,JV=Object.prototype.hasOwnProperty,e$=Object.prototype.propertyIsEnumerable,fx=(e,t,n)=>t in e?QV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t$=(e,t)=>{for(var n in t||(t={}))JV.call(t,n)&&fx(e,n,t[n]);if(dx)for(var n of dx(t))e$.call(t,n)&&fx(e,n,t[n]);return e},Mf=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return!0;return!1},n$=(e,t,n,r)=>bl(Mf,e,t,n,r),us=e=>typeof e=="object",vr=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||!us(e)&&!us(t))return e===t;if(e.prototype!==t.prototype)return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>vr(e[r],t[r]))},r$=(e,t)=>(us(e)||Array.isArray(e))&&t?e[t]:e,o$=e=>(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1,vl=e=>/[0-9.]+/.test(e),hx=e=>["string","number"].includes(typeof e),px=e=>e==null||(e==null?void 0:e.length)===0||e==="",mx={eq:vr,is:Object.is,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,includes:(e,t)=>`${e}`.includes(t),notIncludes:(e,t)=>!`${e}`.includes(t),startsWith:(e,t)=>`${e}`.startsWith(t),endsWith:(e,t)=>`${e}`.endsWith(t),like:(e,t)=>new RegExp(`.*${t}.*`,"gi").test(`${e}`),alphabetical:(e,t)=>e.toString().localeCompare(t.toString()),empty:px,notEmpty:e=>!px(e),in:(e,t)=>Mf(t,n=>vr(e,n)),notIn:(e,t)=>gx(t,n=>!vr(e,n))},s$=e=>{if(e in mx)return mx[e];throw new Error("Linq - Symbol not found")},ds=(e,t)=>{const n=[],r=e.length;for(let o=0;o<r;o++)t(e[o],o,e)&&n.push(e[o]);return n},bl=(e,t,n,r,o)=>{if(typeof n=="function")return e(t,n);const s=s$(r);return n&&r&&o!==void 0?e(t,i=>s(i[n],o)):e(t,i=>s(i,o))},i$=(e,t,n,r)=>bl(ds,e,t,n,r),gx=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},a$=(e,t,n,r)=>bl(gx,e,t,n,r),yx=e=>{if(e===null)return null;const t=t$({},e);return Object.keys(t).forEach(n=>t[n]=us(e[n])?yx(e[n]):e[n]),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},vx=(e,t)=>{if(us(t)){for(let n=0;n<e.length;n++){const r=e[n];if(vr(t,r))return!0}return!1}for(let n=0;n<e.length;n++){const r=e[n];if(vr(t,r))return!0}return!1},l$=(e,t)=>{const n=new Map(e.map(r=>[r[t],r]));return Object.fromEntries(n.entries())},c$=e=>ds(e,(t,n,r)=>us(t)?n===r.findIndex(o=>vr(o,t)):n===r.indexOf(t)),u$=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return e[r]},bx=(e,t)=>{const n=new Map;return e.forEach(r=>{const o=t(r),s=n.get(o)||[];s.push(r),n.set(o,s)}),Object.fromEntries(n.entries())},d$=(e,t)=>bx(e,n=>n[t]),wx=(e,t)=>{const n=[];let r=0;const o=e.length;for(r;r<o;r++){const s=t(e[r],r,e);n.push(s)}return n},f$=(e,t)=>{let n=Number.parseInt(e,10),r=Number.parseInt(t,10);return n>r?[r,n]:[n,r]},h$=(e,t,n=1)=>{const r=[];let o=e.charCodeAt(0);const s=t.charCodeAt(0);for(;o<=s;o+=n)r.push(String.fromCharCode(o));return vl(e)&&vl(t)?r.map(i=>Number.parseInt(i)):r},Nf=(e,t,n=1)=>{let r=Math.abs(n);if((e.length>1||t.length>1)&&vl(e)&&vl(t)){const o=[],[s,i]=f$(e,t);for(let a=s;a<=i;a+=r)o.push(a);return o}return h$(e,t,r)},p$=(e,t,n=1)=>{if(t===void 0){const[r,o,s]=e.split("..");return s===void 0?Nf(r,o,1):Nf(r,s,Number.parseInt(o,10))}return hx(e)&&hx(t)?Nf(`${e}`,`${t}`,n):Array.from({length:e},(r,o)=>o*Math.abs(t))},Lf=(e,t,n)=>{let r=t;const o=n.length;for(let s=0;s<o;s++){const i=n[s];r=e(r,i,s,n)}return r},xx=e=>{const t=Array.from(e.values());let n=null,r=null,o=t.length;for(n=0;n<o/2;n+=1){r=o-1-n;let s=t[n];t[n]=t[r],t[r]=s}return t},m$=(e,t)=>{if(typeof t=="number")return e.slice(t);let n=e.length;for(let r=0;r<n;r++){const o=e[r];if(t(o,r,e))return e.slice(r)}return e.slice(0)},g$=(e,t,n,r)=>bl(m$,e,t,n,r),Sx=(e,t)=>{const n=[...e];return t===void 0?n.sort():typeof t=="function"?n.toSorted(t):n.toSorted(o$(t))},Tx=(e=>(e.Asc="asc",e.Desc="desc",e))(Tx||{}),y$=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.key,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),v$=(e,t)=>e.sort(y$(t)),b$=(e,t)=>{if(t===void 0)return[...new Set(e).values()];const n=new Set;return Array.isArray(t)?[...new Set(t)]:ds(e,r=>{const o=t?n.has(r[t]):n.has(t);return t&&(o||n.add(r[t])),!o})},w$=class ch{constructor(t=[]){this.array=t}static Range(...t){return p$(...t)}static New(t){return new ch(t)}Where(t,n,r){return this.array=i$(this.array,t,n,r),this}Some(t,n,r){return n$(this.array,t,n,r)}All(t,n,r){return a$(this.array,t,n,r)}Reverse(){return this.array=xx(this.array),this}Add(t){return this.array=Array.isArray(t)?this.array.concat(t):this.array.concat([t]),this}Prepend(t){return this.array=Array.isArray(t)?t.concat(this.array):[t].concat(this.array),this}Select(t){return t===void 0?this.array:this.array.map(t)}Take(t,n){return n!==void 0?this.array=this.array.slice(t,Math.max(0,n)):this.array=this.array.slice(t),this}Head(){return this.array[0]}Tail(){return this.Skip(1)}Skip(t,n,r){return this.array=g$(this.array,t,n,r),this}Distinct(){return this.array=c$(this.array),this}First(t){return t===void 0?this.array[0]:u$(this.array,t)||null}Last(t){const n=this.array.length;if(t===void 0)return this.array[n-1];for(let r=n;r!==0;r--)if(t(this.array[r],r,this.array))return this.array[r]}Sum(t){return t===void 0?Lf((n,r)=>n+r,0,this.array):Lf((n,r)=>n+r$(r,t),0,this.array)}Average(t){return this.Sum(t)/this.array.length}GroupBy(t){return d$(this.array,t)}GroupWith(t){return bx(this.array,t)}Except(t){return ds(this.array,n=>!vx(t,n))}Intersect(t){return ds(this.array,n=>vx(t,n))}OrderBy(t,n){let r;return r=t?Sx(this.array,t):this.array.toSorted(),this.array=n==="desc"?xx(r):r,this}Includes(t){return Mf(this.array,n=>vr(n,t))}In(t){const n=t.length;for(let r=0;r<n;r++){const o=t[r];if(this.Includes(o))return!0}return!1}Reduce(t,n){return Lf(t,n??this.array[0],this.array)}Empty(){return this.array.length===0}ToMap(t){return new Map(wx(this.array,n=>[t,n]))}Zip(t,n){return wx(this.array,(r,o)=>n(r,t[o]))}Count(t){return t===void 0?this.array.length:ds(this.array,t).length}Get(t){return this.array[t]}Clone(){return new ch(yx(this.array))}ToObject(t){return l$(this.array,t)}Sort(t){return Array.isArray(t)?v$(this.array,t):Sx(this.array,t)}Unique(t){return b$(this.array,t)}},Ex=w$,fs={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=(y,b)=>{try{Object.keys(y).forEach(b)}catch(v){window.console.log(v)}},n=y=>y==null,r=y=>{const b=typeof y;return b==="string"||b==="number"||b==="boolean"||n(y)},o=(y,b)=>{const v=b.getItem(y);try{return JSON.parse(v)}catch{return v??null}},s=y=>Object.keys(y).reduce((b,v)=>({...b,[v]:o(v,y)}),{}),i=y=>y instanceof Date?y:typeof y=="number"?new Date(new Date*1+y*864e5):y,a="1969-12-31T23:59:59.000Z",l=()=>document.cookie===""?{}:document.cookie.split("; ").map(y=>y.split("=")).reduce((y,b)=>(y[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),y),{}),c=new Set,u=()=>{const y=l();c.forEach(b=>b(y))},d=[{name:"expires",parse:y=>`expires=${i(y.expires??a)}`},{name:"maxAge",parse:y=>y.maxAge?`max-age=${i(y.expires??a)}`:""},{name:"path",parse:y=>`path=${y.path??"/"}`},{name:"sameSite",parse:y=>`samesite=${y.sameSite??"strict"}`},{name:"useSecure",parse:y=>`${y.useSecure??!0?"secure":""}`},{name:"domain",parse:y=>{const b=y.domain??"";return b===""?"":`domain=${y.multiDomain?".":""}${b}`}},{name:"partitioned",parse:y=>y.partitioned?"Partitioned":""}],f={json:l,listener:y=>(c.add(y),()=>c.delete(y)),clearListeners:()=>c.clear(),has:y=>document.cookie.split(";").some(b=>b.trim().startsWith(`${y}=`)),deleteAll:()=>{document.cookie.split(";").forEach(y=>{document.cookie=y.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}),u()},get:y=>{const b=f.json()[y];if(n(b))return null;try{return JSON.parse(decodeURIComponent(b))}catch{return b}},delete:y=>{document.cookie=`${encodeURIComponent(y)}=;expires=${new Date().toUTCString()}`,u()},set:(y,b,v={})=>{const g=r(b)?b:encodeURIComponent(JSON.stringify(b)),T=d.reduce((S,E)=>{const C=E.parse(v);return C===""?S:S.concat(C)},[`${encodeURIComponent(y)}=${g}`]).join(";");document.cookie=T,u()}},h=y=>{const b=new Set,v=g=>{y().removeItem(g);const T=s(y());b.forEach(S=>S(T))};return{delete:v,listener:g=>(b.add(g),()=>b.delete(g)),clearListeners:()=>b.clear(),json:(g=!1)=>g?s(y()):y(),has:g=>{const T=y().getItem(g);return!n(T)},deleteAll:()=>{t(y(),v),b.forEach(g=>g(y()))},get:g=>o(g,y()),set:(g,T)=>{y().setItem(g,JSON.stringify(T)),b.forEach(S=>S(y()))}}},m=h(()=>window.sessionStorage),p=h(()=>window.localStorage);e.Cookie=f,e.LocalStorage=p,e.SessionStorage=m,e.createStorage=h})(fs);const Ff=e=>e.headerLabel??e.thead??e.id,Vf=e=>e.map(t=>({value:t.id,label:t.thead??t.headerLabel??t.id}));var hs=(e=>(e.Boolean="boolean",e.Number="number",e.Select="select",e.Text="text",e))(hs||{});const $f=e=>e.type==="number"?e.valueAsNumber:e.value,x$=e=>{let t=[];return e({add:(o,s,i)=>t.push({...i,id:o,thead:s}),remove:o=>t=t.filter(s=>s.id!==o)}),t},S$={},T$=(e,t)=>{if(!Array.isArray(t))return e;const n=new Set(t.map(o=>o.id));if(!e.every(o=>n.has(o.id)))return e;const r=new Map(e.map(o=>[o.id,o]));return t.map((o,s)=>{const i=r.get(o.id);return i===void 0?e[s]:i})},E$=(e,t,n=S$)=>{const r=Gi()?null:fs.LocalStorage.get(`@components/table-${e}`)||null,[o,s]=Ru({name:e,groups:n.groups||(r==null?void 0:r.groups)||[],sorters:n.sorters||(r==null?void 0:r.sorters)||[],filters:n.filters||(r==null?void 0:r.filters)||[],cols:T$(t,r==null?void 0:r.cols)},i=>{const a=l=>{const c=i.state(),u={...c,...l};return Gi()||fs.LocalStorage.set(`@components/table-${c.name}`,u),u};return a(i.state()),{set:l=>a(l)}});return{...o,...s,name:e}},Rf=(e,t,n,r={})=>{var c,u;const o=e.id,s=e.type??hs.Text,i=t[s]??[],a=((c=i.find(d=>d["data-default"]))==null?void 0:c.value)??((u=i[0])==null?void 0:u.value),l=n[a];return{id:_s(),operation:l,label:Ff(e),name:o,type:s,value:"",...r}},Bf=()=>{const e=Tt(),t=w.useMemo(()=>({contains:{value:"contains",label:e.tableFilterTypeContains,symbol:"includes","data-default":"true"},is:{value:"is",label:e.tableFilterTypeIs,symbol:"is"},isNot:{value:"isNot",label:e.tableFilterTypeIsNot,symbol:"!=="},notContains:{value:"notContains",label:e.tableFilterTypeNotContains,symbol:"notIncludes"},lessThan:{value:"lessThan",label:e.tableFilterTypeLessThan,symbol:"<="},greaterThan:{value:"greaterThan",label:e.tableFilterTypeGreaterThan,symbol:">="},startsWith:{value:"startsWith",label:e.tableFilterTypeStartsWith,symbol:"startsWith"},endsWith:{value:"endsWith",label:e.tableFilterTypeEndsWith,symbol:"endsWith"}}),[e]);return{options:w.useMemo(()=>({[hs.Text]:[t.is,t.isNot,t.contains,t.notContains,t.startsWith,t.endsWith],[hs.Boolean]:[t.is,t.isNot],[hs.Number]:[t.is,t.isNot,t.greaterThan,t.lessThan]}),[e]),operations:t}},C$=e=>{const t=Tt(),n=Bf(),r=()=>{const l=e.cols.at(0);e.set(c=>[...c,Rf(l,n.options,n.operations)])},o=l=>{const c=l.target.dataset.id||"",u=l.target.value;e.set(d=>d.map(f=>{if(c!==f.id)return f;const h=e.cols.find(m=>u===m.id);return Rf(h,n.options,n.operations,{value:""})}))},s=l=>{const c=l.target.dataset.id||"",u=l.target.value;e.set(d=>d.map(f=>f.id===c?{...f,operation:n.operations[u]}:f))},i=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))},a=l=>{const c=l.target.dataset.id||"",u=$f(l.target);e.set(d=>d.map(f=>f.id===c?{...f,value:u}:f))};return x.jsx(w.Fragment,{children:x.jsx(Qo,{arrow:!0,title:t.tableFilterDropdownTitle,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(WI,{size:14}),t.tableFilterLabel," ",e.filters.length===0?"":` (${e.filters.length})`]}),children:x.jsxs("ul",{className:"mt-4 space-y-2",children:[e.filters.map(l=>{const c=n.options[l.type];return x.jsxs("li",{className:"flex flex-nowrap gap-3",children:[x.jsx(Zr,{options:e.options,title:t.tableFilterColumnTitle,placeholder:t.tableFilterColumnPlaceholder,value:l.name,"data-id":l.id,onChange:o}),x.jsx(Zr,{"data-id":l.id,onChange:s,value:l.operation.value,options:c,title:t.tableFilterOperatorTitle,placeholder:t.tableFilterOperatorPlaceholder}),x.jsx(Ci,{"data-id":l.id,onChange:a,title:t.tableFilterValueTitle,placeholder:t.tableFilterValuePlaceholder,type:l.type,value:l.value,optionalText:""}),x.jsx("div",{className:"mt-5 flex items-center justify-center",children:x.jsx("button",{"data-id":l.id,type:"button",onClick:i,children:x.jsx(Oo,{className:"text-danger",size:16})})})]},`filter-select-${l.id}`)}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-primary",children:[x.jsx(Eu,{size:14})," ",t.tableFilterNewFilter]})})]})})})},P$=({filter:e,onDelete:t,set:n})=>{const r=Tt(),o=Bf(),s=a=>{const l=a.target.value,c=a.target.dataset.id||"";n(u=>u.map(d=>d.id===c?{...d,operation:o.operations[l]}:d))},i=a=>{const l=a.target.dataset.id||"",c=$f(a.target);n(u=>u.map(d=>d.id===l?{...d,value:c}:d))};return x.jsxs("div",{className:"flex flex-nowrap items-center gap-4 py-2",children:[x.jsx(Zr,{"data-id":e.id,onChange:s,value:e.operation.value,options:o.options[e.type],title:r.tableFilterColumnTitle,placeholder:r.tableFilterColumnPlaceholder}),x.jsx(Ci,{"data-id":e.id,onChange:i,type:e.type,value:e.value,title:r.tableFilterValueTitle,placeholder:r.tableFilterValueTitle}),x.jsx("button",{onClick:t,"data-id":e.id,type:"button",className:"mt-4",children:x.jsx(Oo,{className:"text-danger",size:14})})]})},k$=({item:e,onPointerDown:t})=>{const n=_r(0);return x.jsxs(xy,{onPointerDown:t,id:e.groupId,className:"flex flex-row items-center gap-2",value:e,style:{y:n},children:[x.jsx("button",{type:"button",className:"cursor-grab",children:x.jsx(jI,{size:14})}),x.jsx("span",{children:e.groupName})]},e.groupId)},I$=e=>{var l;const t=Tt(),n=Vf(e.cols),r=CI(),[o,s]=w.useState(((l=e.groups[0])==null?void 0:l.thead)||""),i=c=>{var y;const u=c.target,d=u.value,f=u.options.selectedIndex,h=((y=u.options.item(f))==null?void 0:y.label)||"";s(h);const m=new Ex(e.rows).GroupBy(d),p=e.cols.find(b=>b.id===d);e.setGroups(jS(m).map((b,v)=>{const g=m[b];return{...p,groupId:_s(),groupKey:d,index:v,rows:g,groupName:b}}))},a=()=>e.setGroups([]);return x.jsx(w.Fragment,{children:x.jsxs(Qo,{arrow:!1,title:t.tableGroupLabel,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(GI,{size:14}),t.tableGroupLabelWithCount,e.groups.length>0?` - ${o}(${e.groups.length})`:""]}),children:[x.jsxs("div",{className:"flex flex-nowrap items-center",children:[x.jsx(Zr,{value:o,title:"Tipo de agrupamento",onChange:i,options:n,placeholder:"Agrupar por..."}),x.jsx(go,{className:"mt-4",onClick:a,theme:"raw","data-id":o,children:x.jsx(Oo,{size:16,className:"text-danger"})})]}),e.groups.length>0?x.jsxs("section",{className:"my-4",children:[x.jsx("header",{children:x.jsx("h2",{className:"text-xl font-medium",children:"Order groups"})}),x.jsx(BT,{children:x.jsx(by,{axis:"y",className:"relative space-y-2",drag:!0,dragControls:r,dragListener:!1,layoutScroll:!0,onReorder:e.setGroups,values:e.groups,children:e.groups.map(c=>x.jsx(k$,{item:c,onPointerDown:u=>{r.start(u),e.setGroups([...e.groups])}},c.groupId))})})]}):null]})})},A$=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.value,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),O$=(e,t)=>e.toSorted(A$(t)),Cx=(e,t,n)=>({id:_s(),type:n,value:e.id,label:t}),_$=e=>{const t=Tt(),n={asc:{label:t.tableSortAsc,value:"asc"},desc:{label:t.tableSortDesc,value:"desc"}},r=[n.asc,n.desc],o=()=>{const l=e.cols[0];l&&e.set(c=>[...c,Cx(l,n.asc.label,n.asc.value)])},s=l=>c=>{const u=c.target.value;e.set(d=>d.map(f=>f.id===l?{...f,value:u}:f))},i=l=>c=>{const u=c.target.value;e.set(d=>d.map(f=>f.id===l?{...f,type:u}:f))},a=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))};return x.jsx(w.Fragment,{children:x.jsx(Qo,{title:t.tableSortDropdownTitle,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(Ty,{size:14}),t.tableSortOrderByLabel," ",e.sorters.length===0?"":` (${e.sorters.length})`]}),children:x.jsxs("ul",{className:"mt-4 space-y-2",children:[e.sorters.map(l=>x.jsxs("li",{className:"flex flex-nowrap gap-3",children:[x.jsx(Zr,{options:e.options,value:l.value,onChange:s(l.id),title:t.tableSortOrderInputTitle,placeholder:t.tableSortOrderInputPlaceholder}),x.jsx(Zr,{onChange:i(l.id),value:l.type,options:r,title:t.tableSortTypeInputTitle,placeholder:t.tableSortTypeInputPlaceholder}),x.jsx("button",{className:"mt-4","data-id":l.id,onClick:a,children:x.jsx(Oo,{className:"text-danger",size:14})})]},`sorter-select-${l.id}`)),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[x.jsx(Eu,{size:14})," ",t.tableSortAddButton]})})]})})})},D$=e=>{const t=Tt(),[n,r]=w.useState(()=>{const a=e.sorters.find(l=>l.value===e.col.id);return a?a.type:"undefined"}),o=()=>r(a=>a==="undefined"?"asc":a==="asc"?"desc":"undefined");w.useEffect(()=>{e.setSorters(a=>{if(n==="undefined")return a.filter(u=>u.value!==e.col.id);const l=a.findIndex(u=>u.value===e.col.id),c=Cx(e.col,n,n);return l===-1?[...a,c]:(a[l]=c,[...a])})},[n,e.col]);const s=`${e.col.id}-sorter-id`,i=Ff(e.col);return x.jsxs("button",{"aria-labelledby":s,className:"isolate flex items-center",onClick:o,type:"button",children:[x.jsxs("span",{id:s,className:"sr-only",children:[t.tableSortDropdownTitle," ",i]}),n==="asc"?x.jsx(VI,{size:14}):null,n==="desc"?x.jsx(FI,{size:14}):null,n==="undefined"?x.jsx(Ty,{size:14}):null]})},M$=e=>x.jsx("header",{className:"min-w-full mb-1",children:x.jsxs("div",{className:"flex flex-wrap min-w-full items-center justify-between gap-x-4 gap-y-1",children:[x.jsxs("div",{className:"flex w-fit items-centeend gap-4 whitespace-nowrap py-2",children:[x.jsx("span",{children:x.jsx(C$,{cols:e.cols,options:e.options,filters:e.filters,set:e.setFilters})}),x.jsx("span",{children:x.jsx(_$,{options:e.options,cols:e.cols,sorters:e.sorters,set:e.setSorters})}),x.jsx("span",{children:x.jsx(I$,{rows:e.rows,groups:e.groups,setGroups:e.setGroups,options:e.options,cols:e.cols})})]}),x.jsx("ul",{className:"flex flex-wrap w-full flex-1 flex-grow flex-row items-center md:justify-end gap-4",children:e.filters.map(t=>x.jsxs("li",{className:"flex gap-1 items-center rounded-xl border border-card-border px-4 py-0.5",children:[x.jsxs("span",{children:[x.jsx("span",{className:"size-3 mr-2 aspect-square bg-primary inline-block rounded-full","aria-hidden":"true"}),t.label," ",t.operation.label.toLowerCase(),":"]}),x.jsxs("div",{className:"relative w-min min-w-[1ch]",children:[x.jsx("span",{"aria-hidden":"true",className:"invisible whitespace-pre p-0",children:t.value||" "}),x.jsx("input",{type:t.type,value:t.value,className:"absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-none [appearance:textfield] after:empty:text-primary/70 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onChange:n=>{const r=$f(n.target);e.setFilters(o=>o.map(s=>t.id===s.id?{...s,value:r}:s))}})]})]},`filter-table-${t.id}`))})]})});function N$(e,t){if(!e||!t)return[];const n=[1];if(e===1&&t===1)return n;e>4&&n.push("-");let r=2;const o=e-r,s=e+r;for(let a=o>2?o:2;a<=Math.min(t,s);a++)n.push(a);const i=t-2;return s+1!==i&&s+1<t&&n.push("_"),s<t&&(n.push(t-2),n.push(t-1),n.push(t)),Array.from(new Set(n))}const L$=e=>{const t=w.useId(),n=Tt(),r=e.asLink||"button",o=w.useMemo(()=>N$(e.current,e.pages),[e.current,e.pages]),s=e.current<e.pages;return x.jsxs("footer",{className:"flex px-1 py-4 items-center justify-center gap-4 lg:justify-between flex-wrap lg:flex-nowrap",children:[x.jsx("p",{children:x.jsx(n.tablePaginationFooter,{...e,sizes:e.sizes,select:e.onChangeSize&&Array.isArray(e.sizes)?x.jsxs(w.Fragment,{children:[x.jsx("label",{htmlFor:t,children:n.tablePaginationSelectLabel}),x.jsx("select",{id:t,value:e.size,className:"cursor-pointer bg-transparent",onChange:i=>{var a;(a=e.onChangeSize)==null||a.call(e,Number(i.target.value))},children:e.sizes.map(i=>x.jsx("option",{value:i,children:i},`pagination-opt-${i}`))})," "]}):null})}),x.jsx("nav",{children:x.jsxs("ul",{className:"flex items-center gap-2",children:[e.current>1?x.jsx("li",{children:x.jsx(r,{href:"previous",className:"",children:n.tablePaginationPrevious})}):null,o.map(i=>i===null?null:x.jsx(w.Fragment,{children:typeof i=="string"?x.jsx("li",{children:"..."}):x.jsx("li",{children:x.jsx(r,{href:i,className:`cursor-pointer px-3 py-1 transition-colors border-b-2 hover:text-primary-subtle hover:border-primary-subtle proportional-nums ${i===e.current?"text-primary border-primary":"border-transparent"}`,children:i})})},`pagination-${i}`)),s?x.jsx("li",{children:x.jsx(r,{href:"next",className:"",children:n.tablePaginationNext})}):null]})})]})},F$={top:0,left:0,right:0,bottom:-1},V$=e=>{var m;const t=Tt(),n=e.filters.filter(p=>p.name===e.header.id),r=n.length>0,o=e.header.allowSort??!0,s=e.header.allowFilter??!0,i=Bf(),a=r?zI:HI,l=p=>{const y=p.currentTarget.dataset.id||"";return e.setFilters(b=>b.filter(v=>v.id!==y))},c=w.useCallback(p=>{if(p===null)return;const y=new AbortController;return p.addEventListener("pointerdown",b=>{if(b.target.dataset.type==="resizer")return b.stopPropagation(),b.stopImmediatePropagation()},{signal:y.signal}),()=>y.abort()},[]),u=e.sorters.find(p=>e.header.id===p.value),d=u!=null&&u.type?u.type===Tx.Asc?"ascending":"descending":"none",f=Ff(e.header),h=_r(void 0);return x.jsxs(xy,{...e.header.thProps,as:"th",ref:c,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,style:{width:h},role:"columnheader","aria-sort":d,value:e.header,"aria-busy":e.loading,className:`relative hidden min-w-0 border border-b border-transparent border-b-table-border border-r-table-border font-medium first:table-cell last:border-r-transparent md:table-cell ${((m=e.header.thProps)==null?void 0:m.className)??""}`,children:[x.jsx("span",{className:"flex h-full items-center justify-between px-2 py-4",children:x.jsxs("span",{className:"flex items-center gap-1",children:[e.inlineFilter&&s?x.jsx(Qo,{arrow:!0,trigger:x.jsxs("span",{children:[x.jsxs("span",{id:`${e.header.id}-filter-dropdown-button`,className:"sr-only",children:[t.tableFilterDropdownTitleUnique," ",f]}),x.jsx(a,{"aria-labelledby":`${e.header.id}-filter-dropdown-button`,size:14})]}),title:x.jsxs("span",{className:"text-lg font-medium",children:[t.tableFilterDropdownTitleUnique," ",x.jsx("span",{className:"text-primary",children:f})]}),children:n.length===0===null?null:x.jsxs("ul",{className:"font-medium",children:[n.map(p=>x.jsx("li",{className:"my-1",children:x.jsx(P$,{onDelete:l,filter:p,set:e.setFilters})},`thead-filter-${p.id}`)),x.jsx("li",{children:x.jsxs("button",{type:"button",className:"flex items-center gap-1 text-primary",onClick:()=>e.setFilters(p=>p.concat(Rf(e.header,i.options,i.operations))),children:[x.jsx(Eu,{size:14})," ",t.tableFilterNewFilter]})})]})}):null,x.jsx("span",{className:"pointer-events-auto text-balance text-base",children:e.header.thead}),e.inlineSorter&&o?x.jsx(D$,{col:e.header,setSorters:e.setSorters,sorters:e.sorters}):null]})}),x.jsx(at.button,{drag:"x",draggable:!0,dragListener:!0,dragMomentum:!0,type:"button",animate:!1,dragElastic:0,dragPropagation:!0,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,"data-type":"resizer",title:e.header.id,dragConstraints:F$,whileDrag:{cursor:"grabbing"},className:"absolute right-0 top-0 block h-full w-1 cursor-col-resize hover:bg-primary active:bg-primary",onDrag:(p,y)=>{const b=p.target,v=h.get()||b.getBoundingClientRect().width,g=y.delta.x;return h.set(Math.abs(v+g))}})]})},$$=e=>x.jsx(by,{layout:!0,as:"tr",axis:"x",drag:"x",layoutRoot:!0,role:"row",layoutScroll:!0,values:e.headers,onReorder:e.setCols,className:"bg-table-header text-lg",children:x.jsx(er,{children:e.headers.map(t=>x.jsx(V$,{inlineFilter:e.inlineFilter,inlineSorter:e.inlineSorter,loading:e.loading,setFilters:e.setFilters,filters:e.filters,setSorters:e.setSorters,sorters:e.sorters,header:t},`header-child-item-${t.id}`))})}),Px=w.createContext({}),R$=()=>w.useContext(Px),B$=w.forwardRef(({context:e,className:t="",...n},r)=>x.jsx("tbody",{...n,role:"rowgroup",className:`divide-y divide-table-border ${t}`,ref:r,children:x.jsx(er,{children:n.children})})),j$=w.forwardRef(({context:e,className:t="",...n},r)=>x.jsx("table",{...n,ref:r,role:"table",className:`table min-w-full table-auto divide-y divide-table-border text-left ${t??""}`})),W$=w.forwardRef(({context:e,...t},n)=>{const r=R$(),o={...t==null?void 0:t.style,top:Pt.number(r.sticky)?`${r.sticky}px`:void 0};return x.jsx("thead",{...t,style:o,role:"rowgroup",className:"shadow-xs group:sticky top-0 bg-card-background",ref:n})}),z$=w.forwardRef(({context:e,item:t,...n},r)=>x.jsx("tr",{...n,role:"row",ref:r,className:`table-row ${(n==null?void 0:n.className)??""}`})),H$=w.forwardRef((e,t)=>e.context.loadingMore?x.jsx("tfoot",{...e,ref:t,className:"bg-card-background",children:x.jsx("tr",{role:"row",className:"bg-card-background",children:x.jsx("td",{colSpan:999,className:"h-14 bg-card-background px-2",children:x.jsx("span",{className:"block h-2 w-full animate-pulse rounded bg-foreground opacity-60"})})})}):null),U$={TableHead:W$,Table:j$,TableBody:B$,TableRow:z$,TableFoot:H$},G$=[0,0,0,0,0,0,0,0,0,0],kx=x.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}),Y$=(e,t,n)=>x.jsx("td",{role:"cell",colSpan:n.cols.length,className:"hidden h-14 border-l border-table-border px-2 first:table-cell first:border-transparent md:table-cell",children:n.loading?kx:x.jsx(Ov,{})}),q$=(e,t,n)=>{const r=n.cols,o=n.loading;return x.jsx(w.Fragment,{children:r.map((s,i)=>{var d;const a=`${i},${e}`,l=uc(t,s.id),c=s.Element,u=((d=s.cellProps)==null?void 0:d.className)||"";return w.createElement("td",{...s.cellProps,role:"cell","data-matrix":a,key:`accessor-${e}-${i}`,className:`hidden h-14 border-l border-table-border px-2 first:table-cell first:border-transparent md:table-cell ${u}`},o?kx:c?x.jsx(c,{row:t,matrix:a,col:s,rowIndex:e,value:l}):x.jsx(w.Fragment,{children:Pt.nil(l)?"":l}))})})},K$=()=>x.jsx(w.Fragment,{}),Z$=[{}],Ix=({cols:e,filters:t,setCols:n,sorters:r,setFilters:o,setSorters:s,onScrollEnd:i,border:a=!1,pagination:l=null,useControl:c=!1,...u})=>{const d=w.useRef(null),[f,h]=w.useState(!1),m=Df(i),p=Df(u.loadingMore),y=w.useMemo(()=>{if(u.loading)return G$;if(c)return u.rows;const b=new Ex(u.rows);return t.length>0&&t.forEach(v=>v.value===""||Number.isNaN(v.value)?void 0:b.Where(v.name,v.operation.symbol,v.value)),r.length===0?b.Select():O$(b.Select(),r)},[u.rows,t,r,u.loading]);return w.useEffect(()=>{if(d.current===null)return()=>{};const b=d.current,v=new IntersectionObserver(g=>{var E;return g[g.length-1].isIntersecting&&p.current?((E=m.current)==null||E.call(m),void h(!0)):h(!1)});return v.observe(b),()=>v.disconnect()},[]),x.jsxs("div",{className:"min-w-full",children:[x.jsxs("div",{className:`group rounded-lg ${a?"border border-table-border":""}`,children:[x.jsx(d2,{useWindowScroll:!0,followOutput:"smooth",components:U$,totalCount:y.length,data:y.length===0?Z$:y,fixedFooterContent:f?K$:null,itemContent:y.length===0?Y$:q$,context:{loading:u.loading,loadingMore:u.loadingMore,cols:e},fixedHeaderContent:()=>x.jsx($$,{headers:e,filters:t,setCols:n,sorters:r,setFilters:o,setSorters:s,loading:!!u.loading,inlineFilter:u.inlineFilter,inlineSorter:u.inlineSorter})}),x.jsx("div",{"aria-hidden":"true",ref:d,className:"h-0.5 w-full"})]}),l!==null?x.jsx(L$,{...l}):null]})},X$=(e,t)=>typeof t=="function"?t(e):t,wl=(e,t,n)=>e===t||n==null?void 0:n(t),Q$=e=>{const t=w.useMemo(()=>({sticky:e.sticky}),[e.sticky]),n=e.operations??!0,r=w.useMemo(()=>Vf(e.cols),[e.cols]),[o,s]=Ru({cols:e.cols,sorters:e.sorters??[],groups:e.groups??[],filters:e.filters??[]},i=>{const a=l=>c=>{const u=i.state();return{...u,[l]:X$(u[l],c)}};return{cols:a("cols"),sorters:a("sorters"),groups:a("groups"),filters:a("filters")}},{postMiddleware:[(i,a)=>{var l;return(l=e.set)==null||l.call(e,i),wl((a==null?void 0:a.filters)??[],i.filters??[],e.setFilters),wl((a==null?void 0:a.sorters)??[],i.sorters??[],e.setSorters),wl((a==null?void 0:a.groups)??[],i.groups??[],e.setGroups),wl((a==null?void 0:a.cols)??[],i.cols??[],e.setCols),i}]});return x.jsx(Px.Provider,{value:t,children:x.jsxs("div",{className:"relative min-w-full","data-component":"table",children:[n?x.jsx(M$,{cols:o.cols,rows:e.rows,options:r,groups:o.groups,filters:o.filters,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,pagination:e.pagination??null,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0}):null,o.groups.length===0?x.jsx(Ix,{...e,index:0,cols:o.cols,options:r,groups:o.groups,filters:o.filters,optionCols:r,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,onScrollEnd:e.onScrollEnd,pagination:e.pagination??null,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0}):x.jsx("div",{className:"flex flex-wrap gap-4",children:o.groups.map((i,a)=>x.jsx("div",{className:"min-w-full",children:x.jsx(Ix,{...e,group:i,index:a,cols:o.cols,pagination:null,rows:i.rows,options:r,groups:o.groups,filters:o.filters,optionCols:r,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,onScrollEnd:e.onScrollEnd,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0})},`group-${i.groupId}`))})]})})};var J$=String.prototype.replace,eR=/%20/g,jf={RFC1738:"RFC1738",RFC3986:"RFC3986"},Wf={default:jf.RFC3986,formatters:{RFC1738:function(e){return J$.call(e,eR,"+")},RFC3986:function(e){return String(e)}},RFC1738:jf.RFC1738,RFC3986:jf.RFC3986},tR=Wf,zf=Object.prototype.hasOwnProperty,Xr=Array.isArray,Nn=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),nR=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(Xr(r)){for(var o=[],s=0;s<r.length;++s)typeof r[s]<"u"&&o.push(r[s]);n.obj[n.prop]=o}}},Ax=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(r[o]=t[o]);return r},rR=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(Xr(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!zf.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var o=t;return Xr(t)&&!Xr(n)&&(o=Ax(t,r)),Xr(t)&&Xr(n)?(n.forEach(function(s,i){if(zf.call(t,i)){var a=t[i];a&&typeof a=="object"&&s&&typeof s=="object"?t[i]=e(a,s,r):t.push(s)}else t[i]=s}),t):Object.keys(n).reduce(function(s,i){var a=n[i];return zf.call(s,i)?s[i]=e(s[i],a,r):s[i]=a,s},o)},oR=function(t,n){return Object.keys(n).reduce(function(r,o){return r[o]=n[o],r},t)},sR=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Hf=1024,iR=function(t,n,r,o,s){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=Hf){for(var c=i.length>=Hf?i.slice(l,l+Hf):i,u=[],d=0;d<c.length;++d){var f=c.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===tR.RFC1738&&(f===40||f===41)){u[u.length]=c.charAt(d);continue}if(f<128){u[u.length]=Nn[f];continue}if(f<2048){u[u.length]=Nn[192|f>>6]+Nn[128|f&63];continue}if(f<55296||f>=57344){u[u.length]=Nn[224|f>>12]+Nn[128|f>>6&63]+Nn[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|c.charCodeAt(d)&1023),u[u.length]=Nn[240|f>>18]+Nn[128|f>>12&63]+Nn[128|f>>6&63]+Nn[128|f&63]}a+=u.join("")}return a},aR=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o<n.length;++o)for(var s=n[o],i=s.obj[s.prop],a=Object.keys(i),l=0;l<a.length;++l){var c=a[l],u=i[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:i,prop:c}),r.push(u))}return nR(n),t},lR=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},cR=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},uR=function(t,n){return[].concat(t,n)},dR=function(t,n){if(Xr(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(n(t[o]));return r}return n(t)},Ox={arrayToObject:Ax,assign:oR,combine:uR,compact:aR,decode:sR,encode:iR,isBuffer:cR,isRegExp:lR,maybeMap:dR,merge:rR},_x=FS,xl=Ox,Ii=Wf,fR=Object.prototype.hasOwnProperty,Dx={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},Ln=Array.isArray,hR=Array.prototype.push,Mx=function(e,t){hR.apply(e,Ln(t)?t:[t])},pR=Date.prototype.toISOString,Nx=Ii.default,xt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:xl.encode,encodeValuesOnly:!1,format:Nx,formatter:Ii.formatters[Nx],indices:!1,serializeDate:function(t){return pR.call(t)},skipNulls:!1,strictNullHandling:!1},mR=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Uf={},gR=function e(t,n,r,o,s,i,a,l,c,u,d,f,h,m,p,y,b,v){for(var g=t,T=v,S=0,E=!1;(T=T.get(Uf))!==void 0&&!E;){var C=T.get(t);if(S+=1,typeof C<"u"){if(C===S)throw new RangeError("Cyclic object value");E=!0}typeof T.get(Uf)>"u"&&(S=0)}if(typeof u=="function"?g=u(n,g):g instanceof Date?g=h(g):r==="comma"&&Ln(g)&&(g=xl.maybeMap(g,function(D){return D instanceof Date?h(D):D})),g===null){if(i)return c&&!y?c(n,xt.encoder,b,"key",m):n;g=""}if(mR(g)||xl.isBuffer(g)){if(c){var I=y?n:c(n,xt.encoder,b,"key",m);return[p(I)+"="+p(c(g,xt.encoder,b,"value",m))]}return[p(n)+"="+p(String(g))]}var A=[];if(typeof g>"u")return A;var O;if(r==="comma"&&Ln(g))y&&c&&(g=xl.maybeMap(g,c)),O=[{value:g.length>0?g.join(",")||null:void 0}];else if(Ln(u))O=u;else{var F=Object.keys(g);O=d?F.sort(d):F}var _=l?n.replace(/\./g,"%2E"):n,V=o&&Ln(g)&&g.length===1?_+"[]":_;if(s&&Ln(g)&&g.length===0)return V+"[]";for(var k=0;k<O.length;++k){var M=O[k],L=typeof M=="object"&&typeof M.value<"u"?M.value:g[M];if(!(a&&L===null)){var N=f&&l?M.replace(/\./g,"%2E"):M,R=Ln(g)?typeof r=="function"?r(V,N):V:V+(f?"."+N:"["+N+"]");v.set(t,S);var z=_x();z.set(Uf,v),Mx(A,e(L,R,r,o,s,i,a,l,r==="comma"&&y&&Ln(g)?null:c,u,d,f,h,m,p,y,b,z))}}return A},yR=function(t){if(!t)return xt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||xt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Ii.default;if(typeof t.format<"u"){if(!fR.call(Ii.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=Ii.formatters[r],s=xt.filter;(typeof t.filter=="function"||Ln(t.filter))&&(s=t.filter);var i;if(t.arrayFormat in Dx?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=xt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:xt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:xt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:xt.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:xt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?xt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:xt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:xt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:xt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:xt.encodeValuesOnly,filter:s,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:xt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:xt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:xt.strictNullHandling}},vR=function(e,t){var n=e,r=yR(t),o,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):Ln(r.filter)&&(s=r.filter,o=s);var i=[];if(typeof n!="object"||n===null)return"";var a=Dx[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;o||(o=Object.keys(n)),r.sort&&o.sort(r.sort);for(var c=_x(),u=0;u<o.length;++u){var d=o[u];r.skipNulls&&n[d]===null||Mx(i,gR(n[d],d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,c))}var f=i.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),f.length>0?h+f:""},ps=Ox,Gf=Object.prototype.hasOwnProperty,bR=Array.isArray,yt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ps.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},wR=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},Lx=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},xR="utf8=%26%2310003%3B",SR="utf8=%E2%9C%93",TR=function(t,n){var r={__proto__:null},o=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=n.parameterLimit===1/0?void 0:n.parameterLimit,i=o.split(n.delimiter,s),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===SR?c="utf-8":i[l]===xR&&(c="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var u=i[l],d=u.indexOf("]="),f=d===-1?u.indexOf("="):d+1,h,m;f===-1?(h=n.decoder(u,yt.decoder,c,"key"),m=n.strictNullHandling?null:""):(h=n.decoder(u.slice(0,f),yt.decoder,c,"key"),m=ps.maybeMap(Lx(u.slice(f+1),n),function(y){return n.decoder(y,yt.decoder,c,"value")})),m&&n.interpretNumericEntities&&c==="iso-8859-1"&&(m=wR(m)),u.indexOf("[]=")>-1&&(m=bR(m)?[m]:m);var p=Gf.call(r,h);p&&n.duplicates==="combine"?r[h]=ps.combine(r[h],m):(!p||n.duplicates==="last")&&(r[h]=m)}return r},ER=function(e,t,n,r){for(var o=r?t:Lx(t,n),s=e.length-1;s>=0;--s){var i,a=e[s];if(a==="[]"&&n.parseArrays)i=n.allowEmptyArrays&&(o===""||n.strictNullHandling&&o===null)?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=n.decodeDotInKeys?l.replace(/%2E/g,"."):l,u=parseInt(c,10);!n.parseArrays&&c===""?i={0:o}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[],i[u]=o):c!=="__proto__"&&(i[c]=o)}o=i}return o},CR=function(t,n,r,o){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&i.exec(s),c=l?s.slice(0,l.index):s,u=[];if(c){if(!r.plainObjects&&Gf.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var d=0;r.depth>0&&(l=a.exec(s))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&Gf.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+s.slice(l.index)+"]"),ER(u,n,r,o)}},PR=function(t){if(!t)return yt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?yt.charset:t.charset,r=typeof t.duplicates>"u"?yt.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:yt.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:yt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:yt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:yt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:yt.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:yt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:yt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:yt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:yt.decoder,delimiter:typeof t.delimiter=="string"||ps.isRegExp(t.delimiter)?t.delimiter:yt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:yt.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:yt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:yt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:yt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:yt.strictNullHandling}},kR=function(e,t){var n=PR(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?TR(e,n):e,o=n.plainObjects?Object.create(null):{},s=Object.keys(r),i=0;i<s.length;++i){var a=s[i],l=CR(a,r[a],n,typeof e=="string");o=ps.merge(o,l,n)}return n.allowSparse===!0?o:ps.compact(o)},IR=vR,AR=kR,OR=Wf,_R={formats:OR,parse:AR,stringify:IR},De;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(De||(De={}));var Fx;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Fx||(Fx={}));const ae=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qr=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}},X=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class sn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof sn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}sn.create=e=>new sn(e);const Ai=(e,t)=>{let n;switch(e.code){case X.invalid_type:e.received===ae.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case X.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case X.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=t.defaultError,De.assertNever(e)}return{message:n}};let DR=Ai;function Yf(){return DR}const qf=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function se(e,t){const n=Yf(),r=qf({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ai?void 0:Ai].filter(o=>!!o)});e.common.issues.push(r)}class jt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return be;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return jt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return be;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),Oi=e=>({status:"dirty",value:e}),Yt=e=>({status:"valid",value:e}),Vx=e=>e.status==="aborted",$x=e=>e.status==="dirty",Sl=e=>e.status==="valid",Tl=e=>typeof Promise<"u"&&e instanceof Promise;function El(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Rx(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var he;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(he||(he={}));var _i,Di;class Fn{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bx=(e,t)=>{if(Sl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new sn(e.common.issues);return this._error=n,this._error}}};function xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{var l,c;const{message:u}=e;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:o}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Qr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new jt,ctx:{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Tl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},s=this._parseSync({data:t,path:o.path,parent:o});return Bx(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Tl(o)?o:Promise.resolve(o));return Bx(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:X.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Yn({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return qn.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this,this._def)}promise(){return Li.create(this,this._def)}or(t){return kl.create([this,t],this._def)}and(t){return Il.create(this,t,this._def)}transform(t){return new Yn({...xe(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Ml({...xe(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Hx({typeName:ge.ZodBranded,type:this,...xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Nl({...xe(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ll.create(this,t)}readonly(){return Fl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const MR=/^c[^\s-]{8,}$/i,NR=/^[0-9a-z]+$/,LR=/^[0-9A-HJKMNP-TV-Z]{26}$/,FR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,VR=/^[a-z0-9_-]{21}$/i,$R=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Kf;const jR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WR=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,zR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HR=new RegExp(`^${jx}$`);function Wx(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function UR(e){return new RegExp(`^${Wx(e)}$`)}function GR(e){let t=`${jx}T${Wx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function YR(e,t){return!!((t==="v4"||!t)&&jR.test(e)||(t==="v6"||!t)&&WR.test(e))}class Hn extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ae.string){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.string,received:s.parsedType}),be}const r=new jt;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&se(o,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")RR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Kf||(Kf=new RegExp(BR,"u")),Kf.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")FR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")VR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")MR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")NR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")LR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:X.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:X.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?GR(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?HR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?UR(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?$R.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:X.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?YR(t.data,s.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:X.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?zR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:X.invalid_string,message:s.message}),r.dirty()):De.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:X.invalid_string,...he.errToObj(r)})}_addCheck(t){return new Hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...he.errToObj(t)})}url(t){return this._addCheck({kind:"url",...he.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...he.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...he.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...he.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...he.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...he.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...he.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...he.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...he.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...he.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...he.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...he.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...he.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...he.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...he.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...he.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...he.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...he.errToObj(n)})}nonempty(t){return this.min(1,he.errToObj(t))}trim(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Hn.create=e=>{var t;return new Hn({checks:[],typeName:ge.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};function qR(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Jr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ae.number){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.number,received:s.parsedType}),be}let r;const o=new jt;for(const s of this._def.checks)s.kind==="int"?De.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?qR(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_finite,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,r,o){return new Jr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:he.toString(o)}]})}_addCheck(t){return new Jr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:he.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:he.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Jr.create=e=>new Jr({checks:[],typeName:ge.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class ms extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ae.bigint){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.bigint,received:s.parsedType}),be}let r;const o=new jt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,r,o){return new ms({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:he.toString(o)}]})}_addCheck(t){return new ms({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ms.create=e=>{var t;return new ms({checks:[],typeName:ge.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};class Zf extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ae.boolean){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.boolean,received:r.parsedType}),be}return Yt(t.data)}}Zf.create=e=>new Zf({typeName:ge.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class Mi extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ae.date){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.date,received:s.parsedType}),be}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_date}),be}const r=new jt;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):De.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Mi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:he.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:he.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Mi.create=e=>new Mi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ge.ZodDate,...xe(e)});class Xf extends Pe{_parse(t){if(this._getType(t)!==ae.symbol){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.symbol,received:r.parsedType}),be}return Yt(t.data)}}Xf.create=e=>new Xf({typeName:ge.ZodSymbol,...xe(e)});class Cl extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.undefined,received:r.parsedType}),be}return Yt(t.data)}}Cl.create=e=>new Cl({typeName:ge.ZodUndefined,...xe(e)});class Pl extends Pe{_parse(t){if(this._getType(t)!==ae.null){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.null,received:r.parsedType}),be}return Yt(t.data)}}Pl.create=e=>new Pl({typeName:ge.ZodNull,...xe(e)});class Qf extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return Yt(t.data)}}Qf.create=e=>new Qf({typeName:ge.ZodAny,...xe(e)});class gs extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Yt(t.data)}}gs.create=e=>new gs({typeName:ge.ZodUnknown,...xe(e)});class br extends Pe{_parse(t){const n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ae.never,received:n.parsedType}),be}}br.create=e=>new br({typeName:ge.ZodNever,...xe(e)});class Jf extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.void,received:r.parsedType}),be}return Yt(t.data)}}Jf.create=e=>new Jf({typeName:ge.ZodVoid,...xe(e)});class Vn extends Pe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ae.array)return se(n,{code:X.invalid_type,expected:ae.array,received:n.parsedType}),be;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(se(n,{code:i?X.too_big:X.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(se(n,{code:X.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(se(n,{code:X.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Fn(n,i,n.path,a)))).then(i=>jt.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new Fn(n,i,n.path,a)));return jt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Vn({...this._def,minLength:{value:t,message:he.toString(n)}})}max(t,n){return new Vn({...this._def,maxLength:{value:t,message:he.toString(n)}})}length(t,n){return new Vn({...this._def,exactLength:{value:t,message:he.toString(n)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...xe(t)});function ys(e){if(e instanceof dt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=qn.create(ys(r))}return new dt({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:ys(e.element)}):e instanceof qn?qn.create(ys(e.unwrap())):e instanceof to?to.create(ys(e.unwrap())):e instanceof Gn?Gn.create(e.items.map(t=>ys(t))):e}class dt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=De.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ae.object){const c=this._getOrReturnCtx(t);return se(c,{code:X.invalid_type,expected:ae.object,received:c.parsedType}),be}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof br&&this._def.unknownKeys==="strip"))for(const c in o.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=s[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Fn(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof br){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(se(o,{code:X.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Fn(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>jt.mergeObjectSync(r,c)):jt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return he.errToObj,new dt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=he.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new dt({...this._def,unknownKeys:"strip"})}passthrough(){return new dt({...this._def,unknownKeys:"passthrough"})}extend(t){return new dt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new dt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ge.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new dt({...this._def,catchall:t})}pick(t){const n={};return De.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new dt({...this._def,shape:()=>n})}omit(t){const n={};return De.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new dt({...this._def,shape:()=>n})}deepPartial(){return ys(this)}partial(t){const n={};return De.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new dt({...this._def,shape:()=>n})}required(t){const n={};return De.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof qn;)s=s._def.innerType;n[r]=s}}),new dt({...this._def,shape:()=>n})}keyof(){return zx(De.objectKeys(this.shape))}}dt.create=(e,t)=>new dt({shape:()=>e,unknownKeys:"strip",catchall:br.create(),typeName:ge.ZodObject,...xe(t)}),dt.strictCreate=(e,t)=>new dt({shape:()=>e,unknownKeys:"strict",catchall:br.create(),typeName:ge.ZodObject,...xe(t)}),dt.lazycreate=(e,t)=>new dt({shape:e,unknownKeys:"strip",catchall:br.create(),typeName:ge.ZodObject,...xe(t)});class kl extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new sn(a.ctx.common.issues));return se(n,{code:X.invalid_union,unionErrors:i}),be}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new sn(l));return se(n,{code:X.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}}kl.create=(e,t)=>new kl({options:e,typeName:ge.ZodUnion,...xe(t)});const Un=e=>e instanceof Ol?Un(e.schema):e instanceof Yn?Un(e.innerType()):e instanceof _l?[e.value]:e instanceof eo?e.options:e instanceof Dl?De.objectValues(e.enum):e instanceof Ml?Un(e._def.innerType):e instanceof Cl?[void 0]:e instanceof Pl?[null]:e instanceof qn?[void 0,...Un(e.unwrap())]:e instanceof to?[null,...Un(e.unwrap())]:e instanceof Hx||e instanceof Fl?Un(e.unwrap()):e instanceof Nl?Un(e._def.innerType):[];class eh extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.object)return se(n,{code:X.invalid_type,expected:ae.object,received:n.parsedType}),be;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(se(n,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=Un(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new eh({typeName:ge.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...xe(r)})}}function th(e,t){const n=Qr(e),r=Qr(t);if(e===t)return{valid:!0,data:e};if(n===ae.object&&r===ae.object){const o=De.objectKeys(t),s=De.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=th(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===ae.array&&r===ae.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=th(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ae.date&&r===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Il extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(Vx(s)||Vx(i))return be;const a=th(s.value,i.value);return a.valid?(($x(s)||$x(i))&&n.dirty(),{status:n.value,value:a.data}):(se(r,{code:X.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Il.create=(e,t,n)=>new Il({left:e,right:t,typeName:ge.ZodIntersection,...xe(n)});class Gn extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.array)return se(r,{code:X.invalid_type,expected:ae.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return se(r,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(se(r,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Fn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>jt.mergeArray(n,i)):jt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Gn({...this._def,rest:t})}}Gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:e,typeName:ge.ZodTuple,rest:null,...xe(t)})};class Al extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.object)return se(r,{code:X.invalid_type,expected:ae.object,received:r.parsedType}),be;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new Fn(r,a,r.path,a)),value:i._parse(new Fn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?jt.mergeObjectAsync(n,o):jt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Pe?new Al({keyType:t,valueType:n,typeName:ge.ZodRecord,...xe(r)}):new Al({keyType:Hn.create(),valueType:t,typeName:ge.ZodRecord,...xe(n)})}}class nh extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.map)return se(r,{code:X.invalid_type,expected:ae.map,received:r.parsedType}),be;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new Fn(r,a,r.path,[c,"key"])),value:s._parse(new Fn(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}nh.create=(e,t,n)=>new nh({valueType:t,keyType:e,typeName:ge.ZodMap,...xe(n)});class vs extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.set)return se(r,{code:X.invalid_type,expected:ae.set,received:r.parsedType}),be;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(se(r,{code:X.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(se(r,{code:X.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return be;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new Fn(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new vs({...this._def,minSize:{value:t,message:he.toString(n)}})}max(t,n){return new vs({...this._def,maxSize:{value:t,message:he.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vs.create=(e,t)=>new vs({valueType:e,minSize:null,maxSize:null,typeName:ge.ZodSet,...xe(t)});class Ni extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.function)return se(n,{code:X.invalid_type,expected:ae.function,received:n.parsedType}),be;function r(a,l){return qf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yf(),Ai].filter(c=>!!c),issueData:{code:X.invalid_arguments,argumentsError:l}})}function o(a,l){return qf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yf(),Ai].filter(c=>!!c),issueData:{code:X.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Li){const a=this;return Yt(async function(...l){const c=new sn([]),u=await a._def.args.parseAsync(l,s).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw c.addIssue(o(d,h)),c})})}else{const a=this;return Yt(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new sn([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new sn([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ni({...this._def,args:Gn.create(t).rest(gs.create())})}returns(t){return new Ni({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ni({args:t||Gn.create([]).rest(gs.create()),returns:n||gs.create(),typeName:ge.ZodFunction,...xe(r)})}}class Ol extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ol.create=(e,t)=>new Ol({getter:e,typeName:ge.ZodLazy,...xe(t)});class _l extends Pe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return se(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}_l.create=(e,t)=>new _l({value:e,typeName:ge.ZodLiteral,...xe(t)});function zx(e,t){return new eo({values:e,typeName:ge.ZodEnum,...xe(t)})}class eo extends Pe{constructor(){super(...arguments),_i.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{expected:De.joinValues(r),received:n.parsedType,code:X.invalid_type}),be}if(El(this,_i)||Rx(this,_i,new Set(this._def.values)),!El(this,_i).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{received:n.data,code:X.invalid_enum_value,options:r}),be}return Yt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return eo.create(t,{...this._def,...n})}exclude(t,n=this._def){return eo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}_i=new WeakMap,eo.create=zx;class Dl extends Pe{constructor(){super(...arguments),Di.set(this,void 0)}_parse(t){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const o=De.objectValues(n);return se(r,{expected:De.joinValues(o),received:r.parsedType,code:X.invalid_type}),be}if(El(this,Di)||Rx(this,Di,new Set(De.getValidEnumValues(this._def.values))),!El(this,Di).has(t.data)){const o=De.objectValues(n);return se(r,{received:r.data,code:X.invalid_enum_value,options:o}),be}return Yt(t.data)}get enum(){return this._def.values}}Di=new WeakMap,Dl.create=(e,t)=>new Dl({values:e,typeName:ge.ZodNativeEnum,...xe(t)});class Li extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.promise&&n.common.async===!1)return se(n,{code:X.invalid_type,expected:ae.promise,received:n.parsedType}),be;const r=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Yt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Li.create=(e,t)=>new Li({type:e,typeName:ge.ZodPromise,...xe(t)});class Yn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{se(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?be:l.status==="dirty"||n.value==="dirty"?Oi(l.value):l});{if(n.value==="aborted")return be;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"||n.value==="dirty"?Oi(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Sl(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Sl(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);De.assertNever(o)}}Yn.create=(e,t,n)=>new Yn({schema:e,typeName:ge.ZodEffects,effect:t,...xe(n)}),Yn.createWithPreprocess=(e,t,n)=>new Yn({schema:t,effect:{type:"preprocess",transform:e},typeName:ge.ZodEffects,...xe(n)});class qn extends Pe{_parse(t){return this._getType(t)===ae.undefined?Yt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qn.create=(e,t)=>new qn({innerType:e,typeName:ge.ZodOptional,...xe(t)});class to extends Pe{_parse(t){return this._getType(t)===ae.null?Yt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}to.create=(e,t)=>new to({innerType:e,typeName:ge.ZodNullable,...xe(t)});class Ml extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ml.create=(e,t)=>new Ml({innerType:e,typeName:ge.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xe(t)});class Nl extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Tl(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Nl.create=(e,t)=>new Nl({innerType:e,typeName:ge.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xe(t)});class rh extends Pe{_parse(t){if(this._getType(t)!==ae.nan){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}rh.create=e=>new rh({typeName:ge.ZodNaN,...xe(e)});class Hx extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ll extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"?(n.dirty(),Oi(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?be:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Ll({in:t,out:n,typeName:ge.ZodPipeline})}}class Fl extends Pe{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Sl(o)&&(o.value=Object.freeze(o.value)),o);return Tl(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Fl.create=(e,t)=>new Fl({innerType:e,typeName:ge.ZodReadonly,...xe(t)}),dt.lazycreate;var ge;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ge||(ge={})),Hn.create,Jr.create,rh.create,ms.create,Zf.create,Mi.create,Xf.create,Cl.create,Pl.create,Qf.create,gs.create,br.create,Jf.create,Vn.create,dt.create,dt.strictCreate,kl.create,eh.create,Il.create,Gn.create,Al.create,nh.create,vs.create,Ni.create,Ol.create,_l.create,eo.create,Dl.create,Li.create,Yn.create,qn.create,to.create,Yn.createWithPreprocess,Ll.create;const KR=e=>{if(typeof e!="string")try{e=JSON.stringify(e)}catch{return!1}try{return JSON.parse(e),!0}catch{return!1}},ZR=(e,t,n)=>{const r=t.length-1;for(let o=0;o<t.length;o++){const s=t[o];if(o===r)e[s]=n;else{if(!(s in e)||typeof e[s]!="object"){const i=t[o+1];e[s]=isNaN(Number(i))?{}:[]}e=e[s]}}},Ux=e=>e.replace(/\[(\d+)]/g,".$1").split("."),gn=(e,t,n)=>{const r=Array.isArray(t)?t.map(String):Ux(t),o=structuredClone(e);return ZR(o,r,n),o},XR=(e,t)=>e.localeCompare(t),Fi={},Gx=e=>{const t=e._def.typeName;if(t==="ZodDefault")return e._def.defaultValue();if(t==="ZodObject")return Yx(e);if(t==="ZodArray")return[];if("innerType"in e._def){const n=Gx(e._def.innerType);return t==="ZodArray"?n??[]:n}},Yx=e=>Object.fromEntries(Object.entries(e.shape).map(([t,n])=>[t,Gx(n)])),qx=(e,t)=>{const n=structuredClone(e);for(const r in t){const o=t[r],s=e[r];o!==void 0&&(typeof o=="object"&&o!==null&&!Array.isArray(o)&&typeof s=="object"&&s!==null&&!Array.isArray(s)?n[r]=qx(s,o):n[r]=o||s)}return n},QR={sort:XR,allowDots:!0,charset:"utf-8",parseArrays:!0,plainObjects:!0,charsetSentinel:!0,allowPrototypes:!1,depth:Number.MAX_SAFE_INTEGER,arrayLimit:Number.MAX_SAFE_INTEGER,parameterLimit:Number.MAX_SAFE_INTEGER},Kx=e=>{const t=new FormData(e),n=new URLSearchParams(t);return _R.parse(n.toString(),QR)},no=(e,t)=>Ux(e).reduce((n,r)=>{var s;if(r==="")return n;const o=((s=n.shape)==null?void 0:s[r])||n;return o._def.typeName==="ZodArray"?o.element:o},t),wr=e=>e.dataset.value?e.dataset.value:e.type==="checkbox"?e.checked:e.type==="number"?e.valueAsNumber:e.value||e.getAttribute("value"),oh=e=>{const t=e.dataset.target;if(!t)return wr(e);const n=document.querySelector(`[data-origin="${t}"]`);return wr(n||e)},JR={state:{},loading:!1,useOnChange:!1},Zx=e=>e.dataset.target||e.name,eB=e=>{const t=`@use-form/${e}`;return{get:()=>{const n=fs.LocalStorage.get(t);return KR(n)?n:{}},clear:()=>void fs.LocalStorage.delete(t),set:n=>fs.LocalStorage.set(t,n)}},tB=(e,t,n=JR)=>{const[r,o]=w.useState(null),s=w.useRef({}),[i,a]=w.useState(()=>Pt.function(n==null?void 0:n.state)?n.state():(n==null?void 0:n.state)??Yx(e)??{}),l=w.useCallback(v=>{var A;const g=v.target,T=v.currentTarget;if(g.dataset.optional==="true")return;const E=Zx(g),C=oh(g)||(T?wr(T):""),I=no(E,e);if(g.setAttribute("data-initialized","true"),I){const O=I.safeParse(C),F=O.success?void 0:((A=O.error.issues[0])==null?void 0:A.message)??"";o(_=>gn(_??{},E,F))}},[]),c=w.useCallback(v=>g=>{const T=g.currentTarget,S=Object.values(s.current).reduce((C,I)=>{var V;const A=I.element,O=I.schema.safeParse(wr(A));if(A.dataset.ignore==="ignore"||O.success)return C;const F=(V=O.error.issues[0])==null?void 0:V.message;A.setAttribute("data-initialized","true");const _=A.dataset.name||A.name||"";return gn(C,_,F)},{}),E=Pt.empty(S)?null:S;o(E),console.error(E),v==null||v({form:T,errors:E||{}})},[]),u=(v,g=Fi)=>{const T=no(v,e),S=E=>{var I;if(!E)return;const C=E instanceof Date?E.toISOString():E.target.value;a(A=>gn(A,v,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)};return{...g,loading:n.loading,name:v,id:v,onChange:S,form:t,date:Pt.string(i[v])?new Date(i[v]):i[v],required:g.required??!T.isOptional(),error:r==null?void 0:r[v],ref:E=>{E!==null&&(s.current[v]={element:E,schema:T})}}},d=(v,g=Fi)=>{const T=no(v,e);return{...g,name:v,id:v,onChange:E=>{var I;const C=E.target.value;a(A=>gn(A,v,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)},form:t,loading:n.loading,onInvalid:l,error:Tr(r,v,void 0),value:Tr(i,v,void 0)||"",required:g.required??!T.isOptional(),ref:E=>E!==null?s.current[v]={element:E,schema:T}:void 0}},f=(v,g=Fi)=>{const T=no(v,e);return{...g,name:v,id:v,onChange:E=>{var I;const C=E.target.checked;a(A=>gn(A??{},v,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)},form:t,loading:n.loading,onInvalid:l,error:Tr(r,v,void 0),required:g.required??!T.isOptional(),ref:E=>E!==null?void(s.current[v]={element:E,schema:T}):void 0}},h=(v,g=Fi)=>{const T=no(v,e),S=E=>{var I,A;(I=E.persist)==null||I.call(E);const C=E.target.value;(A=g==null?void 0:g.onChange)==null||A.call(g,E),a(O=>gn(O,v,C))};return{...g,loading:n.loading,name:v,id:v,onChange:S,form:t,onInvalid:l,error:Tr(r,v,void 0),required:g.required??!T.isOptional(),value:Tr(i,v,void 0)||(g==null?void 0:g.value)||"",type:Pt.instance(T,Jr)?"number":(g==null?void 0:g.type)??"text",ref:E=>E===null?void 0:s.current[v]={element:E,schema:T}}},m=(v,g=Fi)=>{const T=no(v,e),S=T._def.typeName==="ZodNumber";return{...g,name:v,id:v,onChange:C=>{var A,O;(A=C.persist)==null||A.call(C);const I=S?C.target.valueAsNumber:C.target.value;(O=g==null?void 0:g.onChange)==null||O.call(g,C),a(F=>gn(F,v,I))},form:t,loading:n.loading,onInvalid:l,error:Tr(r,v,void 0),required:g.required??!T.isOptional(),type:S?"number":(g==null?void 0:g.type)??"text",value:Tr(i,v,void 0)||(g==null?void 0:g.value)||"",ref:C=>C===null?void 0:void(s.current[v]={element:C,schema:T})}};w.useEffect(()=>{const v=Object.values(s.current).map(T=>{const S=T.element.dataset.origin?document.querySelector(`[data-target="${T.element.name}"]`):T.element,E=T.schema.safeParse(wr(S)),C=F=>{var L;const _=Zx(F.target);if(!_)return!1;const V=F.target,k=oh(F.target)||(F.relatedTarget?wr(F.relatedTarget):""),M=T.schema.safeParse(k);if(V.setAttribute("value",k),M.success)return S.setCustomValidity(""),o(N=>{if(Pt.null(N))return null;const R=gn(N,_,void 0);return Pt.empty(N)||Pt.nil(N)||Pt.empty(R)?null:R}),!1;if(S.required){const N=((L=M.error.issues[0])==null?void 0:L.message)||"";S.setCustomValidity(N),o(R=>{if(Pt.null(R))return null;const z=gn(R,_,N||void 0);return Pt.empty(z)?null:z})}return!1},I=new AbortController,A=S.getAttribute("data-trigger")||"blur";S.addEventListener(A,C,{signal:I.signal});const O=S.dataset.shadow?!1:S.required?!E.success:!1;return{input:T,hasInitialError:O,unsubscribe:()=>I.abort()}});return v.some(T=>T.hasInitialError)&&o(T=>T===null?{}:T),()=>v.forEach(T=>T.unsubscribe())});const p=v=>g=>{var O;g.preventDefault();const T=g.currentTarget;let S=Kx(T);(t?Array.from(document.querySelectorAll(`[form="${t}"]`)):Array.from(T.elements)).forEach(F=>{if(F.tagName==="SELECT"){const _=F;S=gn(S,_.name,_.value)}if(F.tagName==="INPUT"){const _=F,V=oh(_)||(_?wr(_):"");S=gn(S,_.dataset.target||_.name,V)}});const C=qx(S,i),I=e.safeParse(C),A=()=>{var F;ux(T),(F=n.interceptor)==null||F.clear()};if(I.success){const F=JSON.stringify(I.data);return T.setAttribute("data-json",F),(O=n.interceptor)==null||O.clear(),v==null?void 0:v(g,{form:T,event:g,reset:A,errors:[],success:!0,data:I.data,json:I.data})}return console.group("useForm error"),console.info(I),console.info(I.error.issues),console.error(I.error),console.groupEnd(),T.reportValidity(),v==null?void 0:v(g,{form:T,json:S,event:g,reset:A,data:S,success:!1,errors:I.error.issues.map(F=>({message:F.message,path:F.path.map(_=>String(_))}))})},y=v=>uc(i,v)||"",b=v=>({...v,id:t,name:t});return w.useEffect(()=>{var v;n.interceptor&&((v=n.interceptor)==null||v.set(i))},[i]),{get:y,input:m,state:i,errors:r,select:d,checkbox:f,onSubmit:p,setState:a,textarea:h,onInvalid:c,controller:b,datepicker:u,name:t,disabled:r!==null}},nB=e=>e?JSON.parse(e.getAttribute("data-json")):{},rB=e=>{const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current};J.Alert=ZI,J.Autocomplete=b2,J.Button=go,J.Calendar=Iv,J.Card=Av,J.Checkbox=pf,J.ColType=hs,J.Collapse=Iy,J.ComponentsProvider=$_,J.DatePicker=O2,J.Dropdown=Qo,J.Empty=Ov,J.Expand=BN,J.FileUpload=WV,J.Form=HV,J.Input=Ci,J.InputFeedback=Cw,J.InputField=Ei,J.Menu=zN,J.MenuItem=WN,J.Modal=ML,J.MultiCombobox=I2,J.Notifications=HD,J.Polymorph=mo,J.Radiobox=UV,J.RenderOnView=CT,J.Select=Zr,J.Stats=UD,J.Switch=GV,J.Tab=qD,J.Table=Q$,J.Tabs=GD,J.Tag=fc,J.TaskList=YV,J.Textarea=qV,J.Toolbar=NL,J.Tooltip=D0,J.TransferList=XV,J.createColumns=x$,J.createCssProperties=D_,J.createDesignTokens=bv,J.createFormStorage=eB,J.createOptionCols=Vf,J.createStyles=O_,J.createTheme=__,J.createTokenStyles=M_,J.css=Me,J.defaultDarkTheme=F_,J.defaultLightTheme=V_,J.dispatchInput=cc,J.formReset=ux,J.formToJson=Kx,J.getJsonForm=nB,J.getSchemaShape=no,J.initializeInputDataset=Os,J.isReactComponent=wT,J.isReactFC=xT,J.isSsr=Gi,J.mergeRefs=lc,J.parsers=Ea,J.path=uc,J.reduceTokens=Fo,J.safeRegex=dc,J.splitInto=ip,J.useColorParser=R_,J.useForm=tB,J.useLocale=zu,J.useNotification=WD,J.usePrevious=rB,J.useReactive=rb,J.useTablePreferences=E$,J.useTranslations=Tt,J.uuid=_s,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
230
+ */var wf,Fw;function $2(){if(Fw)return wf;Fw=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return wf=o()?Object.assign:function(s,i){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},wf}var xf,Vw;function Sf(){if(Vw)return xf;Vw=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xf=e,xf}var Tf,$w;function Rw(){return $w||($w=1,Tf=Function.call.bind(Object.prototype.hasOwnProperty)),Tf}var Ef,Bw;function R2(){if(Bw)return Ef;Bw=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Sf(),n={},r=Rw();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](i,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ef=o,Ef}var Cf,jw;function B2(){if(jw)return Cf;jw=1;var e=Lw(),t=$2(),n=Sf(),r=Rw(),o=R2(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return Cf=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(D){var B=D&&(c&&D[c]||D[u]);if(typeof B=="function")return B}var f="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:y(),arrayOf:g,element:T(),elementType:S(),instanceOf:E,node:O(),objectOf:I,oneOf:C,oneOfType:A,shape:_,exact:V};function m(D,B){return D===B?D!==0||1/D===1/B:D!==D&&B!==B}function p(D,B){this.message=D,this.data=B&&typeof B=="object"?B:{},this.stack=""}p.prototype=Error.prototype;function v(D){if(process.env.NODE_ENV!=="production")var B={},Z=0;function oe(G,$,j,H,Y,Q,fe){if(H=H||f,Q=Q||j,fe!==n){if(l){var U=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw U.name="Invariant Violation",U}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ae=H+":"+j;!B[Ae]&&Z<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+H+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),B[Ae]=!0,Z++)}}return $[j]==null?G?$[j]===null?new p("The "+Y+" `"+Q+"` is marked as required "+("in `"+H+"`, but its value is `null`.")):new p("The "+Y+" `"+Q+"` is marked as required in "+("`"+H+"`, but its value is `undefined`.")):null:D($,j,H,Y,Q)}var te=oe.bind(null,!1);return te.isRequired=oe.bind(null,!0),te}function b(D){function B(Z,oe,te,G,$,j){var H=Z[oe],Y=F(H);if(Y!==D){var Q=N(H);return new p("Invalid "+G+" `"+$+"` of type "+("`"+Q+"` supplied to `"+te+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return v(B)}function y(){return v(i)}function g(D){function B(Z,oe,te,G,$){if(typeof D!="function")return new p("Property `"+$+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var j=Z[oe];if(!Array.isArray(j)){var H=F(j);return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected an array."))}for(var Y=0;Y<j.length;Y++){var Q=D(j,Y,te,G,$+"["+Y+"]",n);if(Q instanceof Error)return Q}return null}return v(B)}function T(){function D(B,Z,oe,te,G){var $=B[Z];if(!a($)){var j=F($);return new p("Invalid "+te+" `"+G+"` of type "+("`"+j+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return v(D)}function S(){function D(B,Z,oe,te,G){var $=B[Z];if(!e.isValidElementType($)){var j=F($);return new p("Invalid "+te+" `"+G+"` of type "+("`"+j+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return v(D)}function E(D){function B(Z,oe,te,G,$){if(!(Z[oe]instanceof D)){var j=D.name||f,H=z(Z[oe]);return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected ")+("instance of `"+j+"`."))}return null}return v(B)}function C(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function B(Z,oe,te,G,$){for(var j=Z[oe],H=0;H<D.length;H++)if(m(j,D[H]))return null;var Y=JSON.stringify(D,function(fe,U){var Ae=N(U);return Ae==="symbol"?String(U):U});return new p("Invalid "+G+" `"+$+"` of value `"+String(j)+"` "+("supplied to `"+te+"`, expected one of "+Y+"."))}return v(B)}function I(D){function B(Z,oe,te,G,$){if(typeof D!="function")return new p("Property `"+$+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var j=Z[oe],H=F(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type "+("`"+H+"` supplied to `"+te+"`, expected an object."));for(var Y in j)if(r(j,Y)){var Q=D(j,Y,te,G,$+"."+Y,n);if(Q instanceof Error)return Q}return null}return v(B)}function A(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var B=0;B<D.length;B++){var Z=D[B];if(typeof Z!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+R(Z)+" at index "+B+"."),i}function oe(te,G,$,j,H){for(var Y=[],Q=0;Q<D.length;Q++){var fe=D[Q],U=fe(te,G,$,j,H,n);if(U==null)return null;U.data&&r(U.data,"expectedType")&&Y.push(U.data.expectedType)}var Ae=Y.length>0?", expected one of type ["+Y.join(", ")+"]":"";return new p("Invalid "+j+" `"+H+"` supplied to "+("`"+$+"`"+Ae+"."))}return v(oe)}function O(){function D(B,Z,oe,te,G){return k(B[Z])?null:new p("Invalid "+te+" `"+G+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return v(D)}function L(D,B,Z,oe,te){return new p((D||"React class")+": "+B+" type `"+Z+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function _(D){function B(Z,oe,te,G,$){var j=Z[oe],H=F(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type `"+H+"` "+("supplied to `"+te+"`, expected `object`."));for(var Y in D){var Q=D[Y];if(typeof Q!="function")return L(te,G,$,Y,N(Q));var fe=Q(j,Y,te,G,$+"."+Y,n);if(fe)return fe}return null}return v(B)}function V(D){function B(Z,oe,te,G,$){var j=Z[oe],H=F(j);if(H!=="object")return new p("Invalid "+G+" `"+$+"` of type `"+H+"` "+("supplied to `"+te+"`, expected `object`."));var Y=t({},Z[oe],D);for(var Q in Y){var fe=D[Q];if(r(D,Q)&&typeof fe!="function")return L(te,G,$,Q,N(fe));if(!fe)return new p("Invalid "+G+" `"+$+"` key `"+Q+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(Z[oe],null," ")+`
231
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var U=fe(j,Q,te,G,$+"."+Q,n);if(U)return U}return null}return v(B)}function k(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(k);if(D===null||a(D))return!0;var B=d(D);if(B){var Z=B.call(D),oe;if(B!==D.entries){for(;!(oe=Z.next()).done;)if(!k(oe.value))return!1}else for(;!(oe=Z.next()).done;){var te=oe.value;if(te&&!k(te[1]))return!1}}else return!1;return!0;default:return!1}}function M(D,B){return D==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function F(D){var B=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":M(B,D)?"symbol":B}function N(D){if(typeof D>"u"||D===null)return""+D;var B=F(D);if(B==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return B}function R(D){var B=N(D);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function z(D){return!D.constructor||!D.constructor.name?f:D.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Cf}var Pf,Ww;function j2(){if(Ww)return Pf;Ww=1;var e=Sf();function t(){}function n(){}return n.resetWarningCache=t,Pf=function(){function r(i,a,l,c,u,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Pf}if(process.env.NODE_ENV!=="production"){var W2=Lw(),z2=!0;bf.exports=B2()(W2.isElement,z2)}else bf.exports=j2()();var H2=bf.exports;const qe=Qx(H2);var U2=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function ki(e,t){var n=G2(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function G2(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=U2.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Y2=[".DS_Store","Thumbs.db"];function q2(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return ml(e)&&K2(e.dataTransfer)?[2,J2(e.dataTransfer,e.type)]:Z2(e)?[2,X2(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,Q2(e)]:[2,[]]})})}function K2(e){return ml(e)}function Z2(e){return ml(e)&&ml(e.target)}function ml(e){return typeof e=="object"&&e!==null}function X2(e){return kf(e.target.files).map(function(t){return ki(t)})}function Q2(e){return Jo(this,void 0,void 0,function(){var t;return es(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return ki(r)})]}})})}function J2(e,t){return Jo(this,void 0,void 0,function(){var n,r;return es(this,function(o){switch(o.label){case 0:return e.items?(n=kf(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(eV))]):[3,2];case 1:return r=o.sent(),[2,zw(Hw(r))];case 2:return[2,zw(kf(e.files).map(function(s){return ki(s)}))]}})})}function zw(e){return e.filter(function(t){return Y2.indexOf(t.name)===-1})}function kf(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function eV(e){if(typeof e.webkitGetAsEntry!="function")return Uw(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Gw(t):Uw(e)}function Hw(e){return e.reduce(function(t,n){return Ld(Ld([],b0(t),!1),b0(Array.isArray(n)?Hw(n):[n]),!1)},[])}function Uw(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=ki(t);return Promise.resolve(n)}function tV(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return[2,e.isDirectory?Gw(e):nV(e)]})})}function Gw(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(a){return Jo(i,void 0,void 0,function(){var l,c,u;return es(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(tV)),o.push(u),s(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}s()})}function nV(e){return Jo(this,void 0,void 0,function(){return es(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=ki(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var rV=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var a=i.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):o===a})}return!0};function Yw(e){return iV(e)||sV(e)||Xw(e)||oV()}function oV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
232
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iV(e){if(Array.isArray(e))return If(e)}function qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Kw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(n),!0).forEach(function(r){Zw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ii(e,t){return cV(e)||lV(e,t)||Xw(e,t)||aV()}function aV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
233
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xw(e,t){if(e){if(typeof e=="string")return If(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return If(e,t)}}function If(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function cV(e){if(Array.isArray(e))return e}var uV="file-invalid-type",dV="file-too-large",fV="file-too-small",hV="too-many-files",pV=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:uV,message:"File type must be ".concat(n)}},Qw=function(t){return{code:dV,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Jw=function(t){return{code:fV,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},mV={code:hV,message:"Too many files"};function ex(e,t){var n=e.type==="application/x-moz-file"||rV(e,t);return[n,n?null:pV(t)]}function tx(e,t,n){if(Kr(e.size))if(Kr(t)&&Kr(n)){if(e.size>n)return[!1,Qw(n)];if(e.size<t)return[!1,Jw(t)]}else{if(Kr(t)&&e.size<t)return[!1,Jw(t)];if(Kr(n)&&e.size>n)return[!1,Qw(n)]}return[!0,null]}function Kr(e){return e!=null}function gV(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(l){var c=ex(l,n),u=Ii(c,1),d=u[0],f=tx(l,r,o),h=Ii(f,1),m=h[0],p=a?a(l):null;return d&&m&&!p})}function gl(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function yl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function nx(e){e.preventDefault()}function yV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vV(e){return e.indexOf("Edge/")!==-1}function bV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return yV(e)||vV(e)}function Mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(a){return!gl(r)&&a&&a.apply(void 0,[r].concat(s)),gl(r)})}}function wV(){return"showOpenFilePicker"in window}function xV(e){if(Kr(e)){var t=Object.entries(e).filter(function(n){var r=Ii(n,2),o=r[0],s=r[1],i=!0;return rx(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(ox))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=Ii(r,2),s=o[0],i=o[1];return Kw(Kw({},n),{},Zw({},s,i))},{});return[{description:"Files",accept:t}]}return e}function SV(e){if(Kr(e))return Object.entries(e).reduce(function(t,n){var r=Ii(n,2),o=r[0],s=r[1];return[].concat(Yw(t),[o],Yw(s))},[]).filter(function(t){return rx(t)||ox(t)}).join(",")}function TV(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function EV(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function rx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function ox(e){return/^.*\.[\w]+$/.test(e)}var CV=["children"],PV=["open"],kV=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],IV=["refKey","onChange","onClick"];function AV(e){return DV(e)||_V(e)||sx(e)||OV()}function OV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
234
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _V(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DV(e){if(Array.isArray(e))return Of(e)}function Af(e,t){return LV(e)||NV(e,t)||sx(e,t)||MV()}function MV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
235
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sx(e,t){if(e){if(typeof e=="string")return Of(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Of(e,t)}}function Of(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function LV(e){if(Array.isArray(e))return e}function ix(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ix(Object(n),!0).forEach(function(r){_f(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ix(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vl(e,t){if(e==null)return{};var n=FV(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Df=w.forwardRef(function(e,t){var n=e.children,r=vl(e,CV),o=lx(r),s=o.open,i=vl(o,PV);return w.useImperativeHandle(t,function(){return{open:s}},[s]),w.createElement(w.Fragment,null,n(st(st({},i),{},{open:s})))});Df.displayName="Dropzone";var ax={disabled:!1,getFilesFromEvent:q2,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Df.defaultProps=ax,Df.propTypes={children:qe.func,accept:qe.objectOf(qe.arrayOf(qe.string)),multiple:qe.bool,preventDropOnDocument:qe.bool,noClick:qe.bool,noKeyboard:qe.bool,noDrag:qe.bool,noDragEventsBubbling:qe.bool,minSize:qe.number,maxSize:qe.number,maxFiles:qe.number,disabled:qe.bool,getFilesFromEvent:qe.func,onFileDialogCancel:qe.func,onFileDialogOpen:qe.func,useFsAccessApi:qe.bool,autoFocus:qe.bool,onDragEnter:qe.func,onDragLeave:qe.func,onDragOver:qe.func,onDrop:qe.func,onDropAccepted:qe.func,onDropRejected:qe.func,onError:qe.func,validator:qe.func};var Mf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function lx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=st(st({},ax),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,v=t.onFileDialogOpen,b=t.useFsAccessApi,y=t.autoFocus,g=t.preventDropOnDocument,T=t.noClick,S=t.noKeyboard,E=t.noDrag,C=t.noDragEventsBubbling,I=t.onError,A=t.validator,O=w.useMemo(function(){return SV(n)},[n]),L=w.useMemo(function(){return xV(n)},[n]),_=w.useMemo(function(){return typeof v=="function"?v:cx},[v]),V=w.useMemo(function(){return typeof p=="function"?p:cx},[p]),k=w.useRef(null),M=w.useRef(null),F=w.useReducer(VV,Mf),N=Af(F,2),R=N[0],z=N[1],D=R.isFocused,B=R.isFileDialogActive,Z=w.useRef(typeof window<"u"&&window.isSecureContext&&b&&wV()),oe=function(){!Z.current&&B&&setTimeout(function(){if(M.current){var le=M.current.files;le.length||(z({type:"closeDialog"}),V())}},300)};w.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[M,B,V,Z]);var te=w.useRef([]),G=function(le){k.current&&k.current.contains(le.target)||(le.preventDefault(),te.current=[])};w.useEffect(function(){return g&&(document.addEventListener("dragover",nx,!1),document.addEventListener("drop",G,!1)),function(){g&&(document.removeEventListener("dragover",nx),document.removeEventListener("drop",G))}},[k,g]),w.useEffect(function(){return!r&&y&&k.current&&k.current.focus(),function(){}},[k,y,r]);var $=w.useCallback(function(ne){I?I(ne):console.error(ne)},[I]),j=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne),te.current=[].concat(AV(te.current),[ne.target]),yl(ne)&&Promise.resolve(o(ne)).then(function(le){if(!(gl(ne)&&!C)){var Ne=le.length,tt=Ne>0&&gV({files:le,accept:O,minSize:i,maxSize:s,multiple:a,maxFiles:l,validator:A}),Ot=Ne>0&&!tt;z({isDragAccept:tt,isDragReject:Ot,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ne)}}).catch(function(le){return $(le)})},[o,c,$,C,O,i,s,a,l,A]),H=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne);var le=yl(ne);if(le&&ne.dataTransfer)try{ne.dataTransfer.dropEffect="copy"}catch{}return le&&d&&d(ne),!1},[d,C]),Y=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne);var le=te.current.filter(function(tt){return k.current&&k.current.contains(tt)}),Ne=le.indexOf(ne.target);Ne!==-1&&le.splice(Ne,1),te.current=le,!(le.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),yl(ne)&&u&&u(ne))},[k,u,C]),Q=w.useCallback(function(ne,le){var Ne=[],tt=[];ne.forEach(function(Ot){var Vt=ex(Ot,O),Wt=Af(Vt,2),ro=Wt[0],bs=Wt[1],ws=tx(Ot,i,s),$l=Af(ws,2),ih=$l[0],ah=$l[1],lh=A?A(Ot):null;if(ro&&ih&&!lh)Ne.push(Ot);else{var ch=[bs,ah];lh&&(ch=ch.concat(lh)),tt.push({file:Ot,errors:ch.filter(function(sB){return sB})})}}),(!a&&Ne.length>1||a&&l>=1&&Ne.length>l)&&(Ne.forEach(function(Ot){tt.push({file:Ot,errors:[mV]})}),Ne.splice(0)),z({acceptedFiles:Ne,fileRejections:tt,type:"setFiles"}),f&&f(Ne,tt,le),tt.length>0&&m&&m(tt,le),Ne.length>0&&h&&h(Ne,le)},[z,a,O,i,s,l,f,h,m,A]),fe=w.useCallback(function(ne){ne.preventDefault(),ne.persist(),ee(ne),te.current=[],yl(ne)&&Promise.resolve(o(ne)).then(function(le){gl(ne)&&!C||Q(le,ne)}).catch(function(le){return $(le)}),z({type:"reset"})},[o,Q,$,C]),U=w.useCallback(function(){if(Z.current){z({type:"openDialog"}),_();var ne={multiple:a,types:L};window.showOpenFilePicker(ne).then(function(le){return o(le)}).then(function(le){Q(le,null),z({type:"closeDialog"})}).catch(function(le){TV(le)?(V(le),z({type:"closeDialog"})):EV(le)?(Z.current=!1,M.current?(M.current.value=null,M.current.click()):$(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):$(le)});return}M.current&&(z({type:"openDialog"}),_(),M.current.value=null,M.current.click())},[z,_,V,b,Q,$,L,a]),Ae=w.useCallback(function(ne){!k.current||!k.current.isEqualNode(ne.target)||(ne.key===" "||ne.key==="Enter"||ne.keyCode===32||ne.keyCode===13)&&(ne.preventDefault(),U())},[k,U]),Ke=w.useCallback(function(){z({type:"focus"})},[]),Be=w.useCallback(function(){z({type:"blur"})},[]),Ce=w.useCallback(function(){T||(bV()?setTimeout(U,0):U())},[T,U]),q=function(le){return r?null:le},ie=function(le){return S?null:q(le)},W=function(le){return E?null:q(le)},ee=function(le){C&&le.stopPropagation()},ye=w.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=ne.refKey,Ne=le===void 0?"ref":le,tt=ne.role,Ot=ne.onKeyDown,Vt=ne.onFocus,Wt=ne.onBlur,ro=ne.onClick,bs=ne.onDragEnter,ws=ne.onDragOver,$l=ne.onDragLeave,ih=ne.onDrop,ah=vl(ne,kV);return st(st(_f({onKeyDown:ie(Mn(Ot,Ae)),onFocus:ie(Mn(Vt,Ke)),onBlur:ie(Mn(Wt,Be)),onClick:q(Mn(ro,Ce)),onDragEnter:W(Mn(bs,j)),onDragOver:W(Mn(ws,H)),onDragLeave:W(Mn($l,Y)),onDrop:W(Mn(ih,fe)),role:typeof tt=="string"&&tt!==""?tt:"presentation"},Ne,k),!r&&!S?{tabIndex:0}:{}),ah)}},[k,Ae,Ke,Be,Ce,j,H,Y,fe,S,E,r]),ue=w.useCallback(function(ne){ne.stopPropagation()},[]),je=w.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=ne.refKey,Ne=le===void 0?"ref":le,tt=ne.onChange,Ot=ne.onClick,Vt=vl(ne,IV),Wt=_f({accept:O,multiple:a,type:"file",style:{display:"none"},onChange:q(Mn(tt,fe)),onClick:q(Mn(Ot,ue)),tabIndex:-1},Ne,M);return st(st({},Wt),Vt)}},[M,n,a,fe,r]);return st(st({},R),{},{isFocused:D&&!r,getRootProps:ye,getInputProps:je,rootRef:k,inputRef:M,open:q(U)})}function VV(e,t){switch(t.type){case"focus":return st(st({},e),{},{isFocused:!0});case"blur":return st(st({},e),{},{isFocused:!1});case"openDialog":return st(st({},Mf),{},{isFileDialogActive:!0});case"closeDialog":return st(st({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return st(st({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return st(st({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return st({},Mf);default:return e}}function cx(){}const $V={isImage:e=>e.type.includes("image")},RV=e=>{const[t,n]=w.useState({url:"",type:"",size:""});return w.useEffect(()=>{if($V.isImage(e.file)){const r=URL.createObjectURL(e.file);return n({url:r,type:"img",size:_w(e.file.size)}),()=>{URL.revokeObjectURL(r)}}n({url:"",type:e.file.type,size:_w(e.file.size)})},[e.file]),t.type==="img"?x.jsxs("div",{className:"gap-jade-200 flex w-full flex-row items-center justify-between",children:[x.jsxs("header",{className:"gap-jade-200 flex flex-row items-center",children:[x.jsx("img",{src:t.url,className:"size-jade-500 rounded-jade-xsmall",alt:`Miniatura do arquivo ${e.file.name}`}),x.jsxs("div",{className:"flex flex-col",children:[x.jsx("span",{children:e.file.name}),x.jsx("span",{children:t.size})]})]}),x.jsx(go,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:x.jsx(Oo,{})})]}):x.jsxs("div",{className:"gap-jade-200 flex w-full flex-row items-center justify-between",children:[x.jsxs("header",{className:"flex flex-row items-center gap-4",children:[x.jsx(Cy,{size:48}),x.jsxs("div",{className:"flex flex-col items-start justify-start text-left",children:[x.jsx("span",{children:e.file.name}),x.jsx("span",{children:t.size})]})]}),x.jsx(go,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:x.jsx(Oo,{className:"text-danger"})})]})},BV=e=>x.jsx("ul",{className:"space-y-jade-200 w-full",children:e.files.map(t=>x.jsx(RV,{onDeleteFile:e.onDeleteFile,file:t},t.name))}),jV=e=>e.isDragActive?x.jsx("p",{children:"Solte os arquivos selecionados"}):e.files.length>0?x.jsx(BV,{onDeleteFile:e.onDeleteFile,files:e.files}):x.jsx(w.Fragment,{children:e.idle}),WV=x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[x.jsx(KI,{size:64}),x.jsxs("p",{children:["You can drag your files or"," ",x.jsx("button",{className:"text-primary underline",type:"button",children:"drag to here"})]})]}),zV=({idle:e=WV,onDeleteFile:t,onDrop:n,...r})=>{var u;const[o,s]=w.useState([]),i=d=>{n==null||n(d),s(d)},{getRootProps:a,getInputProps:l,isDragActive:c}=lx({onDrop:i});return x.jsxs("div",{...a(),"data-active":(u=r.files)!=null&&u.length?r.files.length>0:!1,className:"flex flex-col items-center justify-center rounded-lg border-2 border-card-border p-6 text-foreground data-[active=true]:border-solid data-[active=false]:border-dashed data-[active=true]:bg-card-background",children:[x.jsx("input",{...l(r),name:r.name,id:r.name}),x.jsx(jV,{onDeleteFile:t,isDragActive:c,idle:e,files:r.files??o})]})},HV=["INPUT","SELECT"],ux=e=>{if(!e)return;Array.from(e.elements).forEach(n=>{HV.includes(n.tagName)&&(n.tagName==="INPUT"&&(n.value=n.defaultValue),n.tagName==="SELECT"&&(n.value=""),n.setAttribute("data-initialized","false"))})},UV=e=>{const t=n=>{var r;n.persist(),n.preventDefault(),(r=e.onSubmit)==null||r.call(e,n)};return x.jsx("form",{...e,onSubmit:t})},GV=({children:e,className:t="",size:n,...r})=>x.jsxs("label",{"data-component":"radiobox","data-disabled":r.disabled,"aria-disabled":r.disabled,className:"group flex items-center gap-2 font-normal data-[disabled=true]:cursor-not-allowed",children:[x.jsx("input",{...r,type:"radio",className:Me("app form-radio inline-block h-4 w-4 appearance-none rounded-full border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",t),...r}),e]}),Zr=w.forwardRef(({required:e=!0,options:t,info:n,selectContainer:r="",feedback:o=null,labelClassName:s,interactive:i,rightLabel:a,optionalText:l,container:c,hideLeft:u=!1,right:d,left:f,error:h,...m},p)=>{const v=Tt(),b=w.useRef(null),y=m.id??m.name;w.useImperativeHandle(p,()=>b.current),w.useEffect(()=>{if(b.current===null)return;const T=new AbortController,S=b.current,E=Os(b.current);return S.addEventListener("change",()=>S.setAttribute("data-selected","true"),{once:!0,signal:T.signal}),()=>{E(),T.abort()}},[]);const g=()=>{var T;return(T=b.current)==null?void 0:T.focus()};return x.jsx(Ci,{info:n,left:f,error:h,form:m.form,name:m.name,feedback:o,hideLeft:u,required:e,title:m.title,container:c,componentName:"select",rightLabel:a,interactive:i,id:m.name||m.id,optionalText:l,labelClassName:s,placeholder:m.placeholder,right:x.jsx("label",{htmlFor:y,children:x.jsxs("button",{onClick:g,type:"button",className:"mt-2 transition-colors hover:text-primary",children:[x.jsx(Eu,{size:20}),x.jsx("span",{className:"sr-only",children:v.inputCaretDown})]})}),children:x.jsxs("select",{...m,id:y,name:y,value:m.value,required:e,ref:cc(p,b),"data-selected":!!m.value||!1,defaultValue:m.value?void 0:"",title:typeof m.title=="string"?m.title:void 0,className:Me("input select group h-10 w-full flex-1 appearance-none rounded-md","bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder","outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error","data-[selected=false]:text-input-placeholder",m.className),children:[x.jsx("option",{value:"",disabled:!0,hidden:!0,children:m.placeholder}),t.map(T=>w.createElement("option",{...T,value:T.value,children:T.label??T.value,key:`${y}-select-option-${T.value}`}))]})})}),YV=w.forwardRef(({children:e,container:t,error:n,...r},o)=>{const s=w.useId(),[i,a]=w.useState(r.checked??!1),l=i,c=w.useRef(null),u=Ds(r.onChange);w.useImperativeHandle(o,()=>c.current),w.useEffect(()=>{if(c.current!==null&&u.current){const f=h=>{h.target.checked=!h.target.checked,u.current&&u.current(h)};return c.current.addEventListener("change",f),()=>{var h;return(h=c.current)==null?void 0:h.removeEventListener("change",f)}}},[]);const d=()=>{var h,m;const f=!((h=c.current)!=null&&h.checked);a(f),(m=r==null?void 0:r.onCheck)==null||m.call(r,f),c.current!==null&&(c.current.checked=f,c.current.dispatchEvent(new Event("change",{bubbles:!0})))};return x.jsxs("fieldset",{className:Me("flex flex-col flex-wrap justify-center",t),"data-component":"switch",children:[x.jsxs("span",{className:"flex flex-row flex-wrap items-center",children:[x.jsx("input",{...r,checked:l,"data-checked":l,"data-trigger":"change",hidden:!0,id:r.id||s,onChange:f=>a(f.target.checked),ref:c,type:"checkbox"}),x.jsx("button",{type:"button",role:"switch",onClick:d,"aria-checked":l,"data-checked":l,"aria-labelledby":`${s}-label`,className:"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary",children:x.jsx("span",{"aria-hidden":"true","data-checked":l,className:"inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"})}),x.jsx("label",{htmlFor:r.id||s,className:"ml-3 inline-block text-sm",id:`${s}-label`,children:x.jsx("span",{className:"font-medium text-foreground",children:e})})]}),x.jsx("span",{className:"mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden",children:n})]})}),qV=e=>{const[t,n]=EI();return w.useEffect(()=>{const r=t.current;if(!r)return;const o=s=>{const i=s.target,a=Array.from(r.querySelectorAll("input[data-task=true]")),l=a.every(u=>u.checked),c=a.indexOf(i);l&&c!==-1&&n("input",{scale:[1,1.35,1],rotate:[0,20,-20,0]},{duration:.5,delay:AI(.075,{from:c})})};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),x.jsx("fieldset",{...e,"data-component":"task-list",ref:t})},KV=kw("textarea","textarea",{container:"w-full"},e=>{const t=()=>{const n=e.value.split(`
236
+ `);if(e.style.height="auto",n.length>1)return void(e.style.height=`${e.scrollHeight}px`)};return e.addEventListener("input",t),()=>e.removeEventListener("input",t)}),ZV=e=>{const[t,n]=w.useState(0);return w.useEffect(()=>{const r=e.current;if(!r)return;const o=r.parentElement;if(!o)return;const s=()=>{n(o.clientHeight)};return o.addEventListener("resize",s),s(),()=>{o.removeEventListener("resize",s)}},[]),t},XV={Item:w.forwardRef(function(t,n){return x.jsx("li",{...t,ref:n,className:"flex items-center gap-1 justify-between"})}),List:w.forwardRef(function(t,n){return x.jsx("ul",{...t,ref:n,className:"space-y-3"})})},QV=e=>{const t=w.useRef(null),n=ZV(t);return x.jsxs("div",{className:"flex flex-row gap-4",ref:t,children:[x.jsxs("div",{className:"py-8 space-y-4 min-w-64 w-fit flex flex-col whitespace-nowrap rounded-lg border border-card-border",children:[x.jsx("header",{className:"border-b border-card-border pb-2"}),x.jsxs("div",{className:"px-8 space-y-2",children:[x.jsx(Pi,{rightLabel:"",title:"Search",placeholder:"Looking for..."}),x.jsx(df,{height:n,useWindowScroll:!0,data:e.source,components:XV,itemContent:(r,o)=>x.jsx(w.Fragment,{children:x.jsx(gf,{children:x.jsx(e.Item,{data:o})})})})]})]}),x.jsx("div",{children:x.jsx(go,{children:x.jsx(Cu,{})})}),x.jsx("div",{})]})};var JV=Object.defineProperty,dx=Object.getOwnPropertySymbols,e$=Object.prototype.hasOwnProperty,t$=Object.prototype.propertyIsEnumerable,fx=(e,t,n)=>t in e?JV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n$=(e,t)=>{for(var n in t||(t={}))e$.call(t,n)&&fx(e,n,t[n]);if(dx)for(var n of dx(t))t$.call(t,n)&&fx(e,n,t[n]);return e},Nf=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return!0;return!1},r$=(e,t,n,r)=>wl(Nf,e,t,n,r),us=e=>typeof e=="object",vr=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||!us(e)&&!us(t))return e===t;if(e.prototype!==t.prototype)return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>vr(e[r],t[r]))},o$=(e,t)=>(us(e)||Array.isArray(e))&&t?e[t]:e,s$=e=>(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1,bl=e=>/[0-9.]+/.test(e),hx=e=>["string","number"].includes(typeof e),px=e=>e==null||(e==null?void 0:e.length)===0||e==="",mx={eq:vr,is:Object.is,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,includes:(e,t)=>`${e}`.includes(t),notIncludes:(e,t)=>!`${e}`.includes(t),startsWith:(e,t)=>`${e}`.startsWith(t),endsWith:(e,t)=>`${e}`.endsWith(t),like:(e,t)=>new RegExp(`.*${t}.*`,"gi").test(`${e}`),alphabetical:(e,t)=>e.toString().localeCompare(t.toString()),empty:px,notEmpty:e=>!px(e),in:(e,t)=>Nf(t,n=>vr(e,n)),notIn:(e,t)=>gx(t,n=>!vr(e,n))},i$=e=>{if(e in mx)return mx[e];throw new Error("Linq - Symbol not found")},ds=(e,t)=>{const n=[],r=e.length;for(let o=0;o<r;o++)t(e[o],o,e)&&n.push(e[o]);return n},wl=(e,t,n,r,o)=>{if(typeof n=="function")return e(t,n);const s=i$(r);return n&&r&&o!==void 0?e(t,i=>s(i[n],o)):e(t,i=>s(i,o))},a$=(e,t,n,r)=>wl(ds,e,t,n,r),gx=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},l$=(e,t,n,r)=>wl(gx,e,t,n,r),yx=e=>{if(e===null)return null;const t=n$({},e);return Object.keys(t).forEach(n=>t[n]=us(e[n])?yx(e[n]):e[n]),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},vx=(e,t)=>{if(us(t)){for(let n=0;n<e.length;n++){const r=e[n];if(vr(t,r))return!0}return!1}for(let n=0;n<e.length;n++){const r=e[n];if(vr(t,r))return!0}return!1},c$=(e,t)=>{const n=new Map(e.map(r=>[r[t],r]));return Object.fromEntries(n.entries())},u$=e=>ds(e,(t,n,r)=>us(t)?n===r.findIndex(o=>vr(o,t)):n===r.indexOf(t)),d$=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return e[r]},bx=(e,t)=>{const n=new Map;return e.forEach(r=>{const o=t(r),s=n.get(o)||[];s.push(r),n.set(o,s)}),Object.fromEntries(n.entries())},f$=(e,t)=>bx(e,n=>n[t]),wx=(e,t)=>{const n=[];let r=0;const o=e.length;for(r;r<o;r++){const s=t(e[r],r,e);n.push(s)}return n},h$=(e,t)=>{let n=Number.parseInt(e,10),r=Number.parseInt(t,10);return n>r?[r,n]:[n,r]},p$=(e,t,n=1)=>{const r=[];let o=e.charCodeAt(0);const s=t.charCodeAt(0);for(;o<=s;o+=n)r.push(String.fromCharCode(o));return bl(e)&&bl(t)?r.map(i=>Number.parseInt(i)):r},Lf=(e,t,n=1)=>{let r=Math.abs(n);if((e.length>1||t.length>1)&&bl(e)&&bl(t)){const o=[],[s,i]=h$(e,t);for(let a=s;a<=i;a+=r)o.push(a);return o}return p$(e,t,r)},m$=(e,t,n=1)=>{if(t===void 0){const[r,o,s]=e.split("..");return s===void 0?Lf(r,o,1):Lf(r,s,Number.parseInt(o,10))}return hx(e)&&hx(t)?Lf(`${e}`,`${t}`,n):Array.from({length:e},(r,o)=>o*Math.abs(t))},Ff=(e,t,n)=>{let r=t;const o=n.length;for(let s=0;s<o;s++){const i=n[s];r=e(r,i,s,n)}return r},xx=e=>{const t=Array.from(e.values());let n=null,r=null,o=t.length;for(n=0;n<o/2;n+=1){r=o-1-n;let s=t[n];t[n]=t[r],t[r]=s}return t},g$=(e,t)=>{if(typeof t=="number")return e.slice(t);let n=e.length;for(let r=0;r<n;r++){const o=e[r];if(t(o,r,e))return e.slice(r)}return e.slice(0)},y$=(e,t,n,r)=>wl(g$,e,t,n,r),Sx=(e,t)=>{const n=[...e];return t===void 0?n.sort():typeof t=="function"?n.toSorted(t):n.toSorted(s$(t))},Tx=(e=>(e.Asc="asc",e.Desc="desc",e))(Tx||{}),v$=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.key,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),b$=(e,t)=>e.sort(v$(t)),w$=(e,t)=>{if(t===void 0)return[...new Set(e).values()];const n=new Set;return Array.isArray(t)?[...new Set(t)]:ds(e,r=>{const o=t?n.has(r[t]):n.has(t);return t&&(o||n.add(r[t])),!o})},x$=class uh{constructor(t=[]){this.array=t}static Range(...t){return m$(...t)}static New(t){return new uh(t)}Where(t,n,r){return this.array=a$(this.array,t,n,r),this}Some(t,n,r){return r$(this.array,t,n,r)}All(t,n,r){return l$(this.array,t,n,r)}Reverse(){return this.array=xx(this.array),this}Add(t){return this.array=Array.isArray(t)?this.array.concat(t):this.array.concat([t]),this}Prepend(t){return this.array=Array.isArray(t)?t.concat(this.array):[t].concat(this.array),this}Select(t){return t===void 0?this.array:this.array.map(t)}Take(t,n){return n!==void 0?this.array=this.array.slice(t,Math.max(0,n)):this.array=this.array.slice(t),this}Head(){return this.array[0]}Tail(){return this.Skip(1)}Skip(t,n,r){return this.array=y$(this.array,t,n,r),this}Distinct(){return this.array=u$(this.array),this}First(t){return t===void 0?this.array[0]:d$(this.array,t)||null}Last(t){const n=this.array.length;if(t===void 0)return this.array[n-1];for(let r=n;r!==0;r--)if(t(this.array[r],r,this.array))return this.array[r]}Sum(t){return t===void 0?Ff((n,r)=>n+r,0,this.array):Ff((n,r)=>n+o$(r,t),0,this.array)}Average(t){return this.Sum(t)/this.array.length}GroupBy(t){return f$(this.array,t)}GroupWith(t){return bx(this.array,t)}Except(t){return ds(this.array,n=>!vx(t,n))}Intersect(t){return ds(this.array,n=>vx(t,n))}OrderBy(t,n){let r;return r=t?Sx(this.array,t):this.array.toSorted(),this.array=n==="desc"?xx(r):r,this}Includes(t){return Nf(this.array,n=>vr(n,t))}In(t){const n=t.length;for(let r=0;r<n;r++){const o=t[r];if(this.Includes(o))return!0}return!1}Reduce(t,n){return Ff(t,n??this.array[0],this.array)}Empty(){return this.array.length===0}ToMap(t){return new Map(wx(this.array,n=>[t,n]))}Zip(t,n){return wx(this.array,(r,o)=>n(r,t[o]))}Count(t){return t===void 0?this.array.length:ds(this.array,t).length}Get(t){return this.array[t]}Clone(){return new uh(yx(this.array))}ToObject(t){return c$(this.array,t)}Sort(t){return Array.isArray(t)?b$(this.array,t):Sx(this.array,t)}Unique(t){return w$(this.array,t)}},Ex=x$,fs={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=(v,b)=>{try{Object.keys(v).forEach(b)}catch(y){window.console.log(y)}},n=v=>v==null,r=v=>{const b=typeof v;return b==="string"||b==="number"||b==="boolean"||n(v)},o=(v,b)=>{const y=b.getItem(v);try{return JSON.parse(y)}catch{return y??null}},s=v=>Object.keys(v).reduce((b,y)=>({...b,[y]:o(y,v)}),{}),i=v=>v instanceof Date?v:typeof v=="number"?new Date(new Date*1+v*864e5):v,a="1969-12-31T23:59:59.000Z",l=()=>document.cookie===""?{}:document.cookie.split("; ").map(v=>v.split("=")).reduce((v,b)=>(v[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),v),{}),c=new Set,u=()=>{const v=l();c.forEach(b=>b(v))},d=[{name:"expires",parse:v=>`expires=${i(v.expires??a)}`},{name:"maxAge",parse:v=>v.maxAge?`max-age=${i(v.expires??a)}`:""},{name:"path",parse:v=>`path=${v.path??"/"}`},{name:"sameSite",parse:v=>`samesite=${v.sameSite??"strict"}`},{name:"useSecure",parse:v=>`${v.useSecure??!0?"secure":""}`},{name:"domain",parse:v=>{const b=v.domain??"";return b===""?"":`domain=${v.multiDomain?".":""}${b}`}},{name:"partitioned",parse:v=>v.partitioned?"Partitioned":""}],f={json:l,listener:v=>(c.add(v),()=>c.delete(v)),clearListeners:()=>c.clear(),has:v=>document.cookie.split(";").some(b=>b.trim().startsWith(`${v}=`)),deleteAll:()=>{document.cookie.split(";").forEach(v=>{document.cookie=v.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}),u()},get:v=>{const b=f.json()[v];if(n(b))return null;try{return JSON.parse(decodeURIComponent(b))}catch{return b}},delete:v=>{document.cookie=`${encodeURIComponent(v)}=;expires=${new Date().toUTCString()}`,u()},set:(v,b,y={})=>{const g=r(b)?b:encodeURIComponent(JSON.stringify(b)),T=d.reduce((S,E)=>{const C=E.parse(y);return C===""?S:S.concat(C)},[`${encodeURIComponent(v)}=${g}`]).join(";");document.cookie=T,u()}},h=v=>{const b=new Set,y=g=>{v().removeItem(g);const T=s(v());b.forEach(S=>S(T))};return{delete:y,listener:g=>(b.add(g),()=>b.delete(g)),clearListeners:()=>b.clear(),json:(g=!1)=>g?s(v()):v(),has:g=>{const T=v().getItem(g);return!n(T)},deleteAll:()=>{t(v(),y),b.forEach(g=>g(v()))},get:g=>o(g,v()),set:(g,T)=>{v().setItem(g,JSON.stringify(T)),b.forEach(S=>S(v()))}}},m=h(()=>window.sessionStorage),p=h(()=>window.localStorage);e.Cookie=f,e.LocalStorage=p,e.SessionStorage=m,e.createStorage=h})(fs);const Vf=e=>e.headerLabel??e.thead??e.id,$f=e=>e.map(t=>({value:t.id,label:t.thead??t.headerLabel??t.id}));var hs=(e=>(e.Boolean="boolean",e.Number="number",e.Select="select",e.Text="text",e))(hs||{});const Rf=e=>e.type==="number"?e.valueAsNumber:e.value,S$=e=>{let t=[];return e({add:(o,s,i)=>t.push({...i,id:o,thead:s}),remove:o=>t=t.filter(s=>s.id!==o)}),t},T$={},E$=(e,t)=>{if(!Array.isArray(t))return e;const n=new Set(t.map(o=>o.id));if(!e.every(o=>n.has(o.id)))return e;const r=new Map(e.map(o=>[o.id,o]));return t.map((o,s)=>{const i=r.get(o.id);return i===void 0?e[s]:i})},C$=(e,t,n=T$)=>{const r=Yi()?null:fs.LocalStorage.get(`@components/table-${e}`)||null,[o,s]=ju({name:e,groups:n.groups||(r==null?void 0:r.groups)||[],sorters:n.sorters||(r==null?void 0:r.sorters)||[],filters:n.filters||(r==null?void 0:r.filters)||[],cols:E$(t,r==null?void 0:r.cols)},i=>{const a=l=>{const c=i.state(),u={...c,...l};return Yi()||fs.LocalStorage.set(`@components/table-${c.name}`,u),u};return a(i.state()),{set:l=>a(l)}});return{...o,...s,name:e}},Bf=(e,t,n,r={})=>{var c,u;const o=e.id,s=e.type??hs.Text,i=t[s]??[],a=((c=i.find(d=>d["data-default"]))==null?void 0:c.value)??((u=i[0])==null?void 0:u.value),l=n[a];return{id:_s(),operation:l,label:Vf(e),name:o,type:s,value:"",...r}},jf=()=>{const e=Tt(),t=w.useMemo(()=>({contains:{value:"contains",label:e.tableFilterTypeContains,symbol:"includes","data-default":"true"},is:{value:"is",label:e.tableFilterTypeIs,symbol:"is"},isNot:{value:"isNot",label:e.tableFilterTypeIsNot,symbol:"!=="},notContains:{value:"notContains",label:e.tableFilterTypeNotContains,symbol:"notIncludes"},lessThan:{value:"lessThan",label:e.tableFilterTypeLessThan,symbol:"<="},greaterThan:{value:"greaterThan",label:e.tableFilterTypeGreaterThan,symbol:">="},startsWith:{value:"startsWith",label:e.tableFilterTypeStartsWith,symbol:"startsWith"},endsWith:{value:"endsWith",label:e.tableFilterTypeEndsWith,symbol:"endsWith"}}),[e]);return{options:w.useMemo(()=>({[hs.Text]:[t.is,t.isNot,t.contains,t.notContains,t.startsWith,t.endsWith],[hs.Boolean]:[t.is,t.isNot],[hs.Number]:[t.is,t.isNot,t.greaterThan,t.lessThan]}),[e]),operations:t}},P$=e=>{const t=Tt(),n=jf(),r=()=>{const l=e.cols.at(0);e.set(c=>[...c,Bf(l,n.options,n.operations)])},o=l=>{const c=l.target.dataset.id||"",u=l.target.value;e.set(d=>d.map(f=>{if(c!==f.id)return f;const h=e.cols.find(m=>u===m.id);return Bf(h,n.options,n.operations,{value:""})}))},s=l=>{const c=l.target.dataset.id||"",u=l.target.value;e.set(d=>d.map(f=>f.id===c?{...f,operation:n.operations[u]}:f))},i=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))},a=l=>{const c=l.target.dataset.id||"",u=Rf(l.target);e.set(d=>d.map(f=>f.id===c?{...f,value:u}:f))};return x.jsx(w.Fragment,{children:x.jsx(Qo,{arrow:!0,title:t.tableFilterDropdownTitle,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(HI,{size:14}),t.tableFilterLabel," ",e.filters.length===0?"":` (${e.filters.length})`]}),children:x.jsxs("ul",{className:"mt-4 space-y-2",children:[e.filters.map(l=>{const c=n.options[l.type];return x.jsxs("li",{className:"flex flex-nowrap gap-3",children:[x.jsx(Zr,{options:e.options,title:t.tableFilterColumnTitle,placeholder:t.tableFilterColumnPlaceholder,value:l.name,"data-id":l.id,onChange:o}),x.jsx(Zr,{"data-id":l.id,onChange:s,value:l.operation.value,options:c,title:t.tableFilterOperatorTitle,placeholder:t.tableFilterOperatorPlaceholder}),x.jsx(Pi,{"data-id":l.id,onChange:a,title:t.tableFilterValueTitle,placeholder:t.tableFilterValuePlaceholder,type:l.type,value:l.value,optionalText:""}),x.jsx("div",{className:"mt-5 flex items-center justify-center",children:x.jsx("button",{"data-id":l.id,type:"button",onClick:i,children:x.jsx(Oo,{className:"text-danger",size:16})})})]},`filter-select-${l.id}`)}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-primary",children:[x.jsx(Pu,{size:14})," ",t.tableFilterNewFilter]})})]})})})},k$=({filter:e,onDelete:t,set:n})=>{const r=Tt(),o=jf(),s=a=>{const l=a.target.value,c=a.target.dataset.id||"";n(u=>u.map(d=>d.id===c?{...d,operation:o.operations[l]}:d))},i=a=>{const l=a.target.dataset.id||"",c=Rf(a.target);n(u=>u.map(d=>d.id===l?{...d,value:c}:d))};return x.jsxs("div",{className:"flex flex-nowrap items-center gap-4 py-2",children:[x.jsx(Zr,{"data-id":e.id,onChange:s,value:e.operation.value,options:o.options[e.type],title:r.tableFilterColumnTitle,placeholder:r.tableFilterColumnPlaceholder}),x.jsx(Pi,{"data-id":e.id,onChange:i,type:e.type,value:e.value,title:r.tableFilterValueTitle,placeholder:r.tableFilterValueTitle}),x.jsx("button",{onClick:t,"data-id":e.id,type:"button",className:"mt-4",children:x.jsx(Oo,{className:"text-danger",size:14})})]})},I$=({item:e,onPointerDown:t})=>{const n=_r(0);return x.jsxs(xy,{onPointerDown:t,id:e.groupId,className:"flex flex-row items-center gap-2",value:e,style:{y:n},children:[x.jsx("button",{type:"button",className:"cursor-grab",children:x.jsx(zI,{size:14})}),x.jsx("span",{children:e.groupName})]},e.groupId)},A$=e=>{var l;const t=Tt(),n=$f(e.cols),r=kI(),[o,s]=w.useState(((l=e.groups[0])==null?void 0:l.thead)||""),i=c=>{var v;const u=c.target,d=u.value,f=u.options.selectedIndex,h=((v=u.options.item(f))==null?void 0:v.label)||"";s(h);const m=new Ex(e.rows).GroupBy(d),p=e.cols.find(b=>b.id===d);e.setGroups(jS(m).map((b,y)=>{const g=m[b];return{...p,groupId:_s(),groupKey:d,index:y,rows:g,groupName:b}}))},a=()=>e.setGroups([]);return x.jsx(w.Fragment,{children:x.jsxs(Qo,{arrow:!1,title:t.tableGroupLabel,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(qI,{size:14}),t.tableGroupLabelWithCount,e.groups.length>0?` - ${o}(${e.groups.length})`:""]}),children:[x.jsxs("div",{className:"flex flex-nowrap items-center",children:[x.jsx(Zr,{value:o,title:"Tipo de agrupamento",onChange:i,options:n,placeholder:"Agrupar por..."}),x.jsx(go,{className:"mt-4",onClick:a,theme:"raw","data-id":o,children:x.jsx(Oo,{size:16,className:"text-danger"})})]}),e.groups.length>0?x.jsxs("section",{className:"my-4",children:[x.jsx("header",{children:x.jsx("h2",{className:"text-xl font-medium",children:"Order groups"})}),x.jsx(WT,{children:x.jsx(by,{axis:"y",className:"relative space-y-2",drag:!0,dragControls:r,dragListener:!1,layoutScroll:!0,onReorder:e.setGroups,values:e.groups,children:e.groups.map(c=>x.jsx(I$,{item:c,onPointerDown:u=>{r.start(u),e.setGroups([...e.groups])}},c.groupId))})})]}):null]})})},O$=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.value,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),_$=(e,t)=>e.toSorted(O$(t)),Cx=(e,t,n)=>({id:_s(),type:n,value:e.id,label:t}),D$=e=>{const t=Tt(),n={asc:{label:t.tableSortAsc,value:"asc"},desc:{label:t.tableSortDesc,value:"desc"}},r=[n.asc,n.desc],o=()=>{const l=e.cols[0];l&&e.set(c=>[...c,Cx(l,n.asc.label,n.asc.value)])},s=l=>c=>{const u=c.target.value;e.set(d=>d.map(f=>f.id===l?{...f,value:u}:f))},i=l=>c=>{const u=c.target.value;e.set(d=>d.map(f=>f.id===l?{...f,type:u}:f))},a=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))};return x.jsx(w.Fragment,{children:x.jsx(Qo,{title:t.tableSortDropdownTitle,trigger:x.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[x.jsx(Ty,{size:14}),t.tableSortOrderByLabel," ",e.sorters.length===0?"":` (${e.sorters.length})`]}),children:x.jsxs("ul",{className:"mt-4 space-y-2",children:[e.sorters.map(l=>x.jsxs("li",{className:"flex flex-nowrap gap-3",children:[x.jsx(Zr,{options:e.options,value:l.value,onChange:s(l.id),title:t.tableSortOrderInputTitle,placeholder:t.tableSortOrderInputPlaceholder}),x.jsx(Zr,{onChange:i(l.id),value:l.type,options:r,title:t.tableSortTypeInputTitle,placeholder:t.tableSortTypeInputPlaceholder}),x.jsx("button",{className:"mt-4","data-id":l.id,onClick:a,children:x.jsx(Oo,{className:"text-danger",size:14})})]},`sorter-select-${l.id}`)),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[x.jsx(Pu,{size:14})," ",t.tableSortAddButton]})})]})})})},M$=e=>{const t=Tt(),[n,r]=w.useState(()=>{const a=e.sorters.find(l=>l.value===e.col.id);return a?a.type:"undefined"}),o=()=>r(a=>a==="undefined"?"asc":a==="asc"?"desc":"undefined");w.useEffect(()=>{e.setSorters(a=>{if(n==="undefined")return a.filter(u=>u.value!==e.col.id);const l=a.findIndex(u=>u.value===e.col.id),c=Cx(e.col,n,n);return l===-1?[...a,c]:(a[l]=c,[...a])})},[n,e.col]);const s=`${e.col.id}-sorter-id`,i=Vf(e.col);return x.jsxs("button",{"aria-labelledby":s,className:"isolate flex items-center",onClick:o,type:"button",children:[x.jsxs("span",{id:s,className:"sr-only",children:[t.tableSortDropdownTitle," ",i]}),n==="asc"?x.jsx(RI,{size:14}):null,n==="desc"?x.jsx($I,{size:14}):null,n==="undefined"?x.jsx(Ty,{size:14}):null]})},N$=e=>x.jsx("header",{className:"min-w-full mb-1",children:x.jsxs("div",{className:"flex flex-wrap min-w-full items-center justify-between gap-x-4 gap-y-1",children:[x.jsxs("div",{className:"flex w-fit items-centeend gap-4 whitespace-nowrap py-2",children:[x.jsx("span",{children:x.jsx(P$,{cols:e.cols,options:e.options,filters:e.filters,set:e.setFilters})}),x.jsx("span",{children:x.jsx(D$,{options:e.options,cols:e.cols,sorters:e.sorters,set:e.setSorters})}),x.jsx("span",{children:x.jsx(A$,{rows:e.rows,groups:e.groups,setGroups:e.setGroups,options:e.options,cols:e.cols})})]}),x.jsx("ul",{className:"flex flex-wrap w-full flex-1 flex-grow flex-row items-center md:justify-end gap-4",children:e.filters.map(t=>x.jsxs("li",{className:"flex gap-1 items-center rounded-xl border border-card-border px-4 py-0.5",children:[x.jsxs("span",{children:[x.jsx("span",{className:"size-3 mr-2 aspect-square bg-primary inline-block rounded-full","aria-hidden":"true"}),t.label," ",t.operation.label.toLowerCase(),":"]}),x.jsxs("div",{className:"relative w-min min-w-[1ch]",children:[x.jsx("span",{"aria-hidden":"true",className:"invisible whitespace-pre p-0",children:t.value||" "}),x.jsx("input",{type:t.type,value:t.value,className:"absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-none [appearance:textfield] after:empty:text-primary/70 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onChange:n=>{const r=Rf(n.target);e.setFilters(o=>o.map(s=>t.id===s.id?{...s,value:r}:s))}})]})]},`filter-table-${t.id}`))})]})});function L$(e,t){if(!e||!t)return[];const n=[1];if(e===1&&t===1)return n;e>4&&n.push("-");let r=2;const o=e-r,s=e+r;for(let a=o>2?o:2;a<=Math.min(t,s);a++)n.push(a);const i=t-2;return s+1!==i&&s+1<t&&n.push("_"),s<t&&(n.push(t-2),n.push(t-1),n.push(t)),Array.from(new Set(n))}const F$=e=>{const t=w.useId(),n=Tt(),r=e.asLink||"button",o=w.useMemo(()=>L$(e.current,e.pages),[e.current,e.pages]),s=e.current<e.pages;return x.jsxs("footer",{className:"flex px-1 py-4 items-center justify-center gap-4 lg:justify-between flex-wrap lg:flex-nowrap",children:[x.jsx("p",{children:x.jsx(n.tablePaginationFooter,{...e,sizes:e.sizes,select:e.onChangeSize&&Array.isArray(e.sizes)?x.jsxs(w.Fragment,{children:[x.jsx("label",{htmlFor:t,children:n.tablePaginationSelectLabel}),x.jsx("select",{id:t,value:e.size,className:"cursor-pointer bg-transparent",onChange:i=>{var a;(a=e.onChangeSize)==null||a.call(e,Number(i.target.value))},children:e.sizes.map(i=>x.jsx("option",{value:i,children:i},`pagination-opt-${i}`))})," "]}):null})}),x.jsx("nav",{children:x.jsxs("ul",{className:"flex items-center gap-2",children:[e.current>1?x.jsx("li",{children:x.jsx(r,{href:"previous",className:"",children:n.tablePaginationPrevious})}):null,o.map(i=>i===null?null:x.jsx(w.Fragment,{children:typeof i=="string"?x.jsx("li",{children:"..."}):x.jsx("li",{children:x.jsx(r,{href:i,className:`cursor-pointer px-3 py-1 transition-colors border-b-2 hover:text-primary-subtle hover:border-primary-subtle proportional-nums ${i===e.current?"text-primary border-primary":"border-transparent"}`,children:i})})},`pagination-${i}`)),s?x.jsx("li",{children:x.jsx(r,{href:"next",className:"",children:n.tablePaginationNext})}):null]})})]})},V$={top:0,left:0,right:0,bottom:-1},$$=e=>{var m;const t=Tt(),n=e.filters.filter(p=>p.name===e.header.id),r=n.length>0,o=e.header.allowSort??!0,s=e.header.allowFilter??!0,i=jf(),a=r?UI:GI,l=p=>{const v=p.currentTarget.dataset.id||"";return e.setFilters(b=>b.filter(y=>y.id!==v))},c=w.useCallback(p=>{if(p===null)return;const v=new AbortController;return p.addEventListener("pointerdown",b=>{if(b.target.dataset.type==="resizer")return b.stopPropagation(),b.stopImmediatePropagation()},{signal:v.signal}),()=>v.abort()},[]),u=e.sorters.find(p=>e.header.id===p.value),d=u!=null&&u.type?u.type===Tx.Asc?"ascending":"descending":"none",f=Vf(e.header),h=_r(void 0);return x.jsxs(xy,{...e.header.thProps,as:"th",ref:c,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,style:{width:h},role:"columnheader","aria-sort":d,value:e.header,"aria-busy":e.loading,className:`relative hidden min-w-0 border border-b border-transparent border-b-table-border border-r-table-border font-medium first:table-cell last:border-r-transparent md:table-cell ${((m=e.header.thProps)==null?void 0:m.className)??""}`,children:[x.jsx("span",{className:"flex h-full items-center justify-between px-2 py-4",children:x.jsxs("span",{className:"flex items-center gap-1",children:[e.inlineFilter&&s?x.jsx(Qo,{arrow:!0,trigger:x.jsxs("span",{children:[x.jsxs("span",{id:`${e.header.id}-filter-dropdown-button`,className:"sr-only",children:[t.tableFilterDropdownTitleUnique," ",f]}),x.jsx(a,{"aria-labelledby":`${e.header.id}-filter-dropdown-button`,size:14})]}),title:x.jsxs("span",{className:"text-lg font-medium",children:[t.tableFilterDropdownTitleUnique," ",x.jsx("span",{className:"text-primary",children:f})]}),children:n.length===0===null?null:x.jsxs("ul",{className:"font-medium",children:[n.map(p=>x.jsx("li",{className:"my-1",children:x.jsx(k$,{onDelete:l,filter:p,set:e.setFilters})},`thead-filter-${p.id}`)),x.jsx("li",{children:x.jsxs("button",{type:"button",className:"flex items-center gap-1 text-primary",onClick:()=>e.setFilters(p=>p.concat(Bf(e.header,i.options,i.operations))),children:[x.jsx(Pu,{size:14})," ",t.tableFilterNewFilter]})})]})}):null,x.jsx("span",{className:"pointer-events-auto text-balance text-base",children:e.header.thead}),e.inlineSorter&&o?x.jsx(M$,{col:e.header,setSorters:e.setSorters,sorters:e.sorters}):null]})}),x.jsx(at.button,{drag:"x",draggable:!0,dragListener:!0,dragMomentum:!0,type:"button",animate:!1,dragElastic:0,dragPropagation:!0,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,"data-type":"resizer",title:e.header.id,dragConstraints:V$,whileDrag:{cursor:"grabbing"},className:"absolute right-0 top-0 block h-full w-1 cursor-col-resize hover:bg-primary active:bg-primary",onDrag:(p,v)=>{const b=p.target,y=h.get()||b.getBoundingClientRect().width,g=v.delta.x;return h.set(Math.abs(y+g))}})]})},R$=e=>x.jsx(by,{layout:!0,as:"tr",axis:"x",drag:"x",layoutRoot:!0,role:"row",layoutScroll:!0,values:e.headers,onReorder:e.setCols,className:"bg-table-header text-lg",children:x.jsx(er,{children:e.headers.map(t=>x.jsx($$,{inlineFilter:e.inlineFilter,inlineSorter:e.inlineSorter,loading:e.loading,setFilters:e.setFilters,filters:e.filters,setSorters:e.setSorters,sorters:e.sorters,header:t},`header-child-item-${t.id}`))})}),Px=w.createContext({}),B$=()=>w.useContext(Px),j$=w.forwardRef(({context:e,className:t="",...n},r)=>x.jsx("tbody",{...n,role:"rowgroup",className:`divide-y divide-table-border ${t}`,ref:r,children:x.jsx(er,{children:n.children})})),W$=w.forwardRef(({context:e,className:t="",...n},r)=>x.jsx("table",{...n,ref:r,role:"table",className:`table min-w-full table-auto divide-y divide-table-border text-left ${t??""}`})),z$=w.forwardRef(({context:e,...t},n)=>{const r=B$(),o={...t==null?void 0:t.style,top:Pt.number(r.sticky)?`${r.sticky}px`:void 0};return x.jsx("thead",{...t,style:o,role:"rowgroup",className:"shadow-xs group:sticky top-0 bg-card-background",ref:n})}),H$=w.forwardRef(({context:e,item:t,...n},r)=>x.jsx("tr",{...n,role:"row",ref:r,className:`table-row ${(n==null?void 0:n.className)??""}`})),U$=w.forwardRef((e,t)=>e.context.loadingMore?x.jsx("tfoot",{...e,ref:t,className:"bg-card-background",children:x.jsx("tr",{role:"row",className:"bg-card-background",children:x.jsx("td",{colSpan:999,className:"h-14 bg-card-background px-2",children:x.jsx("span",{className:"block h-2 w-full animate-pulse rounded bg-foreground opacity-60"})})})}):null),G$={TableHead:z$,Table:W$,TableBody:j$,TableRow:H$,TableFoot:U$},Y$=[0,0,0,0,0,0,0,0,0,0],kx=x.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}),q$=(e,t,n)=>x.jsx("td",{role:"cell",colSpan:n.cols.length,className:"hidden h-14 border-l border-table-border px-2 first:table-cell first:border-transparent md:table-cell",children:n.loading?kx:x.jsx(Ov,{})}),K$=(e,t,n)=>{const r=n.cols,o=n.loading;return x.jsx(w.Fragment,{children:r.map((s,i)=>{var d;const a=`${i},${e}`,l=dc(t,s.id),c=s.Element,u=((d=s.cellProps)==null?void 0:d.className)||"";return w.createElement("td",{...s.cellProps,role:"cell","data-matrix":a,key:`accessor-${e}-${i}`,className:`hidden h-14 border-l border-table-border px-2 first:table-cell first:border-transparent md:table-cell ${u}`},o?kx:c?x.jsx(c,{row:t,matrix:a,col:s,rowIndex:e,value:l}):x.jsx(w.Fragment,{children:Pt.nil(l)?"":l}))})})},Z$=()=>x.jsx(w.Fragment,{}),X$=[{}],Ix=({cols:e,filters:t,setCols:n,sorters:r,setFilters:o,setSorters:s,onScrollEnd:i,border:a=!1,pagination:l=null,useControl:c=!1,...u})=>{const d=w.useRef(null),[f,h]=w.useState(!1),m=Ds(i),p=Ds(u.loadingMore),v=w.useMemo(()=>{if(u.loading)return Y$;if(c)return u.rows;const b=new Ex(u.rows);return t.length>0&&t.forEach(y=>y.value===""||Number.isNaN(y.value)?void 0:b.Where(y.name,y.operation.symbol,y.value)),r.length===0?b.Select():_$(b.Select(),r)},[u.rows,t,r,u.loading]);return w.useEffect(()=>{if(d.current===null)return()=>{};const b=d.current,y=new IntersectionObserver(g=>{var E;return g[g.length-1].isIntersecting&&p.current?((E=m.current)==null||E.call(m),void h(!0)):h(!1)});return y.observe(b),()=>y.disconnect()},[]),x.jsxs("div",{className:"min-w-full",children:[x.jsxs("div",{className:`group rounded-lg ${a?"border border-table-border":""}`,children:[x.jsx(h2,{useWindowScroll:!0,followOutput:"smooth",components:G$,totalCount:v.length,data:v.length===0?X$:v,fixedFooterContent:f?Z$:null,itemContent:v.length===0?q$:K$,context:{loading:u.loading,loadingMore:u.loadingMore,cols:e},fixedHeaderContent:()=>x.jsx(R$,{headers:e,filters:t,setCols:n,sorters:r,setFilters:o,setSorters:s,loading:!!u.loading,inlineFilter:u.inlineFilter,inlineSorter:u.inlineSorter})}),x.jsx("div",{"aria-hidden":"true",ref:d,className:"h-0.5 w-full"})]}),l!==null?x.jsx(F$,{...l}):null]})},Q$=(e,t)=>typeof t=="function"?t(e):t,xl=(e,t,n)=>e===t||n==null?void 0:n(t),J$=e=>{const t=w.useMemo(()=>({sticky:e.sticky}),[e.sticky]),n=e.operations??!0,r=w.useMemo(()=>$f(e.cols),[e.cols]),[o,s]=ju({cols:e.cols,sorters:e.sorters??[],groups:e.groups??[],filters:e.filters??[]},i=>{const a=l=>c=>{const u=i.state();return{...u,[l]:Q$(u[l],c)}};return{cols:a("cols"),sorters:a("sorters"),groups:a("groups"),filters:a("filters")}},{postMiddleware:[(i,a)=>{var l;return(l=e.set)==null||l.call(e,i),xl((a==null?void 0:a.filters)??[],i.filters??[],e.setFilters),xl((a==null?void 0:a.sorters)??[],i.sorters??[],e.setSorters),xl((a==null?void 0:a.groups)??[],i.groups??[],e.setGroups),xl((a==null?void 0:a.cols)??[],i.cols??[],e.setCols),i}]});return x.jsx(Px.Provider,{value:t,children:x.jsxs("div",{className:"relative min-w-full","data-component":"table",children:[n?x.jsx(N$,{cols:o.cols,rows:e.rows,options:r,groups:o.groups,filters:o.filters,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,pagination:e.pagination??null,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0}):null,o.groups.length===0?x.jsx(Ix,{...e,index:0,cols:o.cols,options:r,groups:o.groups,filters:o.filters,optionCols:r,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,onScrollEnd:e.onScrollEnd,pagination:e.pagination??null,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0}):x.jsx("div",{className:"flex flex-wrap gap-4",children:o.groups.map((i,a)=>x.jsx("div",{className:"min-w-full",children:x.jsx(Ix,{...e,group:i,index:a,cols:o.cols,pagination:null,rows:i.rows,options:r,groups:o.groups,filters:o.filters,optionCols:r,setCols:s.cols,sorters:o.sorters,setGroups:s.groups,setFilters:s.filters,setSorters:s.sorters,onScrollEnd:e.onScrollEnd,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0})},`group-${i.groupId}`))})]})})};var eR=String.prototype.replace,tR=/%20/g,Wf={RFC1738:"RFC1738",RFC3986:"RFC3986"},zf={default:Wf.RFC3986,formatters:{RFC1738:function(e){return eR.call(e,tR,"+")},RFC3986:function(e){return String(e)}},RFC1738:Wf.RFC1738,RFC3986:Wf.RFC3986},nR=zf,Hf=Object.prototype.hasOwnProperty,Xr=Array.isArray,Nn=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),rR=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(Xr(r)){for(var o=[],s=0;s<r.length;++s)typeof r[s]<"u"&&o.push(r[s]);n.obj[n.prop]=o}}},Ax=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(r[o]=t[o]);return r},oR=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(Xr(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Hf.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var o=t;return Xr(t)&&!Xr(n)&&(o=Ax(t,r)),Xr(t)&&Xr(n)?(n.forEach(function(s,i){if(Hf.call(t,i)){var a=t[i];a&&typeof a=="object"&&s&&typeof s=="object"?t[i]=e(a,s,r):t.push(s)}else t[i]=s}),t):Object.keys(n).reduce(function(s,i){var a=n[i];return Hf.call(s,i)?s[i]=e(s[i],a,r):s[i]=a,s},o)},sR=function(t,n){return Object.keys(n).reduce(function(r,o){return r[o]=n[o],r},t)},iR=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Uf=1024,aR=function(t,n,r,o,s){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=Uf){for(var c=i.length>=Uf?i.slice(l,l+Uf):i,u=[],d=0;d<c.length;++d){var f=c.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===nR.RFC1738&&(f===40||f===41)){u[u.length]=c.charAt(d);continue}if(f<128){u[u.length]=Nn[f];continue}if(f<2048){u[u.length]=Nn[192|f>>6]+Nn[128|f&63];continue}if(f<55296||f>=57344){u[u.length]=Nn[224|f>>12]+Nn[128|f>>6&63]+Nn[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|c.charCodeAt(d)&1023),u[u.length]=Nn[240|f>>18]+Nn[128|f>>12&63]+Nn[128|f>>6&63]+Nn[128|f&63]}a+=u.join("")}return a},lR=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o<n.length;++o)for(var s=n[o],i=s.obj[s.prop],a=Object.keys(i),l=0;l<a.length;++l){var c=a[l],u=i[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:i,prop:c}),r.push(u))}return rR(n),t},cR=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},uR=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},dR=function(t,n){return[].concat(t,n)},fR=function(t,n){if(Xr(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(n(t[o]));return r}return n(t)},Ox={arrayToObject:Ax,assign:sR,combine:dR,compact:lR,decode:iR,encode:aR,isBuffer:uR,isRegExp:cR,maybeMap:fR,merge:oR},_x=FS,Sl=Ox,Ai=zf,hR=Object.prototype.hasOwnProperty,Dx={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},Ln=Array.isArray,pR=Array.prototype.push,Mx=function(e,t){pR.apply(e,Ln(t)?t:[t])},mR=Date.prototype.toISOString,Nx=Ai.default,xt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Sl.encode,encodeValuesOnly:!1,format:Nx,formatter:Ai.formatters[Nx],indices:!1,serializeDate:function(t){return mR.call(t)},skipNulls:!1,strictNullHandling:!1},gR=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Gf={},yR=function e(t,n,r,o,s,i,a,l,c,u,d,f,h,m,p,v,b,y){for(var g=t,T=y,S=0,E=!1;(T=T.get(Gf))!==void 0&&!E;){var C=T.get(t);if(S+=1,typeof C<"u"){if(C===S)throw new RangeError("Cyclic object value");E=!0}typeof T.get(Gf)>"u"&&(S=0)}if(typeof u=="function"?g=u(n,g):g instanceof Date?g=h(g):r==="comma"&&Ln(g)&&(g=Sl.maybeMap(g,function(D){return D instanceof Date?h(D):D})),g===null){if(i)return c&&!v?c(n,xt.encoder,b,"key",m):n;g=""}if(gR(g)||Sl.isBuffer(g)){if(c){var I=v?n:c(n,xt.encoder,b,"key",m);return[p(I)+"="+p(c(g,xt.encoder,b,"value",m))]}return[p(n)+"="+p(String(g))]}var A=[];if(typeof g>"u")return A;var O;if(r==="comma"&&Ln(g))v&&c&&(g=Sl.maybeMap(g,c)),O=[{value:g.length>0?g.join(",")||null:void 0}];else if(Ln(u))O=u;else{var L=Object.keys(g);O=d?L.sort(d):L}var _=l?n.replace(/\./g,"%2E"):n,V=o&&Ln(g)&&g.length===1?_+"[]":_;if(s&&Ln(g)&&g.length===0)return V+"[]";for(var k=0;k<O.length;++k){var M=O[k],F=typeof M=="object"&&typeof M.value<"u"?M.value:g[M];if(!(a&&F===null)){var N=f&&l?M.replace(/\./g,"%2E"):M,R=Ln(g)?typeof r=="function"?r(V,N):V:V+(f?"."+N:"["+N+"]");y.set(t,S);var z=_x();z.set(Gf,y),Mx(A,e(F,R,r,o,s,i,a,l,r==="comma"&&v&&Ln(g)?null:c,u,d,f,h,m,p,v,b,z))}}return A},vR=function(t){if(!t)return xt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||xt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Ai.default;if(typeof t.format<"u"){if(!hR.call(Ai.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=Ai.formatters[r],s=xt.filter;(typeof t.filter=="function"||Ln(t.filter))&&(s=t.filter);var i;if(t.arrayFormat in Dx?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=xt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:xt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:xt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:xt.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:xt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?xt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:xt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:xt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:xt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:xt.encodeValuesOnly,filter:s,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:xt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:xt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:xt.strictNullHandling}},bR=function(e,t){var n=e,r=vR(t),o,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):Ln(r.filter)&&(s=r.filter,o=s);var i=[];if(typeof n!="object"||n===null)return"";var a=Dx[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;o||(o=Object.keys(n)),r.sort&&o.sort(r.sort);for(var c=_x(),u=0;u<o.length;++u){var d=o[u];r.skipNulls&&n[d]===null||Mx(i,yR(n[d],d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,c))}var f=i.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),f.length>0?h+f:""},ps=Ox,Yf=Object.prototype.hasOwnProperty,wR=Array.isArray,yt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ps.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},xR=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},Lx=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},SR="utf8=%26%2310003%3B",TR="utf8=%E2%9C%93",ER=function(t,n){var r={__proto__:null},o=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=n.parameterLimit===1/0?void 0:n.parameterLimit,i=o.split(n.delimiter,s),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===TR?c="utf-8":i[l]===SR&&(c="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var u=i[l],d=u.indexOf("]="),f=d===-1?u.indexOf("="):d+1,h,m;f===-1?(h=n.decoder(u,yt.decoder,c,"key"),m=n.strictNullHandling?null:""):(h=n.decoder(u.slice(0,f),yt.decoder,c,"key"),m=ps.maybeMap(Lx(u.slice(f+1),n),function(v){return n.decoder(v,yt.decoder,c,"value")})),m&&n.interpretNumericEntities&&c==="iso-8859-1"&&(m=xR(m)),u.indexOf("[]=")>-1&&(m=wR(m)?[m]:m);var p=Yf.call(r,h);p&&n.duplicates==="combine"?r[h]=ps.combine(r[h],m):(!p||n.duplicates==="last")&&(r[h]=m)}return r},CR=function(e,t,n,r){for(var o=r?t:Lx(t,n),s=e.length-1;s>=0;--s){var i,a=e[s];if(a==="[]"&&n.parseArrays)i=n.allowEmptyArrays&&(o===""||n.strictNullHandling&&o===null)?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=n.decodeDotInKeys?l.replace(/%2E/g,"."):l,u=parseInt(c,10);!n.parseArrays&&c===""?i={0:o}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[],i[u]=o):c!=="__proto__"&&(i[c]=o)}o=i}return o},PR=function(t,n,r,o){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&i.exec(s),c=l?s.slice(0,l.index):s,u=[];if(c){if(!r.plainObjects&&Yf.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var d=0;r.depth>0&&(l=a.exec(s))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&Yf.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+s.slice(l.index)+"]"),CR(u,n,r,o)}},kR=function(t){if(!t)return yt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?yt.charset:t.charset,r=typeof t.duplicates>"u"?yt.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:yt.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:yt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:yt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:yt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:yt.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:yt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:yt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:yt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:yt.decoder,delimiter:typeof t.delimiter=="string"||ps.isRegExp(t.delimiter)?t.delimiter:yt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:yt.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:yt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:yt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:yt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:yt.strictNullHandling}},IR=function(e,t){var n=kR(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?ER(e,n):e,o=n.plainObjects?Object.create(null):{},s=Object.keys(r),i=0;i<s.length;++i){var a=s[i],l=PR(a,r[a],n,typeof e=="string");o=ps.merge(o,l,n)}return n.allowSparse===!0?o:ps.compact(o)},AR=bR,OR=IR,_R=zf,DR={formats:_R,parse:OR,stringify:AR},De;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(De||(De={}));var Fx;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Fx||(Fx={}));const ae=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qr=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}},X=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class sn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof sn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}sn.create=e=>new sn(e);const Oi=(e,t)=>{let n;switch(e.code){case X.invalid_type:e.received===ae.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case X.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case X.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=t.defaultError,De.assertNever(e)}return{message:n}};let MR=Oi;function qf(){return MR}const Kf=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function se(e,t){const n=qf(),r=Kf({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Oi?void 0:Oi].filter(o=>!!o)});e.common.issues.push(r)}class jt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return be;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return jt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return be;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),_i=e=>({status:"dirty",value:e}),Yt=e=>({status:"valid",value:e}),Vx=e=>e.status==="aborted",$x=e=>e.status==="dirty",Tl=e=>e.status==="valid",El=e=>typeof Promise<"u"&&e instanceof Promise;function Cl(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Rx(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var he;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(he||(he={}));var Di,Mi;class Fn{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bx=(e,t)=>{if(Tl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new sn(e.common.issues);return this._error=n,this._error}}};function xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{var l,c;const{message:u}=e;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:o}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Qr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new jt,ctx:{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(El(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},s=this._parseSync({data:t,path:o.path,parent:o});return Bx(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(El(o)?o:Promise.resolve(o));return Bx(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:X.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Yn({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return qn.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this,this._def)}promise(){return Fi.create(this,this._def)}or(t){return Il.create([this,t],this._def)}and(t){return Al.create(this,t,this._def)}transform(t){return new Yn({...xe(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Nl({...xe(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Hx({typeName:ge.ZodBranded,type:this,...xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ll({...xe(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Fl.create(this,t)}readonly(){return Vl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NR=/^c[^\s-]{8,}$/i,LR=/^[0-9a-z]+$/,FR=/^[0-9A-HJKMNP-TV-Z]{26}$/,VR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$R=/^[a-z0-9_-]{21}$/i,RR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,BR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zf;const WR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zR=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,HR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",UR=new RegExp(`^${jx}$`);function Wx(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function GR(e){return new RegExp(`^${Wx(e)}$`)}function YR(e){let t=`${jx}T${Wx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function qR(e,t){return!!((t==="v4"||!t)&&WR.test(e)||(t==="v6"||!t)&&zR.test(e))}class Hn extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ae.string){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.string,received:s.parsedType}),be}const r=new jt;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&se(o,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")BR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Zf||(Zf=new RegExp(jR,"u")),Zf.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")VR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")$R.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")NR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")LR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")FR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:X.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:X.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:X.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?YR(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?UR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?GR(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?RR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:X.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?qR(t.data,s.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:X.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?HR.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:X.invalid_string,message:s.message}),r.dirty()):De.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:X.invalid_string,...he.errToObj(r)})}_addCheck(t){return new Hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...he.errToObj(t)})}url(t){return this._addCheck({kind:"url",...he.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...he.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...he.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...he.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...he.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...he.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...he.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...he.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...he.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...he.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...he.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...he.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...he.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...he.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...he.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...he.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...he.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...he.errToObj(n)})}nonempty(t){return this.min(1,he.errToObj(t))}trim(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Hn.create=e=>{var t;return new Hn({checks:[],typeName:ge.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};function KR(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Jr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ae.number){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.number,received:s.parsedType}),be}let r;const o=new jt;for(const s of this._def.checks)s.kind==="int"?De.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?KR(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_finite,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,r,o){return new Jr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:he.toString(o)}]})}_addCheck(t){return new Jr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:he.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:he.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Jr.create=e=>new Jr({checks:[],typeName:ge.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class ms extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ae.bigint){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.bigint,received:s.parsedType}),be}let r;const o=new jt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),se(r,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,r,o){return new ms({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:he.toString(o)}]})}_addCheck(t){return new ms({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ms.create=e=>{var t;return new ms({checks:[],typeName:ge.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};class Xf extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ae.boolean){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.boolean,received:r.parsedType}),be}return Yt(t.data)}}Xf.create=e=>new Xf({typeName:ge.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class Ni extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ae.date){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_type,expected:ae.date,received:s.parsedType}),be}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return se(s,{code:X.invalid_date}),be}const r=new jt;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):De.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ni({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:he.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:he.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ni.create=e=>new Ni({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ge.ZodDate,...xe(e)});class Qf extends Pe{_parse(t){if(this._getType(t)!==ae.symbol){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.symbol,received:r.parsedType}),be}return Yt(t.data)}}Qf.create=e=>new Qf({typeName:ge.ZodSymbol,...xe(e)});class Pl extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.undefined,received:r.parsedType}),be}return Yt(t.data)}}Pl.create=e=>new Pl({typeName:ge.ZodUndefined,...xe(e)});class kl extends Pe{_parse(t){if(this._getType(t)!==ae.null){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.null,received:r.parsedType}),be}return Yt(t.data)}}kl.create=e=>new kl({typeName:ge.ZodNull,...xe(e)});class Jf extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return Yt(t.data)}}Jf.create=e=>new Jf({typeName:ge.ZodAny,...xe(e)});class gs extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Yt(t.data)}}gs.create=e=>new gs({typeName:ge.ZodUnknown,...xe(e)});class br extends Pe{_parse(t){const n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ae.never,received:n.parsedType}),be}}br.create=e=>new br({typeName:ge.ZodNever,...xe(e)});class eh extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.void,received:r.parsedType}),be}return Yt(t.data)}}eh.create=e=>new eh({typeName:ge.ZodVoid,...xe(e)});class Vn extends Pe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ae.array)return se(n,{code:X.invalid_type,expected:ae.array,received:n.parsedType}),be;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(se(n,{code:i?X.too_big:X.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(se(n,{code:X.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(se(n,{code:X.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Fn(n,i,n.path,a)))).then(i=>jt.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new Fn(n,i,n.path,a)));return jt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Vn({...this._def,minLength:{value:t,message:he.toString(n)}})}max(t,n){return new Vn({...this._def,maxLength:{value:t,message:he.toString(n)}})}length(t,n){return new Vn({...this._def,exactLength:{value:t,message:he.toString(n)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...xe(t)});function ys(e){if(e instanceof dt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=qn.create(ys(r))}return new dt({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:ys(e.element)}):e instanceof qn?qn.create(ys(e.unwrap())):e instanceof to?to.create(ys(e.unwrap())):e instanceof Gn?Gn.create(e.items.map(t=>ys(t))):e}class dt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=De.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ae.object){const c=this._getOrReturnCtx(t);return se(c,{code:X.invalid_type,expected:ae.object,received:c.parsedType}),be}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof br&&this._def.unknownKeys==="strip"))for(const c in o.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=s[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Fn(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof br){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(se(o,{code:X.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Fn(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>jt.mergeObjectSync(r,c)):jt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return he.errToObj,new dt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=he.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new dt({...this._def,unknownKeys:"strip"})}passthrough(){return new dt({...this._def,unknownKeys:"passthrough"})}extend(t){return new dt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new dt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ge.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new dt({...this._def,catchall:t})}pick(t){const n={};return De.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new dt({...this._def,shape:()=>n})}omit(t){const n={};return De.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new dt({...this._def,shape:()=>n})}deepPartial(){return ys(this)}partial(t){const n={};return De.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new dt({...this._def,shape:()=>n})}required(t){const n={};return De.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof qn;)s=s._def.innerType;n[r]=s}}),new dt({...this._def,shape:()=>n})}keyof(){return zx(De.objectKeys(this.shape))}}dt.create=(e,t)=>new dt({shape:()=>e,unknownKeys:"strip",catchall:br.create(),typeName:ge.ZodObject,...xe(t)}),dt.strictCreate=(e,t)=>new dt({shape:()=>e,unknownKeys:"strict",catchall:br.create(),typeName:ge.ZodObject,...xe(t)}),dt.lazycreate=(e,t)=>new dt({shape:e,unknownKeys:"strip",catchall:br.create(),typeName:ge.ZodObject,...xe(t)});class Il extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new sn(a.ctx.common.issues));return se(n,{code:X.invalid_union,unionErrors:i}),be}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new sn(l));return se(n,{code:X.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}}Il.create=(e,t)=>new Il({options:e,typeName:ge.ZodUnion,...xe(t)});const Un=e=>e instanceof _l?Un(e.schema):e instanceof Yn?Un(e.innerType()):e instanceof Dl?[e.value]:e instanceof eo?e.options:e instanceof Ml?De.objectValues(e.enum):e instanceof Nl?Un(e._def.innerType):e instanceof Pl?[void 0]:e instanceof kl?[null]:e instanceof qn?[void 0,...Un(e.unwrap())]:e instanceof to?[null,...Un(e.unwrap())]:e instanceof Hx||e instanceof Vl?Un(e.unwrap()):e instanceof Ll?Un(e._def.innerType):[];class th extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.object)return se(n,{code:X.invalid_type,expected:ae.object,received:n.parsedType}),be;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(se(n,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=Un(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new th({typeName:ge.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...xe(r)})}}function nh(e,t){const n=Qr(e),r=Qr(t);if(e===t)return{valid:!0,data:e};if(n===ae.object&&r===ae.object){const o=De.objectKeys(t),s=De.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=nh(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===ae.array&&r===ae.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=nh(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ae.date&&r===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Al extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(Vx(s)||Vx(i))return be;const a=nh(s.value,i.value);return a.valid?(($x(s)||$x(i))&&n.dirty(),{status:n.value,value:a.data}):(se(r,{code:X.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Al.create=(e,t,n)=>new Al({left:e,right:t,typeName:ge.ZodIntersection,...xe(n)});class Gn extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.array)return se(r,{code:X.invalid_type,expected:ae.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return se(r,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(se(r,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Fn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>jt.mergeArray(n,i)):jt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Gn({...this._def,rest:t})}}Gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:e,typeName:ge.ZodTuple,rest:null,...xe(t)})};class Ol extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.object)return se(r,{code:X.invalid_type,expected:ae.object,received:r.parsedType}),be;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new Fn(r,a,r.path,a)),value:i._parse(new Fn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?jt.mergeObjectAsync(n,o):jt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Pe?new Ol({keyType:t,valueType:n,typeName:ge.ZodRecord,...xe(r)}):new Ol({keyType:Hn.create(),valueType:t,typeName:ge.ZodRecord,...xe(n)})}}class rh extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.map)return se(r,{code:X.invalid_type,expected:ae.map,received:r.parsedType}),be;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new Fn(r,a,r.path,[c,"key"])),value:s._parse(new Fn(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}rh.create=(e,t,n)=>new rh({valueType:t,keyType:e,typeName:ge.ZodMap,...xe(n)});class vs extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.set)return se(r,{code:X.invalid_type,expected:ae.set,received:r.parsedType}),be;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(se(r,{code:X.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(se(r,{code:X.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return be;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new Fn(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new vs({...this._def,minSize:{value:t,message:he.toString(n)}})}max(t,n){return new vs({...this._def,maxSize:{value:t,message:he.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vs.create=(e,t)=>new vs({valueType:e,minSize:null,maxSize:null,typeName:ge.ZodSet,...xe(t)});class Li extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.function)return se(n,{code:X.invalid_type,expected:ae.function,received:n.parsedType}),be;function r(a,l){return Kf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qf(),Oi].filter(c=>!!c),issueData:{code:X.invalid_arguments,argumentsError:l}})}function o(a,l){return Kf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qf(),Oi].filter(c=>!!c),issueData:{code:X.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Fi){const a=this;return Yt(async function(...l){const c=new sn([]),u=await a._def.args.parseAsync(l,s).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw c.addIssue(o(d,h)),c})})}else{const a=this;return Yt(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new sn([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new sn([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Li({...this._def,args:Gn.create(t).rest(gs.create())})}returns(t){return new Li({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Li({args:t||Gn.create([]).rest(gs.create()),returns:n||gs.create(),typeName:ge.ZodFunction,...xe(r)})}}class _l extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}_l.create=(e,t)=>new _l({getter:e,typeName:ge.ZodLazy,...xe(t)});class Dl extends Pe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return se(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Dl.create=(e,t)=>new Dl({value:e,typeName:ge.ZodLiteral,...xe(t)});function zx(e,t){return new eo({values:e,typeName:ge.ZodEnum,...xe(t)})}class eo extends Pe{constructor(){super(...arguments),Di.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{expected:De.joinValues(r),received:n.parsedType,code:X.invalid_type}),be}if(Cl(this,Di)||Rx(this,Di,new Set(this._def.values)),!Cl(this,Di).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{received:n.data,code:X.invalid_enum_value,options:r}),be}return Yt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return eo.create(t,{...this._def,...n})}exclude(t,n=this._def){return eo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Di=new WeakMap,eo.create=zx;class Ml extends Pe{constructor(){super(...arguments),Mi.set(this,void 0)}_parse(t){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const o=De.objectValues(n);return se(r,{expected:De.joinValues(o),received:r.parsedType,code:X.invalid_type}),be}if(Cl(this,Mi)||Rx(this,Mi,new Set(De.getValidEnumValues(this._def.values))),!Cl(this,Mi).has(t.data)){const o=De.objectValues(n);return se(r,{received:r.data,code:X.invalid_enum_value,options:o}),be}return Yt(t.data)}get enum(){return this._def.values}}Mi=new WeakMap,Ml.create=(e,t)=>new Ml({values:e,typeName:ge.ZodNativeEnum,...xe(t)});class Fi extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.promise&&n.common.async===!1)return se(n,{code:X.invalid_type,expected:ae.promise,received:n.parsedType}),be;const r=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Yt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Fi.create=(e,t)=>new Fi({type:e,typeName:ge.ZodPromise,...xe(t)});class Yn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{se(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return be;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?be:l.status==="dirty"||n.value==="dirty"?_i(l.value):l});{if(n.value==="aborted")return be;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"||n.value==="dirty"?_i(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Tl(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Tl(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);De.assertNever(o)}}Yn.create=(e,t,n)=>new Yn({schema:e,typeName:ge.ZodEffects,effect:t,...xe(n)}),Yn.createWithPreprocess=(e,t,n)=>new Yn({schema:t,effect:{type:"preprocess",transform:e},typeName:ge.ZodEffects,...xe(n)});class qn extends Pe{_parse(t){return this._getType(t)===ae.undefined?Yt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qn.create=(e,t)=>new qn({innerType:e,typeName:ge.ZodOptional,...xe(t)});class to extends Pe{_parse(t){return this._getType(t)===ae.null?Yt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}to.create=(e,t)=>new to({innerType:e,typeName:ge.ZodNullable,...xe(t)});class Nl extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Nl.create=(e,t)=>new Nl({innerType:e,typeName:ge.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xe(t)});class Ll extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return El(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ll.create=(e,t)=>new Ll({innerType:e,typeName:ge.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xe(t)});class oh extends Pe{_parse(t){if(this._getType(t)!==ae.nan){const r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ae.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}oh.create=e=>new oh({typeName:ge.ZodNaN,...xe(e)});class Hx extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Fl extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"?(n.dirty(),_i(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?be:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Fl({in:t,out:n,typeName:ge.ZodPipeline})}}class Vl extends Pe{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Tl(o)&&(o.value=Object.freeze(o.value)),o);return El(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Vl.create=(e,t)=>new Vl({innerType:e,typeName:ge.ZodReadonly,...xe(t)}),dt.lazycreate;var ge;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ge||(ge={})),Hn.create,Jr.create,oh.create,ms.create,Xf.create,Ni.create,Qf.create,Pl.create,kl.create,Jf.create,gs.create,br.create,eh.create,Vn.create,dt.create,dt.strictCreate,Il.create,th.create,Al.create,Gn.create,Ol.create,rh.create,vs.create,Li.create,_l.create,Dl.create,eo.create,Ml.create,Fi.create,Yn.create,qn.create,to.create,Yn.createWithPreprocess,Fl.create;const ZR=e=>{if(typeof e!="string")try{e=JSON.stringify(e)}catch{return!1}try{return JSON.parse(e),!0}catch{return!1}},XR=(e,t,n)=>{const r=t.length-1;for(let o=0;o<t.length;o++){const s=t[o];if(o===r)e[s]=n;else{if(!(s in e)||typeof e[s]!="object"){const i=t[o+1];e[s]=isNaN(Number(i))?{}:[]}e=e[s]}}},Ux=e=>e.replace(/\[(\d+)]/g,".$1").split("."),gn=(e,t,n)=>{const r=Array.isArray(t)?t.map(String):Ux(t),o=structuredClone(e);return XR(o,r,n),o},QR=(e,t)=>e.localeCompare(t),Vi={},Gx=e=>{const t=e._def.typeName;if(t==="ZodDefault")return e._def.defaultValue();if(t==="ZodObject")return Yx(e);if(t==="ZodArray")return[];if("innerType"in e._def){const n=Gx(e._def.innerType);return t==="ZodArray"?n??[]:n}},Yx=e=>Object.fromEntries(Object.entries(e.shape).map(([t,n])=>[t,Gx(n)])),qx=(e,t)=>{const n=structuredClone(e);for(const r in t){const o=t[r],s=e[r];o!==void 0&&(typeof o=="object"&&o!==null&&!Array.isArray(o)&&typeof s=="object"&&s!==null&&!Array.isArray(s)?n[r]=qx(s,o):n[r]=o||s)}return n},JR={sort:QR,allowDots:!0,charset:"utf-8",parseArrays:!0,plainObjects:!0,charsetSentinel:!0,allowPrototypes:!1,depth:Number.MAX_SAFE_INTEGER,arrayLimit:Number.MAX_SAFE_INTEGER,parameterLimit:Number.MAX_SAFE_INTEGER},Kx=e=>{const t=new FormData(e),n=new URLSearchParams(t);return DR.parse(n.toString(),JR)},no=(e,t)=>Ux(e).reduce((n,r)=>{var s;if(r==="")return n;const o=((s=n.shape)==null?void 0:s[r])||n;return o._def.typeName==="ZodArray"?o.element:o},t),wr=e=>e.dataset.value?e.dataset.value:e.type==="checkbox"?e.checked:e.type==="number"?e.valueAsNumber:e.value||e.getAttribute("value"),sh=e=>{const t=e.dataset.target;if(!t)return wr(e);const n=document.querySelector(`[data-origin="${t}"]`);return wr(n||e)},eB={state:{},loading:!1,useOnChange:!1},Zx=e=>e.dataset.target||e.name,tB=e=>{const t=`@use-form/${e}`;return{get:()=>{const n=fs.LocalStorage.get(t);return ZR(n)?n:{}},clear:()=>void fs.LocalStorage.delete(t),set:n=>fs.LocalStorage.set(t,n)}},nB=(e,t,n=eB)=>{const[r,o]=w.useState(null),s=w.useRef({}),[i,a]=w.useState(()=>Pt.function(n==null?void 0:n.state)?n.state():(n==null?void 0:n.state)??Yx(e)??{}),l=w.useCallback(y=>{var A;const g=y.target,T=y.currentTarget;if(g.dataset.optional==="true")return;const E=Zx(g),C=sh(g)||(T?wr(T):""),I=no(E,e);if(g.setAttribute("data-initialized","true"),I){const O=I.safeParse(C),L=O.success?void 0:((A=O.error.issues[0])==null?void 0:A.message)??"";o(_=>gn(_??{},E,L))}},[]),c=w.useCallback(y=>g=>{const T=g.currentTarget,S=Object.values(s.current).reduce((C,I)=>{var V;const A=I.element,O=I.schema.safeParse(wr(A));if(A.dataset.ignore==="ignore"||O.success)return C;const L=(V=O.error.issues[0])==null?void 0:V.message;A.setAttribute("data-initialized","true");const _=A.dataset.name||A.name||"";return gn(C,_,L)},{}),E=Pt.empty(S)?null:S;o(E),console.error(E),y==null||y({form:T,errors:E||{}})},[]),u=(y,g=Vi)=>{const T=no(y,e),S=E=>{var I;if(!E)return;const C=E instanceof Date?E.toISOString():E.target.value;a(A=>gn(A,y,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)};return{...g,loading:n.loading,name:y,id:y,onChange:S,form:t,date:Pt.string(i[y])?new Date(i[y]):i[y],required:g.required??!T.isOptional(),error:r==null?void 0:r[y],ref:E=>{E!==null&&(s.current[y]={element:E,schema:T})}}},d=(y,g=Vi)=>{const T=no(y,e);return{...g,name:y,id:y,onChange:E=>{var I;const C=E.target.value;a(A=>gn(A,y,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)},form:t,loading:n.loading,onInvalid:l,error:Tr(r,y,void 0),value:Tr(i,y,void 0)||"",required:g.required??!T.isOptional(),ref:E=>E!==null?s.current[y]={element:E,schema:T}:void 0}},f=(y,g=Vi)=>{const T=no(y,e);return{...g,name:y,id:y,onChange:E=>{var I;const C=E.target.checked;a(A=>gn(A??{},y,C)),(I=g==null?void 0:g.onChange)==null||I.call(g,E)},form:t,loading:n.loading,onInvalid:l,error:Tr(r,y,void 0),required:g.required??!T.isOptional(),ref:E=>E!==null?void(s.current[y]={element:E,schema:T}):void 0}},h=(y,g=Vi)=>{const T=no(y,e),S=E=>{var I,A;(I=E.persist)==null||I.call(E);const C=E.target.value;(A=g==null?void 0:g.onChange)==null||A.call(g,E),a(O=>gn(O,y,C))};return{...g,loading:n.loading,name:y,id:y,onChange:S,form:t,onInvalid:l,error:Tr(r,y,void 0),required:g.required??!T.isOptional(),value:Tr(i,y,void 0)||(g==null?void 0:g.value)||"",type:Pt.instance(T,Jr)?"number":(g==null?void 0:g.type)??"text",ref:E=>E===null?void 0:s.current[y]={element:E,schema:T}}},m=(y,g=Vi)=>{const T=no(y,e),S=T._def.typeName==="ZodNumber";return{...g,name:y,id:y,onChange:C=>{var A,O;(A=C.persist)==null||A.call(C);const I=S?C.target.valueAsNumber:C.target.value;(O=g==null?void 0:g.onChange)==null||O.call(g,C),a(L=>gn(L,y,I))},form:t,loading:n.loading,onInvalid:l,error:Tr(r,y,void 0),required:g.required??!T.isOptional(),type:S?"number":(g==null?void 0:g.type)??"text",value:Tr(i,y,void 0)||(g==null?void 0:g.value)||"",ref:C=>C===null?void 0:void(s.current[y]={element:C,schema:T})}};w.useEffect(()=>{const y=Object.values(s.current).map(T=>{const S=T.element.dataset.origin?document.querySelector(`[data-target="${T.element.name}"]`):T.element,E=T.schema.safeParse(wr(S)),C=L=>{var F;const _=Zx(L.target);if(!_)return!1;const V=L.target,k=sh(L.target)||(L.relatedTarget?wr(L.relatedTarget):""),M=T.schema.safeParse(k);if(V.setAttribute("value",k),M.success)return S.setCustomValidity(""),o(N=>{if(Pt.null(N))return null;const R=gn(N,_,void 0);return Pt.empty(N)||Pt.nil(N)||Pt.empty(R)?null:R}),!1;if(S.required){const N=((F=M.error.issues[0])==null?void 0:F.message)||"";S.setCustomValidity(N),o(R=>{if(Pt.null(R))return null;const z=gn(R,_,N||void 0);return Pt.empty(z)?null:z})}return!1},I=new AbortController,A=S.getAttribute("data-trigger")||"blur";S.addEventListener(A,C,{signal:I.signal});const O=S.dataset.shadow?!1:S.required?!E.success:!1;return{input:T,hasInitialError:O,unsubscribe:()=>I.abort()}});return y.some(T=>T.hasInitialError)&&o(T=>T===null?{}:T),()=>y.forEach(T=>T.unsubscribe())});const p=y=>g=>{var O;g.preventDefault();const T=g.currentTarget;let S=Kx(T);(t?Array.from(document.querySelectorAll(`[form="${t}"]`)):Array.from(T.elements)).forEach(L=>{if(L.tagName==="SELECT"){const _=L;S=gn(S,_.name,_.value)}if(L.tagName==="INPUT"){const _=L,V=sh(_)||(_?wr(_):"");S=gn(S,_.dataset.target||_.name,V)}});const C=qx(S,i),I=e.safeParse(C),A=()=>{var L;ux(T),(L=n.interceptor)==null||L.clear()};if(I.success){const L=JSON.stringify(I.data);return T.setAttribute("data-json",L),(O=n.interceptor)==null||O.clear(),y==null?void 0:y(g,{form:T,event:g,reset:A,errors:[],success:!0,data:I.data,json:I.data})}return console.group("useForm error"),console.info(I),console.info(I.error.issues),console.error(I.error),console.groupEnd(),T.reportValidity(),y==null?void 0:y(g,{form:T,json:S,event:g,reset:A,data:S,success:!1,errors:I.error.issues.map(L=>({message:L.message,path:L.path.map(_=>String(_))}))})},v=y=>dc(i,y)||"",b=y=>({...y,id:t,name:t});return w.useEffect(()=>{var y;n.interceptor&&((y=n.interceptor)==null||y.set(i))},[i]),{get:v,input:m,state:i,errors:r,select:d,checkbox:f,onSubmit:p,setState:a,textarea:h,onInvalid:c,controller:b,datepicker:u,name:t,disabled:r!==null}},rB=e=>e?JSON.parse(e.getAttribute("data-json")):{},oB=e=>{const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current};J.Alert=QI,J.Autocomplete=x2,J.Button=go,J.Calendar=Iv,J.Card=Av,J.Checkbox=gf,J.ColType=hs,J.Collapse=Iy,J.ComponentsProvider=B_,J.DatePicker=_2,J.Dropdown=Qo,J.Empty=Ov,J.Expand=WN,J.FileUpload=zV,J.Form=UV,J.Input=Pi,J.InputFeedback=Cw,J.InputField=Ci,J.Menu=UN,J.MenuItem=HN,J.Modal=LL,J.MultiCombobox=A2,J.Notifications=GD,J.Polymorph=mo,J.Radiobox=GV,J.RenderOnView=kT,J.Select=Zr,J.Stats=YD,J.Switch=YV,J.Tab=ZD,J.Table=J$,J.Tabs=qD,J.Tag=pc,J.TaskList=qV,J.Textarea=KV,J.Toolbar=FL,J.Tooltip=D0,J.TransferList=QV,J.createColumns=S$,J.createCssProperties=N_,J.createDesignTokens=bv,J.createFormStorage=tB,J.createOptionCols=$f,J.createStyles=D_,J.createTheme=M_,J.createTokenStyles=L_,J.css=Me,J.defaultDarkTheme=$_,J.defaultLightTheme=R_,J.dispatchInput=uc,J.formReset=ux,J.formToJson=Kx,J.getJsonForm=rB,J.getSchemaShape=no,J.initializeInputDataset=Os,J.isReactComponent=wT,J.isReactFC=xT,J.isSsr=Yi,J.mergeRefs=cc,J.negate=ST,J.noop=hc,J.parsers=Ca,J.path=dc,J.reduceTokens=Fo,J.safeRegex=fc,J.splitInto=ap,J.useColorParser=j_,J.useForm=nB,J.useLocale=Uu,J.useNotification=HD,J.usePrevious=oB,J.useReactive=rb,J.useTablePreferences=C$,J.useTranslations=Tt,J.uuid=_s,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
237
237
  //# sourceMappingURL=index.umd.js.map